當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。