本文整理汇总了Python中panel.Column方法的典型用法代码示例。如果您正苦于以下问题:Python panel.Column方法的具体用法?Python panel.Column怎么用?Python panel.Column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panel
的用法示例。
在下文中一共展示了panel.Column方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: player_with_name_and_value
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def player_with_name_and_value(source):
"""
source: pn.widgets.DiscretePlayer()
target: consists of source player's name, value and player itself
With pn.widgets.DiscretePlayer, we don't get name and
value updates in textual form. This method is useful
in case we want name and continuous value update.
"""
mark = pn.pane.Markdown(f'{source.value}')
def callback(*events):
for event in events:
if event.name == 'value':
mark.object = str(event.new)
source.param.watch(callback, ['value'], onlychanged=False)
target = pn.Column(pn.Row(source.name, mark), source)
return target
示例2: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [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
)
示例3: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, sources=None, cats=None, done_callback=None, **kwargs):
"""Set sources or cats to initialize the class - sources trumps cats.
The order of the calls in this method matters and is different
from the order in other panel init methods because the top level
gui class needs to be able to watch these widgets.
"""
self.panel = pn.Column(name='Select Data Source', margin=0)
self.widget = pn.widgets.MultiSelect(size=9, min_width=200, width_policy='min')
self.done_callback = done_callback
super().__init__(**kwargs)
if sources is not None:
self.items = sources
elif cats is not None:
self.cats = cats
示例4: setup
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def setup(self):
self._setup_watchers()
self.children = [
pn.Column(
pn.Row(
pn.Column(
self.select.panel,
self.control_panel,
margin=0,
),
self.description.panel,
margin=0,
),
self.plot.panel,
margin=0,
width_policy='max'
)
]
示例5: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [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__()
示例6: panel
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [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)))
示例7: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, data):
super().__init__()
self.data = data
self.name = 'Set Coords'
self.coord_selector = pn.widgets.CrossSelector(
value=list(self.data.coords),
options=list(self.data.variables)
)
self.panel = pn.Column(
pn.pane.Markdown(TEXT, margin=(0, 20)),
self.coord_selector, name=self.name)
示例8: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, data):
super().__init__()
self.data = data
dim_header = pn.pane.Markdown('### Plot Dimensions', margin=(0, 20, 0, 20))
self.x = pn.widgets.Select(name='x', width=240, margin=(0, 20, 5, 20))
self.y = pn.widgets.Select(name='y', width=240, margin=(0, 20, 20, 20))
agg_header = pn.pane.Markdown('### Aggregations', margin=(0, 20, 0, 20))
self.agg_selectors = pn.Column()
self.agg_opts = ['select', 'animate', 'mean', 'max',
'min', 'median', 'std', 'count']
self.series_col = pn.Column()
self.are_var_coords = False
self._register(self.x, 'x')
self._register(self.y, 'y')
self.connect('x', self.change_y)
self.connect('y', self.change_dim_selectors)
self.panel = pn.Column(
pn.pane.Markdown(TEXT, margin=(0, 10)),
pn.Row(
pn.WidgetBox(dim_header, self.x, self.y,
background=(240, 240, 240)),
pn.Spacer(),
pn.WidgetBox(agg_header, self.agg_selectors,
background=(240, 240, 240))
),
self.series_col,
name='Axes')
示例9: kwargs
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def kwargs(self):
# Column(name='Axes')
# [0] Row
# [0] Column(background='rgb(175,175,175)')
# [0] Markdown(str)
# [1] Select(name='x', width=200)
# [2] Select(name='y', width=200)
# [1] Spacer()
# [2] Column(background='rgb(175,175,175)')
# [0] Markdown(str)
# [1] Column()
# [1] Column
# [0] Select()
out = {p.name: p.value for p in self.panel[1][0][1:]} # since panel[0][0][1] is Markdown
selectors = {p.name: p.value for p in self.panel[1][2][1]} # remaining_dims
out.update(selectors)
dims_to_select_animate = [dim for dim, agg in selectors.items() if agg in ['select', 'animate']]
dims_to_agg = [dim for dim in selectors
if dim not in dims_to_select_animate]
out.update({'dims_to_agg': dims_to_agg})
out.update({'dims_to_select_animate': sorted(dims_to_select_animate)})
out.update({'are_var_coords': self.are_var_coords})
# remaining_dims = dims_to_agg + dims_to_select_animate
out.update({'remaining_dims': self.remaining_dims})
out.update({p.name: p.value for p in self.series_col})
return out
示例10: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self):
super().__init__()
self.frame_height = pn.widgets.IntSlider(name='frame_height', value=300, start=100,
end=1200)
self.frame_width = pn.widgets.IntSlider(name='frame_width', value=450, start=100,
end=1200)
self.cmap = pn.widgets.Select(name='cmap', value='Inferno',
options=list_cmaps())
self.colorbar = pn.widgets.Checkbox(name='colorbar', value=True, width=150)
# colormap_limits
self.lower_limit = pn.widgets.TextInput(name='cmap lower limit',
width=140)
self.upper_limit = pn.widgets.TextInput(name='cmap upper limit',
width=140)
self.use_all_data = pn.widgets.Checkbox(name='compute min/max from all data', value=False)
scaling_ops = ['linear', 'exp', 'log', 'reciprocal', 'square', 'sqrt']
self.color_scale = pn.widgets.Select(name='color_scale',
value='linear',
options=scaling_ops)
self.rasterize = pn.widgets.Checkbox(name='rasterize', value=True, width=150)
self._register(self.use_all_data, 'clear_cmap_limits')
self._register(self.color_scale, 'clear_cmap_limits')
self.connect('clear_cmap_limits', self.setup)
self.panel = pn.Column(
pn.pane.Markdown(TEXT, margin=(0, 10)),
pn.Row(self.frame_height, self.frame_width),
pn.Row(self.cmap, self.color_scale),
pn.Row(self.lower_limit, self.upper_limit),
pn.Row(self.use_all_data, self.colorbar, self.rasterize),
name='Style'
)
示例11: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, filters=['yaml', 'yml'], done_callback=None, **kwargs):
self.filters = filters
self.panel = pn.Column(name='Local', width_policy='max', margin=0)
self.done_callback = done_callback
self.fs = fsspec.filesystem("file")
super().__init__(**kwargs)
示例12: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, cats=None, done_callback=None, **kwargs):
"""Set cats to initialize the class.
The order of the calls in this method matters and is different
from the order in other panel init methods because the top level
gui class needs to be able to watch these widgets.
"""
self.panel = pn.Column(name='Select Catalog', margin=0)
self.widget = pn.widgets.MultiSelect(size=9, min_width=200, width_policy='min')
self.done_callback = done_callback
super().__init__(**kwargs)
self.items = cats if cats is not None else [intake.cat]
示例13: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self, source=None, **kwargs):
self.source = source
self.panel = pn.Column(name='Description', width_policy='max',
margin=0, height=240, sizing_mode='stretch_width',
scroll=True)
super().__init__(**kwargs)
示例14: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def __init__(self):
self.panel = pn.Column(pn.Spacer())
self.dirty = True # don't use kwargs until source is set
示例15: test_all_view
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Column [as 别名]
def test_all_view():
"""Test that we can construct and view all Alerts"""
alerts = []
for alert_type in ALERT_TYPES:
text = f"""\
This is a **{alert_type}** alert with [an example link](https://panel.holoviz.org/).
Give it a click if you like."""
alert = Alert(text=text, alert_type=alert_type)
alerts.append(alert)
assert "alert" in alert.css_classes
assert f"alert-{alert_type}" in alert.css_classes
return pn.Column(*alerts, sizing_mode="stretch_width")