Selective Loading of a Graph in Dash App

Hi,

I usually add a graph in dcc.Loading component in order to reload the graph in a Dash App.

However, let’s assume that there is a button and a slider whose interactions change this Graph (so the graph reloads everytime I click button or change slider). However, if I want to achieve something like this -

The Graph reloads when I use the slider, but doesn’t reload when I use the button to interact with it. Is this possible ?

I’m looking into this use-case because I’ve noticed that scattermapbox graphs don’t reload well without loading component when interacted with any other components, and I’m now trying to build a scattermapbox animation with Play, Pause buttons and Slider by trying to improvise on this example - https://github.com/plotly/simple-example-chart-apps/blob/master/dash-animationplot/apps/main.py

NOTE: I’ve refrained from using updateMenus for Play/Pause and sliders in Layout as mentioned by @empet in this example - https://plot.ly/~empet/14825/scattermapbox-animation-forum-question/#/
because when we drag the slider and try reusing Play/Pause buttons, the traces in scattermapbox don’t refresh accordingly. Hence trying for such an elaborate workaround.

All my queries apply to offline graphs.

@chriddyp @empet - Your feedback/suggestions about these issues would be greatly appreciated.

Hi @chriddyp or any other Plotly developer, could you please help me with this situation? I’ve been stuck on this issue and getting delayed for a project deliverable. Your help will be greatly appreciated.

I don’t think this is possible…if the graph is inside the dcc.Loading component, it will have a loading animation when something inside of it is loading, no matter what triggers that. And because a graph’s figure can only be the output of one function, any function that loads that graph will trigger the dcc.Loading component.

Someone correct me if I’m wrong though!