-
-
Notifications
You must be signed in to change notification settings - Fork 146
figure as state out of sync #879
figure as state out of sync #879
Comments
This is in DCC. The issue is that we clone the layout for responsive sizing
Short term I believe you can work around it by providing an empty I wonder though whether we could get away with mutating the layout for these responsive tweaks, rather than cloning it. Given that we're expecting it to be mutated by the plotting process anyway, perhaps this is actually the better way to do it? Note that this problem is magnified in DDK, as it clones much more deeply in order to theme its graphs. |
Setting |
Ah, because adding shapes does not mutate |
Where "here" is in the |
I think @alexcjohnson means "here" = when adding a new shape (mutate the shapes object instead of cloning it). |
No, I meant in DCC. There may be other places this causes problems in plotly.js, but if we fix it on the DCC side it will cover all these bases. |
Basically just take the method call I linked above and turn it into mutating the layout instead of making a new |
Pasting here a comment by Alex on how to test this (in https://github.com/plotly/dash-core-components/tree/dev/tests/integration/graph)
|
@almarklein, @nicolaskruchten mentioned that #584 targets the same piece of the |
I am running into related issues with a callback that Outputs a figure and loads the figure from a State. I had to use various hacks, like creating empty figures with subplot grids or storing color information in store objects and adding them back in annoying for-loops over the traces. Is it somehow possible to return a "deep dictionary" of a figure that retains attributes currently lost? I am using Dash 2.5.0. |
In this simple app from @emmanuelle,
figure.layout.shapes
doesn't seem to be updated whenfigure
is captured asState
, meaning that we have to do all sorts of gymnastics withrelayoutData
to work with shapes.@alexcjohnson can you help me figure out if this is something in
dcc
or if Plotly.js is doing something odd here, in which case help me translate this into a CodePen that @archmoj can use?The text was updated successfully, but these errors were encountered: