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


Python dash_html_components.Div方法代码示例

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


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

示例1: getLayout

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def getLayout():
    return html.Div([
        html.H1(id='Title1',children='Multiple intervals in a single page',style={'text-align':'center'}),
        html.Div(id='Title2', children='''
        Test multiple intervals in a single page.
        ''',style={'margin-bottom':'50px', 'text-align':'center'}),
        html.Div('Div1',id='div1'),
        html.Div('Div2',id='div2'),
        html.Div('Div3',id='div3'),
        dcc.Interval(
            id='interval-component-1',
            interval=500 # in milliseconds
        ),
        dcc.Interval(
            id='interval-component-2',
            interval=300 # in milliseconds
        ),
        dcc.Interval(
            id='interval-component-3',
            interval=400 # in milliseconds
        )
    ]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:24,代码来源:multiple-intervals.py

示例2: compute_stats

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def compute_stats(questions: List[Question], db_path):
    n_total = len(questions)
    n_guesser_train = sum(1 for q in questions if q.fold == 'guesstrain')
    n_guesser_dev = sum(1 for q in questions if q.fold == 'guessdev')
    n_buzzer_train = sum(1 for q in questions if q.fold == 'buzzertrain')
    n_buzzer_dev = sum(1 for q in questions if q.fold == 'buzzerdev')
    n_dev = sum(1 for q in questions if q.fold == 'dev')
    n_test = sum(1 for q in questions if q.fold == 'test')
    columns = ['N Total', 'N Guesser Train', 'N Guesser Dev', 'N Buzzer Train', 'N Buzzer Dev', 'N Dev', 'N Test']
    data = np.array([n_total, n_guesser_train, n_guesser_dev, n_buzzer_train, n_buzzer_dev, n_dev, n_test])
    norm_data = 100 * data / n_total

    return html.Div([
        html.Label('Database Path'), html.Div(db_path),
        html.H2('Fold Distribution'),
        html.Table(
            [
                html.Tr([html.Th(c) for c in columns]),
                html.Tr([html.Td(c) for c in data]),
                html.Tr([html.Td(f'{c:.2f}%') for c in norm_data])
            ]
        )
    ]) 
开发者ID:Pinafore,项目名称:qb,代码行数:25,代码来源:qb_stats.py

示例3: update_position_selection

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def update_position_selection(rows,derived_virtual_selected_rows):
    if derived_virtual_selected_rows is None:
        derived_virtual_selected_rows = []
    if rows is None:
        dff3 = df3
    else:
        dff3 = pd.DataFrame(rows)
    try:
        active_row_txid = dff3['txid'][derived_virtual_selected_rows[0]]
        return html.Div([
            html.H5("Selected position: " + active_row_txid),
            html.Div(id='active_row_txid', children=active_row_txid, style={'display': 'none'})
            ]
        )
    except Exception as e:
        pass

# addfunding button callback 
开发者ID:tonymorony,项目名称:komodo-cctools-python,代码行数:20,代码来源:prices_app_v2.py

示例4: display_graphs

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def display_graphs(n_clicks):
    graphs = []
    for i in range(n_clicks):
        graphs.append(dcc.Graph(
            id='graph-{}'.format(i),
            figure={
                'data': [{
                    'x': [1, 2, 3],
                    'y': [3, 1, 2]
                }],
                'layout': {
                    'title': 'Graph {}'.format(i)
                }
            }
        ))
    return html.Div(graphs) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:18,代码来源:dash-add-graphs-dynamically.py

示例5: divs_list

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

示例6: display_output

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def display_output(n_clicks):
    print('display_output ' + str(n_clicks))
    if n_clicks == 0:
        return ''
    return html.Div([
        html.Div([
            dcc.Input(
                value='Input {}'.format(i),
                id='input-{}'.format(i)
            )
            for i in range(10)
        ]),
        dt.DataTable(
            rows=[{'Loading': ''}],
            id='new-table'),
        html.Div(id='dynamic-output')
    ]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:19,代码来源:dash-dynamic-table-created-without-id.py

示例7: display_page

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

示例8: layout

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def layout(self) -> html.Div:
        return html.Div(
            children=[
                wcc.FlexBox(
                    children=[
                        html.Div(
                            id=self.uuid("selector-row"),
                            style={"display": "none"}
                            if self.lock
                            else {"width": "15%"},
                            children=self.plot_option_layout(),
                        ),
                        wcc.Graph(
                            id=self.uuid("graph-id"),
                            style={"height": "80vh", "width": "60%"},
                        ),
                        html.Div(style={"width": "15%"}, children=self.filter_layout()),
                    ],
                )
            ]
        ) 
开发者ID:equinor,项目名称:webviz-config,代码行数:23,代码来源:_table_plotter.py

示例9: layout

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def layout(self) -> html.Div:

        style = {
            "color": self.color,
            "background-image": f"url({self.image_url})",
            "height": f"{self.height}px",
        }

        if self.shadow:
            style["text-shadow"] = "0.05em 0.05em 0"

            if self.color == "white":
                style["text-shadow"] += " rgba(0, 0, 0, 0.7)"
            else:
                style["text-shadow"] += " rgba(255, 255, 255, 0.7)"

        return html.Div(self.title, className="_banner_image", style=style) 
开发者ID:equinor,项目名称:webviz-config,代码行数:19,代码来源:_banner_image.py

示例10: prepare_send

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def prepare_send():
    lCache = []
    cData = get_All_data()
    for pair in PAIRS:
        ticker = pair.ticker
        exchange = pair.exchange
        graph = 'live-graph-' + exchange + "-" + ticker
        lCache.append(html.Br())
        if (pair.Dataprepared):
            lCache.append(dcc.Graph(
                id=graph,
                figure=cData[exchange + ticker]
            ))
        else:
            lCache.append(html.Div(id=graph))
    return lCache


# links up the chart creation to the interval for an auto-refresh
# creates one callback per currency pairing; easy to replicate / add new pairs 
开发者ID:pmaji,项目名称:crypto-whale-watching-app,代码行数:22,代码来源:app.py

示例11: create_description

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

示例12: setUp

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def setUp(self):
        """Set up for tests.  Need to provid Flask.test_client() to all tests.  Further
        configuration (e.g. FlaskLoginAuth) must be provided within the tests."""
        server = Flask(__name__)
        server.config.update(
            SECRET_KEY = os.urandom(12),
        )

        self.app = Dash(name='app1', url_base_pathname='/app1', server=server)
        self.app.layout = html.Div('Hello World!')

        self.add_auth_app = Dash(name='add_auth_app', url_base_pathname='/add-auth-app', server=server)
        self.add_auth_app.layout = html.Div('Hello World!')

        self.multi_app_no_auth = Dash(name='multi_app_no_auth', url_base_pathname='/app-no-auth', server=server)
        self.multi_app_no_auth.layout = html.Div('Hello World!')

        # Will raise an error because it doesn't have the same server
        self.crash_app = Dash(name='crash', url_base_pathname='/crash-app')
        self.crash_app.layout = html.Div('Goodby Cruel World!')

        self.server = server.test_client()
        self.assertEqual(server.debug, False) 
开发者ID:gaw89,项目名称:dash-flask-login,代码行数:25,代码来源:test_flask_login_auth.py

示例13: attribute_selector

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def attribute_selector(self):
        return html.Div(
            style={"display": "grid"},
            children=[
                html.Label("Surface attribute"),
                html.Div(
                    style=self.set_grid_layout("6fr 1fr"),
                    children=[
                        dcc.Dropdown(
                            id=self.attr_id,
                            options=[
                                {"label": attr, "value": attr} for attr in self.attrs
                            ],
                            value=self.attrs[0],
                            clearable=False,
                        ),
                        self._make_buttons(
                            self.attr_id_btn_prev, self.attr_id_btn_next
                        ),
                    ],
                ),
            ],
        ) 
开发者ID:equinor,项目名称:webviz-subsurface,代码行数:25,代码来源:surface_selector.py

示例14: _make_buttons

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def _make_buttons(self, prev_id, next_id):
        return html.Div(
            style=self.set_grid_layout("1fr 1fr"),
            children=[
                html.Button(
                    style={
                        "fontSize": "2rem",
                        "paddingLeft": "5px",
                        "paddingRight": "5px",
                    },
                    id=prev_id,
                    children="⬅",
                ),
                html.Button(
                    style={
                        "fontSize": "2rem",
                        "paddingLeft": "5px",
                        "paddingRight": "5px",
                    },
                    id=next_id,
                    children="➡",
                ),
            ],
        ) 
开发者ID:equinor,项目名称:webviz-subsurface,代码行数:26,代码来源:surface_selector.py

示例15: layout

# 需要导入模块: import dash_html_components [as 别名]
# 或者: from dash_html_components import Div [as 别名]
def layout(self):
        return html.Div(
            children=[
                html.Div(
                    children=[
                        self.attribute_selector,
                        self.selector(
                            self.name_wrapper_id,
                            self.name_id,
                            "Surface name",
                            self.name_id_btn_prev,
                            self.name_id_btn_next,
                        ),
                        self.selector(
                            self.date_wrapper_id,
                            self.date_id,
                            "Date",
                            self.date_id_btn_prev,
                            self.date_id_btn_next,
                        ),
                    ]
                ),
                dcc.Store(id=self.storage_id),
            ]
        ) 
开发者ID:equinor,项目名称:webviz-subsurface,代码行数:27,代码来源:surface_selector.py


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