I need to build a dashboard with dash python, where the data source (CSV file) will be upload each time the dashboard is used. The dashboard will be used for a variety of KPIs, hence the data source won't have a fixed set of columns. For example one time it will contain a number of sales, location, and agent id, and another time it will contain age group, gender, and a number of clicks. I can deal with changing KPI, but the issue is with changing the filters accordingly. I couldn't find a way to have them based on the existing fields. It seems like I can only apply pre-fixed filters on the chars. Is there any way to do that?
For example: the callback function:
@app.callback(
Output('number_of_sales', 'figure'),
Input('location_filter', 'value'),
Input('source_filter', 'value')
)
I need it to change according to the data source fields somehow instead of fixed filters.
Thanks!
You should check out pattern-matching callbacks for this. It will let you dynamically add components, and use them in callbacks. This way, you can read in the CSV, and then build the filters you need from that.