本文整理汇总了Python中dash_core_components.RadioItems方法的典型用法代码示例。如果您正苦于以下问题:Python dash_core_components.RadioItems方法的具体用法?Python dash_core_components.RadioItems怎么用?Python dash_core_components.RadioItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dash_core_components
的用法示例。
在下文中一共展示了dash_core_components.RadioItems方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: layout
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def layout(self):
return html.Div(
[
html.P(
f"This is the disk usage on \
{self.scratch_dir} per user, \
as of {self.date}."
),
dcc.RadioItems(
id=self.plot_type_id,
options=[
{"label": i, "value": i} for i in ["Pie chart", "Bar chart"]
],
value="Pie chart",
),
wcc.Graph(id=self.chart_id),
]
)
示例2: __init__
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def __init__(self, parent_name, local_name, option_lst, is_inline):
Component.__init__(self, parent_name, local_name)
self._register(
dcc.RadioItems(
id=self.full_name,
options=[{
'label': v,
'value': v
} for v in option_lst],
# value=option_lst[0],
labelStyle={'display': 'inline-block'} if is_inline else None))
示例3: generate_layout
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def generate_layout():
expensive_data = compute_expensive_data()
return html.Div([
html.H3('Last updated at: ' + expensive_data),
html.Div(id='flask-cache-memoized-children'),
dcc.RadioItems(
id='flask-cache-memoized-dropdown',
options=[
{'label': 'Option {}'.format(i), 'value': 'Option {}'.format(i)}
for i in range(1, 4)
],
value='Option 1'
),
html.Div('Results are cached for {} seconds'.format(timeout))
])
示例4: NamedInlineRadioItems
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def NamedInlineRadioItems(name, short, options, val, **kwargs):
return html.Div(
id=f'div-{short}',
style=_merge({
'display': 'block',
'margin-bottom': '5px',
'margin-top': '5px'
}, kwargs.get('style', {})),
children=[
f'{name}:',
dcc.RadioItems(
id=f'radio-{short}',
options=options,
value=val,
labelStyle={
'display': 'inline-block',
'margin-right': '7px',
'font-weight': 300
},
style={
'display': 'inline-block',
'margin-left': '7px'
}
)
],
**_omit(['style'], kwargs)
)
# Custom Image Components
示例5: NamedRadioItems
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def NamedRadioItems(name, **kwargs):
return html.Div(
style={'padding': '20px 10px 25px 4px'},
children=[
html.P(children=f'{name}:'),
dcc.RadioItems(**kwargs)
]
)
# Non-generic
示例6: NamedRadioItems
# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import RadioItems [as 别名]
def NamedRadioItems(name, **kwargs):
return html.Div(
style={'padding': '20px 10px 25px 4px'},
children=[
html.P(children=f'{name}:'),
dcc.RadioItems(**kwargs)
]
)