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


Python dash_html_components.H6属性代码示例

本文整理汇总了Python中dash_html_components.H6属性的典型用法代码示例。如果您正苦于以下问题:Python dash_html_components.H6属性的具体用法?Python dash_html_components.H6怎么用?Python dash_html_components.H6使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在dash_html_components的用法示例。


在下文中一共展示了dash_html_components.H6属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update_conversation

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import H6 [as 别名]
def update_conversation(click, text):
    global conv_hist

    # dont update on app load
    if click > 0:
        # call bot with user inputted text
        response, generic_response = utils.bot.respond(
            text,
            interpreter,
            app_data_path
        )
        # user message aligned left
        rcvd = [html.H5(text, style={'text-align': 'left'})]
        # bot response aligned right and italics
        rspd = [html.H5(html.I(r), style={'text-align': 'right'}) for r in response]
        if generic_response:
            generic_msg = 'i couldn\'t find any specifics in your message, here are some popular apps:'
            rspd = [html.H6(html.I(generic_msg))] + rspd
        # append interaction to conversation history
        conv_hist = rcvd + rspd + [html.Hr()] + conv_hist

        return conv_hist
    else:
        return '' 
开发者ID:AdamSpannbauer,项目名称:app_rasa_chat_bot,代码行数:26,代码来源:dash_demo_app.py

示例2: make_card_html

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import H6 [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 
开发者ID:DongjunLee,项目名称:quantified-self,代码行数:30,代码来源:dashboard.py

示例3: parse_contents

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import H6 [as 别名]
def parse_contents(contents, filename, date):
    content_type, content_string = contents.split(',')

    decoded = base64.b64decode(content_string)
    try:
        if 'csv' in filename:
            # Assume that the user uploaded a CSV file
            df = pd.read_csv(
                io.StringIO(decoded.decode('utf-8')))
        elif 'xls' in filename:
            # Assume that the user uploaded an excel file
            df = pd.read_excel(io.BytesIO(decoded))
    except Exception as e:
        print(e)
        return html.Div([
            'There was an error processing this file.'
        ])

    return html.Div([
        html.H5(filename),
        html.H6(datetime.datetime.fromtimestamp(date)),

        dash_table.DataTable(
            data=df.to_dict('records'),
            columns=[{'name': i, 'id': i} for i in df.columns]
        ),

        html.Hr(),  # horizontal line

        # For debugging, display the raw contents provided by the web browser
        html.Div('Raw Content'),
        html.Pre(contents[0:200] + '...', style={
            'whiteSpace': 'pre-wrap',
            'wordBreak': 'break-all'
        })
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:38,代码来源:upload-datafile.py

示例4: parse_contents

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import H6 [as 别名]
def parse_contents(contents, filename, date):
    return html.Div([
        html.H5(filename),
        html.H6(datetime.datetime.fromtimestamp(date)),

        # HTML images accept base64 encoded strings in the same format
        # that is supplied by the upload
        html.Img(src=contents),
        html.Hr(),
        html.Div('Raw Content'),
        html.Pre(contents[0:200] + '...', style={
            'whiteSpace': 'pre-wrap',
            'wordBreak': 'break-all'
        })
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:17,代码来源:upload-image.py

示例5: build_banner

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import H6 [as 别名]
def build_banner():
    return html.Div(
        id="banner",
        className="banner",
        children=[
            html.Img(src=app.get_asset_url("logo_programmer_a.png")),
            html.H6("时空数据——时空分布动态"),
        ],
    ) 
开发者ID:richieBao,项目名称:python-urbanPlanning,代码行数:11,代码来源:app.py


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