How to use the param.depends function in param

To help you get started, we’ve selected a few param examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github holoviz / param / tests / API1 / testparamdepends.py View on Github external
        @param.depends(p.param.a, c=p.param.b)
        def function(value, c):
            pass
github pyviz-topics / EarthSim / earthsim / annotators.py View on Github external
    @param.depends('polys')
    def table_view(self):
        return pn.Tabs(('Polygons', self.poly_table), ('Vertices', self.vertex_table))
github abinit / abipy / abipy / panels / core.py View on Github external
    @param.depends('plot_ebands_btn.clicks')
    def on_plot_ebands_btn(self):
        """Button triggering ebands plot."""
        if self.plot_ebands_btn.clicks == 0: return
        fig1 = self.ebands.plot(e0="fermie", ylims=None,
            with_gaps=self.with_gaps.value, max_phfreq=None, fontsize=8, **self.fig_kwargs)

        fig2 = self.ebands.kpoints.plot(**self.fig_kwargs)
        row = pn.Row(self._mp(fig1), self._mp(fig2)) #, sizing_mode='scale_width')
        text = bkw.PreText(text=self.ebands.to_string(verbose=self.verbose))
        return pn.Column(row, text, sizing_mode='scale_width')
github holoviz / panel / panel / widgets.py View on Github external
    @param.depends('disabled', watch=True)
    def _update_disabled(self):
        self._buttons[False].disabled = self.disabled
        self._buttons[True].disabled = self.disabled
github holoviz / holoviz / examples / tutorial / apps / osm-1billion.py View on Github external
    @param.depends('alpha')
    def tiles(self):
        return tiles.opts(alpha=self.alpha)
github MarcSkovMadsen / awesome-streamlit / gallery / kickstarter_dashboard / kickstarter_dashboard.py View on Github external
    @param.depends("kickstarter_df", "categories", watch=True)
    def _set_scatter_df(self):
        self.scatter_df = self.filter_on_categories(self.kickstarter_df, self.categories)
github holoviz / holoviz / apps / osm-1billion.py View on Github external
    @param.depends()
    def view(self):
        points = hv.DynamicMap(hv.Points(df, kdims=['x', 'y']))
        raster = rasterize(points, x_sampling=1, y_sampling=1, width=900, height=600)
        return hv.DynamicMap(self.tiles) * shade(raster, streams=[hv.streams.Params(self, ['cmap'])])
github holoviz / holoviz / examples / tutorial / apps / nyc_taxi / main.py View on Github external
    @param.depends('alpha')
    def tiles(self):
        return tiles.options(alpha=self.alpha, **opts)
github holoviz / panel / panel / callbacks.py View on Github external
    @param.depends('period', watch=True)
    def _update_period(self):
        if self._cb:
            self.stop()
            self.start()
github abinit / abipy / abipy / panels / structure.py View on Github external
    @param.depends("output_format.value")
    def convert(self):
        return pn.Row(bkw.PreText(text=self.structure.convert(fmt=self.output_format.value)),
                      sizing_mode='stretch_width')