Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@param.depends(p.param.a, c=p.param.b)
def function(value, c):
pass
@param.depends('polys')
def table_view(self):
return pn.Tabs(('Polygons', self.poly_table), ('Vertices', self.vertex_table))
@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')
@param.depends('disabled', watch=True)
def _update_disabled(self):
self._buttons[False].disabled = self.disabled
self._buttons[True].disabled = self.disabled
@param.depends('alpha')
def tiles(self):
return tiles.opts(alpha=self.alpha)
@param.depends("kickstarter_df", "categories", watch=True)
def _set_scatter_df(self):
self.scatter_df = self.filter_on_categories(self.kickstarter_df, self.categories)
@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'])])
@param.depends('alpha')
def tiles(self):
return tiles.options(alpha=self.alpha, **opts)
@param.depends('period', watch=True)
def _update_period(self):
if self._cb:
self.stop()
self.start()
@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')