My dashboard has a bunch of filters, I was looking for a way to handle them neatly in my code. It looks really untidy to have 23 inputs to a function.
Is there a way to have an array of inputs?
@app.callback(
Output("div", "children"),
[Input("plot-button", "n_clicks")],
[State('input1', 'on'),
State('input2','value'),
State('input3','value'),
State('input4','start_date'),
State('input5','end_date'),
State('input6','values'),
State('input7','value'),
State('input8','value'),
State('input9','value'),
State('input10','options'),
State('input11','value'),
State('input12','value'),
State('input13','value'),
State('input14','value'),
State('input15','value'),
State('input16','value'),
State('input17','value'),
State('input18','value'),
State('input19','value'),
State('input20','value'),
State('input21','value'),
State('input22','value'),])
def generate_graph(nclicks, input1, input2, input3, input4, input5, input6, input7, input8, input9, input10, input11, input12, input13, input14, input15, input16, input17, input18, input19, input20, input21, input22):
//some code
return