dash-core-components icon indicating copy to clipboard operation
dash-core-components copied to clipboard

loading state data properties for dcc.Graph don't disappear

Open chriddyp opened this issue 6 years ago • 1 comments

Currently, the loading state data properties are only updated on render, rather than on plot: https://github.com/plotly/dash-core-components/blob/b1932f9aaaea89f099c17be0ce8f1d9e0538379a/src/components/Graph.react.js#L252-L266

Since shouldComponentUpdate returns false if the the ID doesn't change, the data properties don't change once they've been added. https://github.com/plotly/dash-core-components/blob/b1932f9aaaea89f099c17be0ce8f1d9e0538379a/src/components/Graph.react.js#L215-L220

This fixed with two improvements:

  1. Update shouldComponentUpdate with a check for loading_state, letting the render re-render with the new data properties
  2. Incorporate the plot command so that the loading state is updated once the chart finishes drawing.

1 would fix the bug, 2 would be a slight improvement.

chriddyp avatar Apr 01 '19 23:04 chriddyp

This is resolved in #837

ohaibbq avatar Jul 25 '20 18:07 ohaibbq