本文整理匯總了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 ''
示例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
示例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'
})
])
示例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'
})
])
示例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("時空數據——時空分布動態"),
],
)