本文整理匯總了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)
]
)