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


Python dash_core_components.Link方法代码示例

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


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

示例1: display_page

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def display_page(pathname):
    return html.Div([
        html.Div([
            html.Span(
                dcc.Link(link_mapping['/'], href="/") if pathname != '/' else 'Exhibit A',
                style=styles['link']
            ),

            html.Span(
                dcc.Link(link_mapping['/exhibit-b'], href="/exhibit-b") if pathname != '/exhibit-b' else 'Exhibit B',
                style=styles['link']
            ),

            html.Span(
                dcc.Link(link_mapping['/exhibit-c'], href="/exhibit-c") if pathname != '/exhibit-c' else 'Exhibit C',
                style=styles['link']
            )

        ]),

        dcc.Markdown('### {}'.format(link_mapping[pathname])),
    ]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:24,代码来源:multi-page-dropdown.py

示例2: display_page

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [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"}) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:23,代码来源:multi_page.py

示例3: create_backlinks

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def create_backlinks(pathname):
    parts = pathname.strip('/').split('/')
    links = [
        dcc.Link('Home', href='/')
    ]
    for i, part in enumerate(parts[:-1]):
        href='/' + '/'.join(parts[:i + 1])
        name = chapter_index.URL_TO_BREADCRUMB_MAP.get(href, '? {} ?'.format(href))
        links += [
            html.Span(' > '),
            dcc.Link(name, href=href)
        ]
    current_chapter_name = chapter_index.URL_TO_BREADCRUMB_MAP.get(
        pathname.rstrip('/'), '? {} ?'.format(pathname)
    )
    links += [html.Span(' > ' + current_chapter_name)]
    return links 
开发者ID:plotly,项目名称:dash-docs,代码行数:19,代码来源:run.py

示例4: Chapter

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [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
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:22,代码来源:Chapter.py

示例5: get_menu

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def get_menu():
    menu = html.Div([

        dcc.Link('Overview   ', href='/overview', className="tab first"),

        dcc.Link('Price Performance   ', href='/price-performance', className="tab"),

        dcc.Link('Portfolio & Management   ', href='/portfolio-management', className="tab"),

        dcc.Link('Fees & Minimums   ', href='/fees', className="tab"),

        dcc.Link('Distributions   ', href='/distributions', className="tab"),

        dcc.Link('News & Reviews   ', href='/news-and-reviews', className="tab")

    ], className="row ")
    return menu

## Page layouts 
开发者ID:timkpaine,项目名称:lantern,代码行数:21,代码来源:app.py

示例6: Sidebar

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def Sidebar(urls, depth=0):

    chapters = []
    for chapter in urls:
        try:
            if 'chapters' in chapter and not chapter.get('hide_chapters_in_sidebar', False):
                chapters.append(Collapsible(
                    chapter['name'],
                    Sidebar(chapter['chapters'], depth+1),
                    chapter.get('description', None)
                ))
            else:
                title = ''
                if isinstance(chapter.get('description'), str):
                    title = dedent(chapter['description']).strip()
                elif isinstance(chapter.get('description_short'), str):
                    title = dedent(chapter['description_short']).strip()

                chapters.append(html.Div(
                    dcc.Link(
                        chapter['name'],
                        href=chapter['url'].rstrip('/'),
                    ),
                    className='link',
                    **(
                        {'title': title}
                        if not title == '' else {}
                    )
                ))
        except Exception as e:
            print(e)

    return html.Div(
        className='sidebar sidebar--{}'.format(depth),
        children=chapters
    ) 
开发者ID:plotly,项目名称:dash-docs,代码行数:38,代码来源:Sidebar.py

示例7: make_brand

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def make_brand(**kwargs):
    return html.Header(
        className="brand",
        children=dcc.Link(
            href=get_url(""),
            children=html.H1([fa("far fa-chart-bar"), server.config["TITLE"]]),
        ),
        **kwargs,
    ) 
开发者ID:ned2,项目名称:slapdash,代码行数:11,代码来源:components.py

示例8: get_logo

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Link [as 别名]
def get_logo():
    logo = html.Div([

        html.Div([
            html.Img(src='http://logonoid.com/images/vanguard-logo.png', height='40', width='160')
        ], className="ten columns padded"),

        html.Div([
            dcc.Link('Full View   ', href='/full-view')
        ], className="two columns page-view no-print")

    ], className="row gs-header")
    return logo 
开发者ID:timkpaine,项目名称:lantern,代码行数:15,代码来源:app.py


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