本文整理匯總了Python中dash_core_components.Checklist方法的典型用法代碼示例。如果您正苦於以下問題:Python dash_core_components.Checklist方法的具體用法?Python dash_core_components.Checklist怎麽用?Python dash_core_components.Checklist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dash_core_components
的用法示例。
在下文中一共展示了dash_core_components.Checklist方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: selector
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Checklist [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%'})
示例2: edit_list
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Checklist [as 別名]
def edit_list(add, add2, clear, new_item, items, items_done):
triggered = [t["prop_id"] for t in dash.callback_context.triggered]
adding = len([1 for i in triggered if i in ("add.n_clicks", "new-item.n_submit")])
clearing = len([1 for i in triggered if i == "clear-done.n_clicks"])
new_spec = [
(text, done) for text, done in zip(items, items_done)
if not (clearing and done)
]
if adding:
new_spec.append((new_item, []))
new_list = [
html.Div([
dcc.Checklist(
id={"index": i, "type": "done"},
options=[{"label": "", "value": "done"}],
value=done,
style={"display": "inline"},
labelStyle={"display": "inline"}
),
html.Div(text, id={"index": i}, style=style_done if done else style_todo)
], style={"clear": "both"})
for i, (text, done) in enumerate(new_spec)
]
return [new_list, "" if adding else new_item]
示例3: intersection_option
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Checklist [as 別名]
def intersection_option(self):
options = [
{"label": "Keep zoom state", "value": "keep_zoom_state"},
{"label": "Show surface fill", "value": "show_surface_fill"},
]
value = ["show_surface_fill"]
if self.segyfiles:
options.append({"label": "Show seismic", "value": "show_seismic"})
if self.zonelog is not None:
options.append({"label": "Show zonelog", "value": "show_zonelog"})
value.append("show_zonelog")
return html.Div(
style=self.set_style(marginTop="20px"),
children=[
html.Label("Intersection settings", style={"font-weight": "bold"}),
html.Label("Sampling"),
dcc.Input(
id=self.ids("sampling"),
debounce=True,
type="number",
value=self.sampling,
),
html.Label("Extension"),
dcc.Input(
id=self.ids("nextend"),
debounce=True,
type="number",
value=self.nextend,
),
dcc.Checklist(id=self.ids("options"), options=options, value=value),
],
)
示例4: viz_options_layout
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Checklist [as 別名]
def viz_options_layout(self):
options = [{"label": "Show surface fill", "value": "show_surface_fill"}]
value = ["show_surface_fill"]
if self.segyfiles:
options.append({"label": "Show seismic", "value": "show_seismic"})
if self.zonelog:
options.append({"label": "Show zonelog", "value": "show_zonelog"})
value.append("show_zonelog")
return dcc.Checklist(id=self.ids("options"), options=options, value=value,)
示例5: control_div
# 需要導入模塊: import dash_core_components [as 別名]
# 或者: from dash_core_components import Checklist [as 別名]
def control_div(self):
return [
html.Div(
style={"padding": "5px"},
children=[
html.Label(
"Parameter horizontal axis:", style={"font-weight": "bold"},
),
dcc.Dropdown(
id=self.ids("parameter1"),
options=[{"label": p, "value": p} for p in self.p_cols],
value=self.p_cols[0],
clearable=False,
),
Widgets.dropdown_from_dict(self.ids("ensemble-1"), self.ensembles),
],
),
html.Div(
style={"padding": "5px"},
children=[
html.Label(
"Parameter vertical axis:", style={"font-weight": "bold"}
),
dcc.Dropdown(
id=self.ids("parameter2"),
options=[{"label": p, "value": p} for p in self.p_cols],
value=self.p_cols[0],
clearable=False,
),
Widgets.dropdown_from_dict(self.ids("ensemble-2"), self.ensembles),
],
),
html.Div(
style={"padding": "5px"},
children=[
html.Label("Color scatter by:", style={"font-weight": "bold"}),
dcc.Dropdown(
id=self.ids("scatter-color"),
options=[{"label": p, "value": p} for p in self.p_cols],
),
],
),
dcc.Checklist(
id=self.ids("density"),
style={"padding": "5px"},
options=[{"label": "Show scatterplot density", "value": "density",}],
),
]