dash-core-components
dash-core-components copied to clipboard
loading state data properties for dcc.Graph don't disappear
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:
- Update
shouldComponentUpdatewith a check forloading_state, letting therenderre-render with the new data properties - Incorporate the
plotcommand so that the loading state is updated once the chart finishes drawing.
1 would fix the bug, 2 would be a slight improvement.
This is resolved in #837