I am trying to reduce the amount of IF statements I have in various callbacks linking dropdowns to graphs as it is slowing the app down. I have provided a much simplified version of what one callback looks like:
The function is reading different rows of a database and adding them if they are selected within the dropdown. I’ve been trying to simplify the process using a for loop but I can’t seem to get it - whatever I seem to try doesn’t link the selection in the dropdown to the value displayed on the graph. Is there a way that I can prevent just having endless IF statements?
Apologies I am new to both Python programming and dash.