I want to create a conditional callback in dash, is it possible?

if something==0:

    @app.callback(
     Output('desc','children'), [Input('map','hoverData')])
    def descr(hover):
    
        description="some description",hover
   
        return description

elif somethingelse!=0:

    @app.callback(
         [Output("bargraph", "figure"),Output('desc','children')],
         [Input('map','hoverData'),Input('parameter','value'),Input('type','value')])
    def combinedhover(hover,parameter,type):
     
        description="somethingelse description",hover
        return bargraph(parameter,type,var,hover),description

else:

    @app.callback(
         [Output("linechart", "figure"),Output('desc','children'),Output('bargraph','figure')],
         [Input('map','hoverData'),Input('parameter','value'),Input('type','value')])
    def combinedhover(hover,parameter,type):
    
        description="else description",hover
        return bargraph(parameter,type,var,hover),description,linechart(parameter,type,var,hover)

Hi!

You could simply use the partial update functionality.

Hope that helps.

I wanted to accomplish similar to this dash oil and gas in mine.The Input is taken from the map hoverData along with the many other inputs and Output is displayed in more no of graphs(like bar chart, line chart , pie-chart) and that too it is conditional.
the problem is it will take lot of time to load the graphs if hundreds of points on map are hovered within a second ( you can experience same here dash oil and gas)
Is there any solution for this??