1

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):

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I see, but I want to pass in a string to load a different type of graph. Will I need to create a new function then?
What string would you want to pass and and how would you want it to update the graph?
I'm using the string passed in to query a database and return a graph of the queried word
Where would that string be coming from? Is the user submitting it? Then you might want dcc.Input for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.