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

Chart stickiness - saved state #4379

Closed
3 tasks
vylc opened this issue Feb 8, 2018 · 7 comments
Closed
3 tasks

Chart stickiness - saved state #4379

vylc opened this issue Feb 8, 2018 · 7 comments
Labels
inactive Inactive for >= 30 days

Comments

@vylc
Copy link

vylc commented Feb 8, 2018

Persist visualization settings during save.
Use case: User goes and plays around with chart, and gets to a point where they have enabled 2-3 series on the chart via clicking the legend. When they click save, the expectation is that the exact view that user has customized will be persisted, such that when they share this view, everything is intact.

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

Expected results

Actual results

Steps to reproduce

@mistercrunch
Copy link
Member

I agree it'd be nice to save the state of the legend filters in the nvd3 charts specifically.

@betodealmeida
Copy link
Member

I can take this.

@mistercrunch
Copy link
Member

@betodealmeida thinking about this, maybe the slice object that's available in the visualization exposes a setExtraState method and an extraState object as the generic api for this feature. Somehow this extraState would need to make it into the formData object.

Another option would be to use individual HiddenControls and use setControlValue.

@betodealmeida
Copy link
Member

@mistercrunch, I was planning to do this in 2-steps. I noticed that the ⚡ controls that trigger the render on change (with renderTrigger = true) do not persist their state in the URL, ie, the form_data parameter is not updated on the fly, only with a new query.

I thought of first fixing that first, and then make changes to the nvd3 legend so that is also updates the URL. This way the share button should be able to include the legend state, right?

@mistercrunch
Copy link
Member

Yes lets fix the URL state getting out of sync.

For the state to be saved in the slice it needs to make its way in the form data. As you know form data is a collection of control values. So either you add hidden controls or we add a new generic state key in form data.

The url is built from the form form data of the slice.

@betodealmeida
Copy link
Member

#4449 sets the foundation.

@stale
Copy link

stale bot commented Apr 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 11, 2019
@stale stale bot closed this as completed Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

3 participants