Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] relayoutData returns a proper object/dict for 'update_layout' roundtrip and convenience #1468

Closed
sdementen opened this issue Nov 26, 2020 · 3 comments

Comments

@sdementen
Copy link

Is your feature request related to a problem? Please describe.

The relayoutData is very useful yet it comes in a format Dict[str]->Any that is not very convenient as keys may have dot and [] notations like in 'xaxis.range[0]' and cannot roundtrip with fig.update_layout (like in fig.update_layout(**relayoutData))

Describe the solution you'd like

I would like to get as relayoutData a proper dict/object.
So instead of receiving:
{'xaxis.range[0]': '2019-01-01', 'xaxis.range[1]': '2019-02-07 04:21:40.9199'}
I would like to get
{'xaxis': {'range': ['2019-01-01', '2019-02-07 04:21:40.9199']}}
or even better
{'xaxis': {'range': [datetime(2019,1,1), datetime(2019,2,7,4,21,40.9199)]}}
(datetime could also be a pandas.timestamp)

@chriddyp
Copy link
Member

Thanks for opening @sdementen ! Our current spec for addressing this is with a new property for the entire figure minus the data. See plotly/dash-core-components#584

1 similar comment
@chriddyp
Copy link
Member

Thanks for opening @sdementen ! Our current spec for addressing this is with a new property for the entire figure minus the data. See plotly/dash-core-components#584

@sdementen
Copy link
Author

Even better indeed, thanks!

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

No branches or pull requests

2 participants