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

Add legend open/close state to URL query #900

Closed
jameshadfield opened this issue Feb 20, 2020 · 5 comments
Closed

Add legend open/close state to URL query #900

jameshadfield opened this issue Feb 20, 2020 · 5 comments
Labels
good first issue A relatively isolated issue appropriate for first-time contributors narratives issues / PRs relating to narrative functionality please take this issue

Comments

@jameshadfield
Copy link
Member

Will be very beneficial to iframe embedding and narratives

@jameshadfield jameshadfield added the narratives issues / PRs relating to narrative functionality label Feb 20, 2020
@emmahodcroft
Copy link
Member

@jameshadfield you are a mindreader, I had a rant about this just the other day and it's on my 'auspice wish list' door, but I never got around to making an issue 😆

@jameshadfield jameshadfield added good first issue A relatively isolated issue appropriate for first-time contributors please take this issue labels Mar 4, 2020
@jameshadfield
Copy link
Member Author

The best example to follow for this would be to follow how we currently store the state for being able to control the sidebar open/closed state via the URL query (see https://github.com/nextstrain/auspice/search?q=sidebarOpen&unscoped_q=sidebarOpen). Please note that it's not applicable for this to be set via the dataset JSON.

The default state for the legend open/closed should be set as it currently is, and any user-interaction will result in a URL query (via the redux middleware). For instance ?legend=open or ?legend=closed.

@ncallaway
Copy link

I'm starting work on this now, I expect I'll be able to have a PR for you shortly.

@ncallaway
Copy link

@jameshadfield I've implemented the setting loading side of this (that is, you can add the ?legend=open and ?legend=closed query params to define the default state of the legend.

Do you also want the legend state to persist to the URL query (e.g. the way the c param is updated in the URL to stay consistent with your selection in the Color By dropdown? Or is this more a feature for iframes and embeds, and we shouldn't touch this URL parameter once the page is loaded (the same way that sidebarOpen behaves)?

@jameshadfield
Copy link
Member Author

Closed by #923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A relatively isolated issue appropriate for first-time contributors narratives issues / PRs relating to narrative functionality please take this issue
Projects
None yet
Development

No branches or pull requests

3 participants