Python dash_html_components.H2 Examples

The following are 4 code examples of dash_html_components.H2(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module dash_html_components , or try the search function .
Example #1
Source File: qb_stats.py    From qb with MIT License 7 votes vote down vote up
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])
            ]
        )
    ]) 
Example #2
Source File: Section.py    From dash-docs with MIT License 5 votes vote down vote up
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')
    ]) 
Example #3
Source File: layout.py    From japonicus with MIT License 5 votes vote down vote up
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 
Example #4
Source File: chapter_index.py    From dash-docs with MIT License 4 votes vote down vote up
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]
    ]