本文整理匯總了Python中dash_core_components.Dropdown方法的典型用法代碼示例。如果您正苦於以下問題:Python dash_core_components.Dropdown方法的具體用法?Python dash_core_components.Dropdown怎麽用?Python dash_core_components.Dropdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dash_core_components
的用法示例。
在下文中一共展示了dash_core_components.Dropdown方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: attribute_selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def attribute_selector(self):
return html.Div(
style={"display": "grid"},
children=[
html.Label("Surface attribute"),
html.Div(
style=self.set_grid_layout("6fr 1fr"),
children=[
dcc.Dropdown(
id=self.attr_id,
options=[
{"label": attr, "value": attr} for attr in self.attrs
],
value=self.attrs[0],
clearable=False,
),
self._make_buttons(
self.attr_id_btn_prev, self.attr_id_btn_next
),
],
),
],
)
示例2: well_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def well_layout(self):
return html.Div(
children=html.Label(
children=[
html.Span("Well:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("wells"),
options=[
{"label": Path(well).stem, "value": well}
for well in self.wellfiles
],
value=self.wellfiles[0],
clearable=False,
),
]
)
)
示例3: surface_names_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def surface_names_layout(self):
return html.Div(
style=self.set_style(marginTop="20px"),
children=html.Label(
children=[
html.Span("Surface:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("surfacenames"),
options=[
{"label": name, "value": name} for name in self.surfacenames
],
value=self.surfacenames,
clearable=True,
multi=True,
),
]
),
)
示例4: ensemble_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def ensemble_layout(self):
return html.Div(
style=self.set_style(marginTop="20px"),
children=html.Label(
children=[
html.Span("Ensemble:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("ensembles"),
options=[
{"label": ens, "value": ens}
for ens in self.ensembles.keys()
],
value=list(self.ensembles.keys())[0],
clearable=False,
multi=False,
),
]
),
)
示例5: marginal_log_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def marginal_log_layout(self):
if self.marginal_logs is not None:
return html.Div(
children=html.Label(
children=[
html.Span("Marginal log:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("marginal-log"),
options=[
{"label": log, "value": log}
for log in self.marginal_logs
],
placeholder="Display log",
clearable=True,
),
]
),
)
return html.Div(
style={"visibility": "hidden"},
children=dcc.Dropdown(id=self.ids("marginal-log")),
)
示例6: selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def selector(self, label, id_name, column):
return html.Div(
children=html.Label(
children=[
html.Span(f"{label}:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.uuid(id_name),
options=[
{"label": i, "value": i}
for i in list(self.volumes[column].unique())
],
clearable=False,
value=list(self.volumes[column])[0],
),
]
),
)
示例7: plot_selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def plot_selector(self):
"""Radiobuttons to select plot type"""
return html.Div(
children=[
html.Span("Plot type:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.uuid("plot-type"),
options=[
{"label": i, "value": i}
for i in [
"Per realization",
"Per sensitivity name",
"Per sensitivity case",
]
],
value="Per realization",
clearable=False,
),
]
)
示例8: response_selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def response_selector(self):
"""Dropdown to select volumetric response"""
return html.Div(
children=html.Label(
children=[
html.Span("Volumetric calculation:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.uuid("response"),
options=[
{"label": volume_description(i), "value": i}
for i in self.responses
],
clearable=False,
value=self.initial_response
if self.initial_response in self.responses
else self.responses[0],
),
]
),
)
示例9: ensemble_selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def ensemble_selector(self):
"""Dropdown to select ensemble"""
return html.Div(
style={"paddingBottom": "30px"},
children=html.Label(
children=[
html.Span("Ensemble:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("ensemble"),
options=[
{"label": i, "value": i}
for i in list(self.data["ENSEMBLE"].unique())
],
clearable=False,
value=list(self.data["ENSEMBLE"].unique())[0],
),
]
),
)
示例10: smry_selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def smry_selector(self):
"""Dropdown to select ensemble"""
return html.Div(
style={"paddingBottom": "30px"},
children=html.Label(
children=[
html.Span("Time series:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("vector"),
options=[
{
"label": f"{simulation_vector_description(vec)} ({vec})",
"value": vec,
}
for vec in self.smry_cols
],
clearable=False,
value=self.initial_vector,
),
]
),
)
示例11: well_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def well_layout(self):
return html.Div(
children=html.Label(
children=[
html.Span("Well:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("wells"),
options=[
{"label": Path(well).stem, "value": well}
for well in self.wellfiles
],
value=self.wellfiles[0],
clearable=False,
),
]
),
)
示例12: seismic_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def seismic_layout(self):
return html.Div(
style={} if self.segyfiles else {"display": "none"},
children=html.Label(
children=[
html.Span("Seismic:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("cube"),
options=[
{"label": Path(segy).stem, "value": segy}
for segy in self.segyfiles
]
if self.segyfiles
else None,
value=self.segyfiles[0] if self.segyfiles else None,
clearable=False,
),
]
),
)
示例13: selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def selector(title, trace, varname, include_transformed_chooser=True):
children = [
html.Label("Variable"),
dcc.Dropdown(
id='{}-selector'.format(title),
options=get_varname_options(trace),
value=varname
)
]
if include_transformed_chooser:
children.append(
dcc.Checklist(
id='{}-selector-include-transformed'.format(title),
options=[{
'label': "Include transformed variables",
'value': 'include_transformed'
}],
values=[]
)
)
return html.Div(children, style={'width': '20%'})
示例14: display_dropdowns
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def display_dropdowns(n_clicks, children):
new_element = html.Div([
dcc.Dropdown(
id={
'type': 'dynamic-dropdown',
'index': n_clicks
},
options=[{'label': i, 'value': i} for i in ['NYC', 'MTL', 'LA', 'TOKYO']]
),
html.Div(
id={
'type': 'dynamic-output',
'index': n_clicks
}
)
])
children.append(new_element)
return children
示例15: display_dropdowns
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Dropdown [as 別名]
def display_dropdowns(n_clicks, existing_children):
existing_children.append(html.Div([
dcc.Dropdown(
id={
'type': 'filter-dropdown-ex3',
'index': n_clicks
},
options=[{'label': i, 'value': i} for i in df['country'].unique()],
value=df['country'].unique()[n_clicks]
),
html.Div(id={
'type': 'output-ex3',
'index': n_clicks
})
]))
return existing_children