本文整理匯總了Python中dash_html_components.H2屬性的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.H2屬性的具體用法?Python dash_html_components.H2怎麽用?Python dash_html_components.H2使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類dash_html_components
的用法示例。
在下文中一共展示了dash_html_components.H2屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: compute_stats
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import H2 [as 別名]
def compute_stats(questions: List[Question], db_path):
n_total = len(questions)
n_guesser_train = sum(1 for q in questions if q.fold == 'guesstrain')
n_guesser_dev = sum(1 for q in questions if q.fold == 'guessdev')
n_buzzer_train = sum(1 for q in questions if q.fold == 'buzzertrain')
n_buzzer_dev = sum(1 for q in questions if q.fold == 'buzzerdev')
n_dev = sum(1 for q in questions if q.fold == 'dev')
n_test = sum(1 for q in questions if q.fold == 'test')
columns = ['N Total', 'N Guesser Train', 'N Guesser Dev', 'N Buzzer Train', 'N Buzzer Dev', 'N Dev', 'N Test']
data = np.array([n_total, n_guesser_train, n_guesser_dev, n_buzzer_train, n_buzzer_dev, n_dev, n_test])
norm_data = 100 * data / n_total
return html.Div([
html.Label('Database Path'), html.Div(db_path),
html.H2('Fold Distribution'),
html.Table(
[
html.Tr([html.Th(c) for c in columns]),
html.Tr([html.Td(c) for c in data]),
html.Tr([html.Td(f'{c:.2f}%') for c in norm_data])
]
)
])
示例2: Section
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import H2 [as 別名]
def Section(title, links, description=None, headerStyle={}):
return html.Div(className='toc--section', children=[
html.H2(title, style=merge(styles['underline'], headerStyle)),
(
html.Div(description)
if description is not None else None
),
html.Ul(links, className='toc--chapters')
])
示例3: component_list
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import H2 [as 別名]
def component_list(
package, content_module, base_url, import_alias,
component_library, escape_tags=False,
ad='dash-enterprise-kubernetes.jpg',
adhref='https://plotly.com/dash/kubernetes/?utm_source=docs&utm_medium=sidebar&utm_campaign=june&utm_content=kubernetes'):
return [
{
'url': tools.relpath('/{}/{}'.format(base_url, component.lower())),
'name': '{}.{}'.format(import_alias, component),
'description': ' '.join([
'Official examples and reference documentation for {name}.',
'{which_library}'
]).format(
name='{}.{}'.format(import_alias, component),
component_library=component_library,
which_library=(
'{name} is a {component_library} component.'.format(
name='{}.{}'.format(import_alias, component),
component_library=component_library,
) if component_library != import_alias else ''
)
).strip(),
'content': (
getattr(content_module, component)
if (content_module is not None and
hasattr(content_module, component))
else html.Div([
html.H1(html.Code('{}.{}'.format(
import_alias,
component
))),
html.H2('Reference & Documentation'),
rc.Markdown(
getattr(package, component).__doc__,
escape_tags=escape_tags
),
])
),
'ad': ad,
'adhref': adhref
} for component in sorted(dir(package))
if not component.startswith('_') and
component[0].upper() == component[0]
]
示例4: getHeader
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import H2 [as 別名]
def getHeader(app):
# this is a mess;
inlineBlock = {"display": "inline-block"}
headerWidgets = [
html.Button("Refresh", id='refresh-button'),
html.Div(
[
html.Div("Last refresh @ ", style=inlineBlock.update({"float": "left"})),
html.Div(datetime.datetime.now(),
id='last-refresh', className="showTime",
style=inlineBlock.update({"float": "left"})),
html.Div("%s Start time" % app.startTime,
id='start-time', className="showTime",
style=inlineBlock.update({"float": "right"})),
html.Br(),
html.Center([
html.Div(app.epochInfo, id="current-epoch")
])
], className="showTime")
]
pageMenu = [
html.A(html.Button("Evolution Statistics"), href="/"),
html.A(html.Button("Evaluation Breaks"), href="/evalbreak"),
html.A(html.Button("View Results"), href="/results")
# html.Button("View Settings", className="unimplemented"),
# html.Button("Inspect Population", className="unimplemented")
]
# html.Link(rel='stylesheet', href='/static/promoterz_style.css'),
header = html.Div(
[
html.H2(
app.webpageTitle,
style={'padding-top': '20', 'text-align': 'center'},
),
html.Div(headerWidgets),
html.Div(pageMenu),
],
style=allStyle)
return header