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

add persistence to relevant components #646

Merged
merged 4 commits into from
Sep 17, 2019
Merged

add persistence to relevant components #646

merged 4 commits into from
Sep 17, 2019

Conversation

alexcjohnson
Copy link
Collaborator

Gives the following components persistence support (see plotly/dash#903):
Checklist, DatePickerRange, DatePickerSingle, Dropdown, Input, RadioItems, RangeSlider, Slider, Tabs, Textarea
All but the date pickers persist only value. DatePickerRange is the only one that persists more than one prop (start_date and end_date). We could imagine building a facility into persistence to omit persisted_props in this case, since it's pretty much useless to the user... for now I just mentioned this in the docstring.

These components do not have persistence support:
ConfirmDialog[Provider], Graph, Interval, Link, Loading, Location, LogoutButton, Markdown, Store, Tab, Upload

I think this is all straightforward, the only one I think might at some point want to get persistence support is Graph (selections, perhaps zoom or camera angle?), but this is not going to be simple to add, so I suggest omitting this until there's a clear need.

Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, just needs checks to be fixed and a changelog entry

@alexcjohnson
Copy link
Collaborator Author

just needs checks to be fixed

and a changelog entry

@alexcjohnson alexcjohnson merged commit 6d7434f into dev Sep 17, 2019
@alexcjohnson alexcjohnson deleted the persistence branch September 17, 2019 02:46
@bcliang
Copy link
Contributor

bcliang commented Sep 27, 2019

This is a pretty significant improvement for users who have lots of input fields! I've been manually using browser sessionStorage to persist input values.

Any comments on impl. for Graph ?

@alexcjohnson
Copy link
Collaborator Author

@bcliang What's "impl."? Implications? Implementation? 😈

We didn't include Graph for now, despite the fact that this feature was somewhat modeled off uirevision from plotly.js, since this is going to be rather more involved.

We might be able to do it in this repo after #584 makes a prop reporting user interactions back; but if we want to support the full complexity that uirevision allows, it might be better to implement it on the plotly.js side, perhaps with a config attribute that stores these edits in local or session storage rather than in regular memory (attached to the DOM element).

It might be best to make a new issue for this - here, in this repo for now - and explain the use cases you have in mind. Then we can decide how best to handle it.

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

Successfully merging this pull request may close these issues.

3 participants