-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Persist current #g.xx graph settings across page reloads #12
Comments
Ideally this would work for regular links too, e.g. the facet selection links on this page: https://fivethirtyeight.datasettes.com/fivethirtyeight-ac35616/antiquities-act%2Factions_under_antiquities_act?_facet=current_agency#g.mark=circle&g.x_column=states&g.x_type=nominal&g.y_column=year&g.y_type=nominal Again, JavaScript could do this either by modifying those links in the DOM or by intercepting click events and turning them into navigations to that URL + the current fragment hash. I'm not sure which would work better. |
Shipped as 0.5. Demo: https://fivethirtyeight.datasettes.com/fivethirtyeight-ac35616?sql=select+team_id%2C+pts+from+%5Bnba-elo%2Fnbaallelo%5D+order+by+rowid+limit+2#g.mark=bar&g.x_column=pts&g.x_type=quantitative&g.y_column=team_id&g.y_type=ordinal - try changing the limit value and re-submitting the form. |
e.g. here: https://fivethirtyeight.datasettes.com/fivethirtyeight-ac35616?sql=select+user%2C+state%2C+sum%28retweets%29+as+rt+from+%5Btwitter-ratio%2Fsenators%5D+group+by+user%2C+state+order+by+rt+desc+limit+20#g.mark=bar&g.x_column=user&g.x_type=ordinal&g.y_column=rt&g.y_type=quantitative&g.color_column=state
It should be possible to edit the SQL (to increase the limit for example), click "Run SQL" and have the current graph state apply to the new page.
This can be done by having JavaScript modify the form action and turn it into the following:
Browsers will then maintain the fragment hash when the form is submitted.
The text was updated successfully, but these errors were encountered: