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


Python dash_core_components.Graph方法代码示例

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


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

示例1: display_graphs

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

示例2: update_output

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def update_output():
    fig = dcc.Graph(
        id='example',
        figure={
            'data': [{
                'y': [1, 5, 3],
                'type': 'bar'
            }]
        }
    )
    fig2 = dcc.Graph(
        id='example-1',
        figure={
            'data': [{
                'y': [1, 5, 3],
                'type': 'bar'
            }]
        }
    )
    return [fig, fig2] 
开发者ID:plotly,项目名称:dash-recipes,代码行数:22,代码来源:dash-hidden-graph.py

示例3: prepare_send

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

示例4: update_clustergram

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def update_clustergram(rows):
    if len(rows) < 2:
        return "Please select at least two rows to display."

    return dcc.Graph(figure=dashbio.Clustergram(
        data=df.loc[rows].values,
        column_labels=columns,
        row_labels=rows,
        color_threshold={
            'row': 250,
            'col': 700
        },
        hidden_labels='row',
        height=800,
        width=700
    )) 
开发者ID:plotly,项目名称:dash-docs,代码行数:18,代码来源:clustergram.py

示例5: generate_liveOut_layout

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def generate_liveOut_layout():
    'Generate the layout per-app, generating each tine a new uuid for the state_uid argument'
    return html.Div([
        dpd.Pipe(id="named_count_pipe",
                 value=None,
                 label="named_counts",
                 channel_name="live_button_counter"),
        html.Div(id="internal_state",
                 children="No state has been computed yet",
                 style={'display':'none'}),
        dcc.Graph(id="timeseries_plot"),
        dcc.Input(value=str(uuid.uuid4()),
                  id="state_uid",
                  style={'display':'none'},
                 )
        ]) 
开发者ID:GibbsConsulting,项目名称:django-plotly-dash,代码行数:18,代码来源:plotly_apps.py

示例6: update_server_information

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

示例7: __init__

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def __init__(self, parent_name, local_name):
        Component.__init__(self, parent_name, local_name)

        self._register(
            dcc.Graph(id=self.full_name,
                      figure={
                          'data': [],
                          'layout': make_layout(None, None, None, None)
                      })) 
开发者ID:negrinho,项目名称:deep_architect,代码行数:11,代码来源:main.py

示例8: get_account_stats_figure

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def get_account_stats_figure(account_stats_reader: AccountStatsReader):
    graph_list = []

    # 账户统计曲线
    if account_stats_reader:
        fig = account_stats_reader.draw_line(show=False)

        for trader_name in account_stats_reader.trader_names:
            graph_list.append(dcc.Graph(
                id='{}-account'.format(trader_name),
                figure=fig))

    return graph_list 
开发者ID:zvtvz,项目名称:zvt,代码行数:15,代码来源:dcc_components.py

示例9: update_target_signals

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def update_target_signals(entity_id, start_date, end_date, trader_index):
    if entity_id and (trader_index is not None):
        return dcc.Graph(
            id=f'{entity_id}-signals',
            figure=get_trading_signals_figure(order_reader=order_readers[trader_index], entity_id=entity_id,
                                              start_timestamp=start_date, end_timestamp=end_date))
    raise dash.exceptions.PreventUpdate() 
开发者ID:zvtvz,项目名称:zvt,代码行数:9,代码来源:trader_app.py

示例10: update_graph

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def update_graph(dropdown_value):
    return {
        'layout': {
            'title': 'Graph of {}'.format(dropdown_value),
            'margin': {
                'l': 20,
                'b': 20,
                'r': 10,
                't': 60
            }
        },
        'data': [{'x': [1, 2, 3], 'y': [4, 1, 2]}]
    } 
开发者ID:plotly,项目名称:dash-recipes,代码行数:15,代码来源:usage_basic_auth.py

示例11: updateContent

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def updateContent(hoverData1, hoverData2):
    print(hoverData1)
    print(hoverData2)
    if hoverData1 is not None:
        return html.Div([
            html.Div('Graph 1'),
            html.Pre(hoverData1)
        ])
    if hoverData2 is not None:
        return html.Div([
            html.Div('Graph 2'),
            html.Pre(hoverData1)
        ]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:15,代码来源:multiple-hover-data.py

示例12: plot_bar

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def plot_bar(data):
	app.layout = html.Div(children=[html.H1(children='CM PT'), html.Div(children='''History.'''),

	dcc.Graph(
		figure=go.Figure(
		data = data,
		layout=go.Layout(title='Streams', showlegend=False, barmode='stack', margin=go.Margin(l=200, r=0, t=40, b=20))),
	style={'height': 300},
	id='my-graph')
	]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:12,代码来源:dash-plot.py

示例13: display_content

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def display_content(selected_tab):
    return html.Div([
          html.H1(selected_tab),
          dcc.Graph(id='graph', figure=generate_figure(selected_tab))
    ]) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:7,代码来源:tabs-and-intervals.py

示例14: InteractiveImage

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def InteractiveImage(id, image_path):
    encoded_image = base64.b64encode(open(image_path, 'rb').read())
    return dcc.Graph(
        id=id,
        figure={
            'data': [],
            'layout': {
                'xaxis': {
                    'range': RANGE
                },
                'yaxis': {
                    'range': RANGE,
                    'scaleanchor': 'x',
                    'scaleratio': 1
                },
                'height': 600,
                'images': [{
                    'xref': 'x',
                    'yref': 'y',
                    'x': RANGE[0],
                    'y': RANGE[1],
                    'sizex': RANGE[1] - RANGE[0],
                    'sizey': RANGE[1] - RANGE[0],
                    'sizing': 'stretch',
                    'layer': 'below',
                    'source': 'data:image/png;base64,{}'.format(encoded_image)
                }],
                'dragmode': 'select'  # or 'lasso'
            }
        }
    ) 
开发者ID:plotly,项目名称:dash-recipes,代码行数:33,代码来源:dash-image-selection.py

示例15: update_graph

# 需要导入模块: import dash_core_components [as 别名]
# 或者: from dash_core_components import Graph [as 别名]
def update_graph(hoverData):
    if not hoverData:
        x_value=x_data[250]
        opacity = 0
    else:
        x_value = hoverData['points'][0]['x']
        opacity = 0.8
    data = [go.Scatter(
                x=x_data,
                y=y_data,
                line={'color': '#235ebc'},
                opacity=0.8,
                name="Graph"
            ),
            go.Scatter(
                x=[x_value, x_value],
                y=[0, height],
                line={'color': '#a39999'},
                opacity=opacity,
                name='Moving Line')
            ]
    layout = go.Layout(
                xaxis={'type': 'linear', 'title': "Timestep"},
                yaxis={'type': 'linear', 'title': "Value"},
                margin={'l': 60, 'b': 40, 'r': 10, 't': 10},
                hovermode="False"
                )
    
    return {'data': data, 'layout': layout} 
开发者ID:plotly,项目名称:dash-recipes,代码行数:31,代码来源:dash_update_figure.py


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