Hi –
I’m working on a dashboard that allows the user to input four separate subsets of their data and automatically plot them side by side.
I got the structure working but my callback code is getting really unruly. I have four copies of a pretty elaborate set of input interfaces at the top and each one has its own id … so i have, for example, “fixed-date-input-1”, “fixed-date-input-2” etc.
The bigger problem is when I write my callbacks, I have to put the state of some 32 different features into every single one. The names are all modular (“name-of-feature-1”) and it would be easy to do if it was all in Python (which I know), but I tried passing a list comprehended list of features and it didn’t work.
Basically how can I avoid having to do something like this:
@app.callback(Output('compare-table-p', 'children'),
[Input('compare-output-button', 'n_clicks')],
[State('compare-date-range-flex-1', 'start_date'),
State('compare-date-range-flex-1', 'end_date'),
State('compare-date-range-flex-2', 'start_date'),
State('compare-date-range-flex-2', 'end_date'),
State('compare-date-range-flex-3', 'start_date'),
State('compare-date-range-flex-3', 'end_date'),
State('compare-date-range-flex-4', 'start_date'),
State('compare-date-range-flex-4', 'end_date'),
])
Help!