本文整理匯總了Python中dash_html_components.P屬性的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.P屬性的具體用法?Python dash_html_components.P怎麽用?Python dash_html_components.P使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類dash_html_components
的用法示例。
在下文中一共展示了dash_html_components.P屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: divs_list
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def divs_list():
return [html.Div([
dcc.Markdown(
'',
id='model-{}-markdown'.format(id)
),
html.P(
'',
id='model-{}-p'.format(id)
),
html.Button(
'Delete',
id='model-{}-delete-button'.format(id),
style={'width': '49%'}
),
html.Button(
'Start/Stop',
id='model-{}-toggle-button'.format(id),
style={'marginLeft': '2%', 'width': '49%'}
),
html.Hr()
], id='model-k2-{}'.format(id)) for id in IDS]
示例2: layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [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),
]
)
示例3: __init__
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def __init__(self, parent_name, local_name, str_value):
Component.__init__(self, parent_name, local_name)
self._register(html.P(id=self.full_name, children=str_value))
# children is perhaps useful if we want to change the text.
示例4: plot_option_layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def plot_option_layout(self) -> List[html.Div]:
"""Renders a dropdown widget for each plot option"""
divs = []
# The plot type dropdown is handled separate
divs.append(
html.Div(
style=self.style_options_div,
children=[
html.H4("Set plot options"),
html.P("Plot type"),
dcc.Dropdown(
id=self.uuid("plottype"),
clearable=False,
options=[{"label": i, "value": i} for i in self.plots],
value=self.plot_options.get("type", "scatter"),
),
],
)
)
# Looping through all available plot options
# and renders a dropdown widget
for key, arg in self.plot_args.items():
divs.append(
html.Div(
style=self.style_options_div_hidden,
id=self.uuid(f"div-{key}"),
children=[
html.P(key),
dcc.Dropdown(
id=self.uuid(f"dropdown-{key}"),
clearable=arg["clearable"],
options=[{"label": i, "value": i} for i in arg["options"]],
value=arg["value"],
multi=arg["multi"],
),
],
)
)
return divs
示例5: make_card_html
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def make_card_html(body, title_text=None, size=12, thresholds=[]):
background_color = "white"
value = None
if type(body[0]) == html.P and body[0].children:
value = int(body[0].children)
if value is not None and len(thresholds) == 2:
good_threshold, bad_threshold = thresholds
if value >= good_threshold:
background_color = "palegreen"
elif value < bad_threshold:
background_color = "lightsalmon"
card_html = html.Div(
[
html.Div(
[html.Div(body, className="card-body", style={"background-color": background_color})],
className="card mb-3 text-center",
)
],
className=f"col-sm-{size}",
)
if title_text is not None:
title = html.H6(title_text, className="card-title")
card_html.children[0].children[0].children.insert(0, title)
return card_html
示例6: effective_n_p
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def effective_n_p(trace_info, varname):
if trace_info.nchains > 1:
try:
text = "Effective sample size = {}".format(
trace_info.effective_n[varname]
)
except KeyError:
text = "Effective sample size not found"
else:
text = "Cannot calculate effective sample size with only one chain"
return html.P(id='univariate-effective-n', children=text)
示例7: gelman_rubin_p
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def gelman_rubin_p(trace_info, varname):
if trace_info.nchains > 1:
text = u"Gelman-Rubin R̂ = {:.4f}".format(
trace_info.gelman_rubin[varname]
)
else:
text = "Cannot calculate Gelman-Rubin statistic with only one chain"
return html.P(id='univariate-gelman-rubin', children=text)
示例8: createThoughts
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def createThoughts(list_of_thoughts):
paragraph_list = []
## skipping the folder_names
for thought in list_of_thoughts[1::2]:
paragraph = html.P(thought)
paragraph_list.append(paragraph)
return paragraph_list
示例9: NamedSlider
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def NamedSlider(name, **kwargs):
return html.Div(
style={'padding': '10px 10px 15px 4px'},
children=[
html.P(f'{name}:'),
html.Div(dcc.Slider(**kwargs), style={'margin-left': '6px'})
]
)
示例10: NamedDropdown
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def NamedDropdown(name, **kwargs):
return html.Div([
html.P(f'{name}:', style={'margin-left': '3px'}),
dcc.Dropdown(**kwargs)
])
示例11: NamedSlider
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def NamedSlider(name, **kwargs):
return html.Div(
style={'padding': '20px 10px 25px 4px'},
children=[
html.P(f'{name}:'),
html.Div(
style={'margin-left': '6px'},
children=dcc.Slider(**kwargs)
)
]
)
示例12: NamedDropdown
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def NamedDropdown(name, **kwargs):
return html.Div(
style={'margin': '10px 0px'},
children=[
html.P(
children=f'{name}:',
style={'margin-left': '3px'}
),
dcc.Dropdown(**kwargs)
]
)
示例13: NamedRadioItems
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [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
示例14: page_not_found
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def page_not_found(pathname):
return _html.P("No page '{}'".format(pathname))
示例15: NamedRadioItems
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import P [as 別名]
def NamedRadioItems(name, **kwargs):
return html.Div(
style={'padding': '20px 10px 25px 4px'},
children=[
html.P(children=f'{name}:'),
dcc.RadioItems(**kwargs)
]
)