简体   繁体   中英

how to send in parameter for app.callback function for plotly dash?

I would like to create mulitiple graphs that send in a different parameter to 'INPUT_PARAM' in the update_graph_scatter function. Where do I pass in the INPUT_PARAM?

app.layout = html.Div(
    [
        dcc.Graph(id='live-graph', animate=True),
        dcc.Interval(
            id='graph-update',
            interval=1000 * 60,
            n_intervals = 0,
        ),
    ]
)

@app.callback(Output('live-graph', 'figure'),
        [Input('graph-update', 'n_intervals')])
def update_graph_scatter(INPUT_PARAM):

That is controlled by the Input values and State values you define in the app.callback decorator. In this case, it would be the n_intervals from graph-update .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM