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

URL queries to better support iframe usage #884

Merged
merged 2 commits into from
Feb 5, 2020
Merged

URL queries to better support iframe usage #884

merged 2 commits into from
Feb 5, 2020

Conversation

jameshadfield
Copy link
Member

@jameshadfield jameshadfield commented Feb 3, 2020

  • URL query or JSON display_default can set sidebar status
  • URL query can hide header / footer

See commit messages for more details.


You can see a proof-of-principle iframe here: https://jameshadfield.github.io/nextstrain-iframe/ which uses the HTML

  <iframe src="https://auspice-iframe-mtwbapzp2abw69e.herokuapp.com/zika?onlyPanels&sidebar=closed&d=tree" title="nextstrain / zika" width="800" height="600" frameborder="0"></iframe>

image


Closes #878
Closes #879

@jameshadfield jameshadfield temporarily deployed to auspice-iframe-mtwbapzp2abw69e February 3, 2020 04:08 Inactive
@jameshadfield jameshadfield changed the title URL queries to better support iFrame usage URL queries to better support iframe usage Feb 3, 2020
This implements a long-desired feature, and is important for iFrames (there's a hack in the code to close it for iFrames on gisaid which can now be removed).

Intended behavior:
* In narrative mode, neither the URL nor the dataset can specify the sidebar state as we always want it open.
* If it has been set via URL / JSON, then crossing the window-width threshold when we would normally toggle the sidebar does nothing.
* Setting via URL overrides any JSON setting (as per other behavior in auspice). If neither is set, then we query the window size, as before.
* Auspice itself will not modify the URL query, it must be specified manually.
This is desirable for embedding nextstrain viz in other sites via iFrame. It simply doesn't render the header / footer. Note the sidebar is can still be toggled, but can be set to closed via a different URL query.
@jameshadfield jameshadfield temporarily deployed to auspice-iframe-mtwbapzp2abw69e February 5, 2020 00:28 Inactive
@jameshadfield jameshadfield merged commit c5cbccd into master Feb 5, 2020
@jameshadfield jameshadfield deleted the iframe branch February 5, 2020 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant