Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Autorange values stored in dcc.Graph.figure['layout']['xaxis' 'yaxis']['range'] no longer available after version v0.30.1 #321

Closed
crosenth opened this issue Oct 5, 2018 · 4 comments

Comments

@crosenth
Copy link

crosenth commented Oct 5, 2018

I was using the initial autorange values to "hold" my plotly.graph_objs.Layout plot axes from recalculating when dynamically adding or removing plotly.graph_objs.scatter.Markers. Three questions:

  1. Is there some place else I can read Layout axes range values after they have been calculated by the autorange function?
  2. Is there a better way to "hold" a plotly.graph_objs.Layout to the initial autorange values?
  3. Can the plotly.graph_objs.Layout axes autorange function be invoked directly?
@bcliang
Copy link
Contributor

bcliang commented Oct 19, 2018

Just to add that I've noticed the same thing, particularly noticeable when dcc.Interval is being used to refresh/stream data in real-time. I can programmatically set the axes range, but am not able to retrieve the figure layout range prop in order to be able to "hold" the figure.

I suspect the cause is from commit 7b48b18 in v0.30.2: (@valentijnnieman), though I have no clue why R.clone() would be failing.. seems like a deep copy is meant to prevent this type of issue.

edit: I was specifically grabbing from the range (Graph.figure.layout.yaxis.range)

@bcliang
Copy link
Contributor

bcliang commented Nov 30, 2018

This looks fixed with plotly/plotly.js#3236 and #387

Solution is to define the layout property uirevision (yaxis.uirevision)

In my case (time-series data), I will hold the figure layout (layout.uirevision) and update xaxis.uirevision with new range.

@crosenth
Copy link
Author

Hi bcliang,

Thanks for pointing our the new feature. I made a comment in the forums that the View still resets unless I necessarily interact with the Figure (Zoom in, out, autoscale, etc) which is not ideal. I would like to preserve the IU state without doing that. You can use cchridyp's example here to see what I mean https://community.plot.ly/t/preserving-ui-state-like-zoom-in-dcc-graph-with-uirevision/15793.

@crosenth
Copy link
Author

Mysteriously fixed as of dash==1.8.0, thank you Dash team

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants