Hi guys. Is there a means of applying a RangeSlider call back to the whole dataset after filtering , so that it affects all the graphs and other time series component of your dashboard rather than applying it to each single graph. I want to be able to apply the start and end month to my whole dashboard.
which component do i need to pass my callback on and how do i script the callback.Any help?
At a high level, you can have the range slider callback output your filtered data set to a hidden Div or dcc.Store. You can then have the callbacks that handle your graphs trigger on the change to this dataset.
I did something similar but for some reasons i cant get the callback to do any actions when i use my rangeSlider.
Here is my code:
It took me a hot second but your callback has
range_slider but your range slider was created with
id=range-slider…dash vs underscore.
Thanks for the correction @flyingcujo. That still is not the issue with the code. Cant get it to filter my dataframe on my graphs when i use the rangeSlider.
df defined? Is this a global variable? For debugging, can you provide a sample
Hi @flyingcujo. I defined my df out of the app.layout, pivoted it to get the my pivots,defined all my traces for my graphs and then just called them within the app.layout. Should the call back for my dcc.Store be called first , or do i need to define and create all my pivots and traces within the app.layout??
I only have layout code in my
layout.py file, just to keep it separate from my callbacks. As long as all your componts are defined prior to invoking
app.server, it really doesn’t matter where you callbacks, layout, etc are located.
Per the FAQ:
All your callbacks must be defined before your Dash app’s server starts running, which is to say, before you call
Regarding the calling order of your callbacks, it all depends on whether or not you have components “chained”, i.e. user pressing component 1 when then triggers callback A, whose outtput triggers callback B, etc.