本文整理匯總了Python中panel.panel方法的典型用法代碼示例。如果您正苦於以下問題:Python panel.panel方法的具體用法?Python panel.panel怎麽用?Python panel.panel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panel
的用法示例。
在下文中一共展示了panel.panel方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def __init__(self, cat, **kwargs):
self.cat = cat
super().__init__(cats=[self.cat], **kwargs)
self.panel = pn.Column(
pn.Row(
pn.panel(ICONS['logo']),
pn.Row(
pn.Column(
self.select.panel,
self.control_panel,
margin=0
),
self.description.panel,
margin=0
),
),
self.plot.panel
)
示例2: __init__
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def __init__(self, cats=None):
self.source = SourceGUI()
self.cat = CatGUI(cats=cats, done_callback=self.done_callback)
self.panel = pn.Column(
pn.Row(
pn.panel(ICONS['logo']),
pn.Column(
self.cat.select.panel,
self.cat.control_panel,
margin=0, width_policy='max'),
pn.Column(
self.source.select.panel,
self.source.control_panel,
margin=0, width_policy='max'
),
self.source.description.panel,
margin=0, width_policy='max'
),
pn.Row(self.cat.search.panel, self.cat.add.panel,
self.source.plot.panel, width_policy='max'),
width_policy='max'
)
super(GUI, self).__init__()
示例3: panel
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def panel(self):
map_view = self.annot.map_view().opts(height=600, width=600) * gvts.EsriImagery
return pn.Row(pn.Column(map_view, pn.panel(self.param, parameters=['create'], show_name=False)),
pn.Column(self.annot.point_table,
pn.panel(self.param, parameters=['node_spacing'], show_name=False)))
示例4: __repr__
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def __repr__(self):
raise RuntimeError("Please install panel to use the GUI (`conda "
"install -c conda-forge panel>0.8.0`)")
示例5: sources
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def sources(self):
"""Sources that have been selected from the source sub-panel"""
return self.source.sources
示例6: panel
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def panel(self):
return pn.Row(
pn.panel(self.param, widgets={'start': pn.widgets.DateSlider}),
self.update_plot
)
示例7: _temp_comp_sub
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def _temp_comp_sub(self, usub=None):
if usub is None:
usub = self.strm_usub.usub
if self._normalize:
C, S = self.C_norm_sub, self.S_norm_sub
else:
C, S = self.C_sub, self.S_sub
cur_temp = dict()
if self._showC:
cur_temp['C'] = (
hv.Dataset(C.sel(unit_id=usub)
.compute().rename("Intensity (A. U.)")
.dropna('frame', how='all')).to(hv.Curve, 'frame'))
if self._showS:
cur_temp['S'] = (
hv.Dataset(S.sel(unit_id=usub)
.compute().rename("Intensity (A. U.)")
.dropna('frame', how='all')).to(hv.Curve, 'frame'))
cur_vl = (hv.DynamicMap(
lambda f, y: hv.VLine(f) if f else hv.VLine(0),
streams=[self.strm_f])
.opts(style=dict(color='red')))
cur_cv = hv.Curve([], kdims=['frame'], vdims=['Internsity (A.U.)'])
self.strm_f.source = cur_cv
h_cv = len(self._w) // 8
w_cv = len(self._w) * 2
temp_comp = (cur_cv
* datashade_ndcurve(hv.HoloMap(cur_temp, 'trace')
.collate().overlay('trace')
.grid('unit_id')
.add_dimension('time', 0, 0),
'trace')
.opts(plot=dict(shared_xaxis=True))
.map(lambda p: p.opts(
plot=dict(frame_height=h_cv,
frame_width=w_cv)),
hv.RGB)
* cur_vl)
temp_comp[temp_comp.keys()[0]] = (temp_comp[temp_comp.keys()[0]]
.opts(plot=dict(height=h_cv + 75)))
return pn.panel(temp_comp)
示例8: _spatial_all
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def _spatial_all(self):
metas = self.metas
Asum = (regrid(hv.Image(
self.Asum.sel(**metas), ['width', 'height']), precompute=True)
.opts(plot=dict(
frame_height=len(self._h),
frame_width=len(self._w)),
style=dict(cmap='Viridis')))
cents = (hv.Dataset(
self.cents_sub.drop(list(self.meta_dicts.keys()), axis='columns'),
kdims=['width', 'height', 'unit_id'])
.to(hv.Points, ['width', 'height'])
.opts(style=dict(alpha=0.1,
line_alpha=0,
size=5,
nonselection_alpha=0.1,
selection_alpha=0.9))
.collate()
.overlay('unit_id')
.opts(plot=dict(tools=['hover', 'box_select'])))
self.strm_uid.source = cents
fim = fct.partial(hv.Image, kdims=['width', 'height'])
AC = (regrid(hv.DynamicMap(fim, streams=[self.pipAC]),
precompute=True)
.opts(plot=dict(
frame_height=len(self._h),
frame_width=len(self._w)),
style=dict(cmap='Viridis')))
mov = (regrid(hv.DynamicMap(fim, streams=[self.pipmov]),
precompute=True)
.opts(plot=dict(
frame_height=len(self._h),
frame_width=len(self._w)),
style=dict(cmap='Viridis')))
lab = fct.partial(hv.Labels, kdims=['width', 'height'], vdims=['unit_id'])
ulab = (hv.DynamicMap(lab, streams=[self.pipusub])
.opts(style=dict(text_color='red')))
return pn.panel(Asum * cents + AC * ulab + mov)
示例9: __call__
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import panel [as 別名]
def __call__(self, x=None, y=None, kind=None, **kwds):
"""
Default plot method (for more detailed options use specific
plot method, e.g. df.hvplot.line)
Parameters
----------
x, y : string, optional
Field name in the data to draw x- and y-positions from
kind : string, optional
The kind of plot to generate, e.g. 'line', 'scatter', etc.
**kwds : optional
Keyword arguments to pass on to
:py:meth:`hvplot.converter.HoloViewsConverter`.
Returns
-------
HoloViews object: Object representing the requested visualization
"""
if isinstance(kind, str) and kind not in self.__all__:
raise NotImplementedError("kind='{kind}' for data of type {type}".format(
kind=kind, type=type(self._data)))
if panel_available:
panel_args = ['widgets', 'widget_location', 'widget_layout', 'widget_type']
panel_dict = {}
for k in panel_args:
if k in kwds:
panel_dict[k] = kwds.pop(k)
dynamic, arg_deps, arg_names = process_dynamic_args(x, y, kind, **kwds)
if dynamic or arg_deps:
@pn.depends(*arg_deps, **dynamic)
def callback(*args, **dyn_kwds):
xd = dyn_kwds.pop('x', x)
yd = dyn_kwds.pop('y', y)
kindd = dyn_kwds.pop('kind', kind)
combined_kwds = dict(kwds, **dyn_kwds)
fn_args = defaultdict(list)
for name, arg in zip(arg_names, args):
fn_args[(name, kwds[name])].append(arg)
for (name, fn), args in fn_args.items():
combined_kwds[name] = fn(*args)
plot = self._get_converter(xd, yd, kindd, **combined_kwds)(kindd, xd, yd)
return pn.panel(plot, **panel_dict)
return pn.panel(callback)
if panel_dict:
plot = self._get_converter(x, y, kind, **kwds)(kind, x, y)
return pn.panel(plot, **panel_dict)
return self._get_converter(x, y, kind, **kwds)(kind, x, y)