本文整理汇总了Python中panel.Row方法的典型用法代码示例。如果您正苦于以下问题:Python panel.Row方法的具体用法?Python panel.Row怎么用?Python panel.Row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panel
的用法示例。
在下文中一共展示了panel.Row方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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: setup
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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'
)
]
示例3: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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__()
示例4: test_embed_select_str_link
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def test_embed_select_str_link(document, comm):
select = Select(options=['A', 'B', 'C'])
string = Str()
def link(target, event):
target.object = event.new
select.link(string, callbacks={'value': link})
panel = Row(select, string)
with config.set(embed=True):
model = panel.get_root(document, comm)
embed_state(panel, model, document)
_, state = document.roots
assert set(state.state) == {'A', 'B', 'C'}
for k, v in state.state.items():
content = json.loads(v['content'])
assert 'events' in content
events = content['events']
assert len(events) == 1
event = events[0]
assert event['kind'] == 'ModelChanged'
assert event['attr'] == 'text'
assert event['model'] == model.children[1].ref
assert event['new'] == '<pre>%s</pre>' % k
示例5: test_embed_float_slider_explicit_values
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def test_embed_float_slider_explicit_values(document, comm):
select = FloatSlider()
string = Str()
def link(target, event):
target.object = event.new
select.link(string, callbacks={'value': link})
panel = Row(select, string)
with config.set(embed=True):
model = panel.get_root(document, comm)
embed_state(panel, model, document, states={select: [0.1, 0.7, 1]})
_, state = document.roots
assert set(state.state) == {0, 1, 2}
states = {0: 0.1, 1: 0.7, 2: 1}
for (k, v) in state.state.items():
content = json.loads(v['content'])
assert 'events' in content
events = content['events']
assert len(events) == 1
event = events[0]
assert event['kind'] == 'ModelChanged'
assert event['attr'] == 'text'
assert event['model'] == model.children[1].ref
assert event['new'] == '<pre>%s</pre>' % states[k]
示例6: test_embed_select_explicit_values
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def test_embed_select_explicit_values(document, comm):
select = Select(options=['A', 'B', 'C'])
string = Str()
def link(target, event):
target.object = event.new
select.link(string, callbacks={'value': link})
panel = Row(select, string)
with config.set(embed=True):
model = panel.get_root(document, comm)
embed_state(panel, model, document, states={select: ['A', 'B']})
_, state = document.roots
assert set(state.state) == {'A', 'B'}
for k, v in state.state.items():
content = json.loads(v['content'])
assert 'events' in content
events = content['events']
assert len(events) == 1
event = events[0]
assert event['kind'] == 'ModelChanged'
assert event['attr'] == 'text'
assert event['model'] == model.children[1].ref
assert event['new'] == '<pre>%s</pre>' % k
示例7: test_embed_select_str_link_with_secondary_watch
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def test_embed_select_str_link_with_secondary_watch(document, comm):
select = Select(options=['A', 'B', 'C'])
string = Str()
select.link(string, value='object')
string.param.watch(print, 'object')
panel = Row(select, string)
with config.set(embed=True):
model = panel.get_root(document, comm)
embed_state(panel, model, document)
_, state = document.roots
assert set(state.state) == {'A', 'B', 'C'}
for k, v in state.state.items():
content = json.loads(v['content'])
assert 'events' in content
events = content['events']
assert len(events) == 1
event = events[0]
assert event['kind'] == 'ModelChanged'
assert event['attr'] == 'text'
assert event['model'] == model.children[1].ref
assert event['new'] == '<pre>%s</pre>' % k
示例8: test_embed_checkbox_str_link
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def test_embed_checkbox_str_link(document, comm):
checkbox = Checkbox()
string = Str()
def link(target, event):
target.object = event.new
checkbox.link(string, callbacks={'value': link})
panel = Row(checkbox, string)
with config.set(embed=True):
model = panel.get_root(document, comm)
embed_state(panel, model, document)
_, state = document.roots
assert set(state.state) == {'false', 'true'}
for k, v in state.state.items():
content = json.loads(v['content'])
assert 'events' in content
events = content['events']
assert len(events) == 1
event = events[0]
assert event['kind'] == 'ModelChanged'
assert event['attr'] == 'text'
assert event['model'] == model.children[1].ref
assert event['new'] == '<pre>%s</pre>' % k.title()
示例9: panel
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def panel(self):
return pn.Row(self.map_view)
示例10: panel
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def panel(self):
return pn.Row(self.param, self.view())
示例11: panel
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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)))
示例12: create_selectors_players
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def create_selectors_players(self, graph):
"""
Converts the sliders generated by hvplot into selectors/players.
This is applicable only when both `x` and `y` are present in variable
coordinates. It converts any sliders generated by hvplot into
selectors/players and moves them to the bottom of graph.
"""
if len(self.data[self.var].dims) > 2 and self.kwargs['extract along']:
self.taps_graph = hv.DynamicMap(self.create_taps_graph,
streams=[self.tap_stream,
self.clear_points])
self.clear_series_button.disabled = False
graph = graph * self.taps_graph
else:
self.clear_series_button.disabled = True
graph = pn.Row(graph)
self.output[0] = look_for_class(graph, pn.pane.HoloViews)[0]
sliders = look_for_class(graph, pn.widgets.Widget)
for slider in sliders:
for dim in self.kwargs['dims_to_select_animate']:
long_name = self.data[dim].long_name if hasattr(
self.data[dim], 'long_name') else None
if slider.name == dim or slider.name == long_name:
if self.kwargs[dim] == 'select':
selector = convert_widget(slider, pn.widgets.Select)
else:
selector = convert_widget(slider, pn.widgets.DiscretePlayer)
self.index_selectors.append(selector)
for selector in self.index_selectors:
if isinstance(selector, pn.widgets.Select):
self.output[1].append(selector)
else:
player = player_with_name_and_value(selector)
self.output[1].append(player)
示例13: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [as 别名]
def __init__(self, data):
super().__init__()
self.data = data
self.name = 'Variables'
self.select = pn.widgets.Select(
min_width=100, max_width=200, width_policy='max',
name=self.name)
self.set_variables()
self._register(self.select, "variable_selected")
self.panel = pn.Row(self.select)
示例14: __init__
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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')
示例15: kwargs
# 需要导入模块: import panel [as 别名]
# 或者: from panel import Row [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