✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Function to Power Multiple Inputs

I am working on a statistics dashboard. The data set (df) has the following attributes:

County Name
Statistic Name
Statistic Value
Year
Month
Value by population

I have the following Core Components:

Dropdown - to select desired county
Radio Items - to select desired statistic
Radio Items - allowing graph to update by toggling y-axis between statistic value & value by population
Range Sider - Allows to select period of interest

I have all of these set up as inputs to modify my the dcc.Graph. However, I am getting stuck on writing out a single function that makes everything work as designed. At most I’ve only been able to get two of the inputs to modify the graph (County dropdown & the 2nd set of Radio Items explained above). Any ideas? Thank you

@Troy Can you elaborate on the following?

At most I’ve only been able to get two of the inputs to modify the graph

From your description, it sounds like a normal callback function with this kind of format is all you need.

Output(component_id='main-graph', component_property='figure'),
[Input(component_id='first-control', component_property='value'),
Input(component_id='second-control', component_property='value'),
... etc]

Hey Peter, thank you so much for the reply. I had everything set up correctly in the callback as you point out above, but didn’t have the Python chops to write the function to make the dashboard work as desired. I did however, after much trial and error, get this to work as I wanted. Thank you for helping though Peter