2

I have 3 buttons that stand side by side on my UI. When the user clicks one of them, the buttons that are standing right of the clicked button should be also clicked step by step. Is there a way to manage this scenario in plotly-dash?

To show it visually,
buttons

1 Answer 1

2

Yes. Make a callback that takes in the 1st button's n_clicks prop, and outputs to the 2nd button's n_clicks prop. Same for the 2nd to 3rd buttons.

A simple example:

@app.callback(Output('button-2', 'n_clicks'),
              [Input('button-1', 'n_clicks')])
def callback_func(button_clicks):
    if button_clicks:
        return button_clicks
    raise dash.exceptions.PreventUpdate
Sign up to request clarification or add additional context in comments.

Comments

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.