当前位置: 首页>>代码示例>>Python>>正文


Python dash_html_components.H2属性代码示例

本文整理汇总了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])
            ]
        )
    ]) 
开发者ID:Pinafore,项目名称:qb,代码行数:25,代码来源:qb_stats.py

示例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')
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:11,代码来源:Section.py

示例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]
    ] 
开发者ID:plotly,项目名称:dash-docs,代码行数:46,代码来源:chapter_index.py

示例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 
开发者ID:Gab0,项目名称:japonicus,代码行数:47,代码来源:layout.py


注:本文中的dash_html_components.H2属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。