本文整理匯總了Python中dash_html_components.A屬性的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.A屬性的具體用法?Python dash_html_components.A怎麽用?Python dash_html_components.A使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類dash_html_components
的用法示例。
在下文中一共展示了dash_html_components.A屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: display_page
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [as 別名]
def display_page(pathname):
print(pathname)
if pathname == '/':
return html.Div([
html.Div('You are on the index page.'),
# the dcc.Link component updates the `Location` pathname
# without refreshing the page
dcc.Link(html.A('Go to page 2 without refreshing!'), href="/page-2", style={'color': 'blue', 'text-decoration': 'none'}),
html.Hr(),
html.A('Go to page 2 but refresh the page', href="/page-2")
])
elif pathname == '/page-2':
return html.Div([
html.H4('Welcome to Page 2'),
dcc.Link(html.A('Go back home'), href="/"),
])
else:
return html.Div('I guess this is like a 404 - no content available')
# app.css.append_css({"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"})
示例2: Chapter
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [as 別名]
def Chapter(name, href=None, caption=None):
linkComponent = html.A if href.startswith('http') else dcc.Link
return html.Div(className='toc--chapter', children=[
html.Li(
linkComponent(
name,
href=relpath(href),
id=href,
className='toc--chapter-link'
),
),
html.Small(
className='toc--chapter-content',
children=Markdown(caption or ''),
style={
'display': 'block',
'marginTop': '-10px' if caption else ''
}
) if caption else None
])
示例3: create_td
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [as 別名]
def create_td(series, col):
val = series[col]
if col == 'Detail':
td = html.Td(
html.A(children='GeoJSON', href='{}'.format(val), target='_blank'))
else:
td = html.Td(val)
return td
示例4: user_logout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [as 別名]
def user_logout(input1):
if current_user.is_authenticated:
return html.A('Logout', href='/logout')
else:
return ''
示例5: print_button
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [as 別名]
def print_button():
printButton = html.A(['Print PDF'],className="button no-print print",style={'position': "absolute", 'top': '-40', 'right': '0'})
return printButton
# includes page/full view
示例6: getHeader
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import A [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