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


Python dash_core_components.Markdown方法代码示例

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


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

示例1: divs_list

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def divs_list():
    return [html.Div([
        dcc.Markdown(
            '',
            id='model-{}-markdown'.format(id)
        ),
        html.P(
            '',
            id='model-{}-p'.format(id)
        ),
        html.Button(
            'Delete',
            id='model-{}-delete-button'.format(id),
            style={'width': '49%'}
        ),
        html.Button(
            'Start/Stop',
            id='model-{}-toggle-button'.format(id),
            style={'marginLeft': '2%', 'width': '49%'}
        ),

        html.Hr()
    ], id='model-k2-{}'.format(id)) for id in IDS] 
开发者ID:plotly,项目名称:dash-recipes,代码行数:25,代码来源:dash-callback-factory.py

示例2: display_page

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [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

示例3: __init__

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def __init__(self, markdown_file: Path):

        super().__init__()

        self.markdown_file = markdown_file

        self.html = bleach.clean(
            markdown.markdown(
                get_path(self.markdown_file).read_text(),
                extensions=[
                    "tables",
                    "sane_lists",
                    _WebvizMarkdownExtension(base_path=markdown_file.parent),
                ],
            ),
            tags=Markdown.ALLOWED_TAGS,
            attributes=Markdown.ALLOWED_ATTRIBUTES,
            styles=Markdown.ALLOWED_STYLES,
        )

        # Workaround for upstream issue https://github.com/plotly/dash-core-components/issues/746,
        # where we convert void html tags from <tag> to <tag/>.
        self.html = re.sub("<img (.*?[^/])>", r"<img \1/>", self.html)
        self.html = self.html.replace("<br>", "<br/>").replace("<hr>", "<hr/>") 
开发者ID:equinor,项目名称:webviz-config,代码行数:26,代码来源:_markdown.py

示例4: create_description

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def create_description():
    div = html.Div(
        children=[
            dcc.Markdown('''
            The redder the outer circle, the higher the magnitude. The darker 
            the inner circle, the deeper the earthquake.
                        
            > Currently no organization or government or scientist is capable 
            > of succesfully predicting the time and occurrence of an
            > earthquake.
            > — Michael Blanpied
            
            Use the table below to know more about the {} earthquakes that 
            exceeded magnitude 4.5 last month.

            ***
            '''.format(data['metadata']['count']).replace('  ', '')),
        ],
    )
    return div 
开发者ID:jackdbd,项目名称:dash-earthquakes,代码行数:22,代码来源:app.py

示例5: Markdown

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def Markdown(children='', **kwargs):
    children = replace_relative_links(children)
    if kwargs.pop('escape_tags', False) and 'dccLink' in children:
        # escape the HTML tags presented in the html component docstrings
        # note that if these tags are within `backticks`, then we don't need
        # to escape. so, let the caller determine whether or not to escape a
        # section.
        children = re.sub(
            '\<(\w+)\>',
            # for some reason, if we do `\<{}\>`, the first slash is shown in the
            # rendered text.
            lambda match: '<{}\> '.format(match.groups()[0]),
            children
        )
    return dcc.Markdown(
        children=children,
        dangerously_allow_html=('dccLink' in children),
        **kwargs
    ) 
开发者ID:plotly,项目名称:dash-docs,代码行数:21,代码来源:Markdown.py

示例6: DemoDescription

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def DemoDescription(filename, strip=False):
    with open(filename, 'r') as file:
        text = file.read()

    if strip:
        text = text.split('<Start Description>')[-1]
        text = text.split('<End Description>')[0]

    return html.Div(
            className='row',
            style={
                'padding': '15px 30px 27px',
                'margin': '45px auto 45px',
                'width': '80%',
                'max-width': '1024px',
                'borderRadius': 5,
                'border': 'thin lightgrey solid',
                'font-family': 'Roboto, sans-serif'
            },
            children=dcc.Markdown(dedent(text))
    ) 
开发者ID:plotly,项目名称:dash-svm,代码行数:23,代码来源:dash_reusable_components.py

示例7: update_server_information

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def update_server_information(status):
    config = current_app.config["FRACTAL_CONFIG"]
    server = dcc.Markdown(
        f"""
**Name:** {config.fractal.name}

**Query Limit:** {config.fractal.query_limit}
            """
    )
    database = dcc.Markdown(
        f"""
**Name:** {config.database.database_name}

**Port:** {config.database.port}

**Host:** {config.database.host}
        """
    )

    queue = dcc.Graph(figure=task_graph())
    return server, database, queue 
开发者ID:MolSSI,项目名称:QCFractal,代码行数:23,代码来源:landing.py

示例8: layout

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def layout(self) -> dcc.Markdown:
        return dcc.Markdown(
            f"```\n{get_path(self.filename).read_text()}\n```",
            highlight_config=self.config,
        ) 
开发者ID:equinor,项目名称:webviz-config,代码行数:7,代码来源:_syntax_highlighter.py

示例9: extendMarkdown

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def extendMarkdown(self, md: markdown.core.Markdown) -> None:
        md.inlinePatterns.register(
            item=_MarkdownImageProcessor(IMAGE_LINK_RE, md, self.base_path),
            name="image_link",
            priority=50,
        ) 
开发者ID:equinor,项目名称:webviz-config,代码行数:8,代码来源:_markdown.py

示例10: layout

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def layout(self) -> dcc.Markdown:
        return dcc.Markdown(self.html, dangerously_allow_html=True) 
开发者ID:equinor,项目名称:webviz-config,代码行数:4,代码来源:_markdown.py

示例11: read_query

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def read_query(query):
    if query is None:
        return "No filter query"
    return dcc.Markdown('`filter_query = "{}"`'.format(query)) 
开发者ID:plotly,项目名称:dash-docs,代码行数:6,代码来源:filtering_advanced.py

示例12: display_query

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def display_query(query):
    if query is None:
        return ''
    return html.Details([
        html.Summary('Derived filter query structure'),
        html.Div(dcc.Markdown('''```json
{}
```'''.format(json.dumps(query, indent=4))))
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:11,代码来源:filtering_advanced.py

示例13: replace_relative_links

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def replace_relative_links(children):
    children = re.sub(
        ']\((\/\S*)\)',
        lambda match: ']({})'.format(tools.relpath(match.groups()[0])),
        children
    )
    children = re.sub(
        'href="(/\S*)"',
        lambda match: 'href="{}"'.format(tools.relpath(match.groups()[0])),
        children
    )
    return children

# Use our own Markdown function so that we can
# use `relpath` for the embedded URLs 
开发者ID:plotly,项目名称:dash-docs,代码行数:17,代码来源:Markdown.py

示例14: SectionTitle

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def SectionTitle(title, size, align='center', color='#222'):
    return html.Div(
        style={
            'text-align': align,
            'color': color
        },
        children=dcc.Markdown('#' * size + ' ' + title),
    ) 
开发者ID:plotly,项目名称:dash-cytoscape,代码行数:10,代码来源:dash_reusable_components.py

示例15: imageComponentBlock

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Markdown [as 别名]
def imageComponentBlock(
        example_string,
        location,
        height=None,
        width=400
):
    '''Generate a container that is visually similar to the
    ComponentBlock for components that require an externally hosted image.

    :param (str) example_string: String containing the code that is
    used in the application from the image.
    :param (str) location: The URL of the image.
    :param (int) height: The height of the image.
    :param (int) width: The width of the image.

    :rtype (dict): A dash_html_components div containing the code
    container and the image.

    '''

    try:
        exec(example_string, {})
    except Exception as e:
        print('\nError running\n{}\n{}'.format(
            example_string,
            ('======================================' +
             '======================================')
        ))
        raise e

    demo_location = re.match('.*pic_(.*)\.png\?raw=true', location)

    if demo_location is not None:
        demo_location = demo_location.group(1)
    else:
        demo_location = ''

    return html.Div([
        rc.Markdown(
            '```python  \n' + example_string + '  \n```',
            style=styles.code_container
        ),
        html.Div(
            className='example-container',
            children=[
                dcc.Markdown(
                    '> Try a live demo at http://dash-gallery.plotly.host/docs-demos-dashbio/{}'.format(demo_location, demo_location)
                ),
                html.Img(
                    style={'border': 'none', 'width': '75%', 'max-width': '500px'},
                    src=location
                )
            ]
        )
    ]) 
开发者ID:plotly,项目名称:dash-docs,代码行数:57,代码来源:utils.py


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