-
Notifications
You must be signed in to change notification settings - Fork 4
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 figurl support #39
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,8 @@ | |||
rm -rf dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this file does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It copied the public directory to a dist directory, deletes the dist/DATA, and then uploads that directory to surge.sh under the name figurl-raster-vis.surge.sh, so that can be used as the v query parameter for the figurl views. I am the owner of that particular subdomain, but if someone else wanted to deploy it, they could just sign up for surge (free) and choose a different name.
@@ -1,11765 +0,0 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it necessary to get rid of the package-lock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some problems when using the original package-lock.json, and I though it might be due to the fact that you are using darwin and I am using linux. But that might not be an issue any more, so we could try adding it once again to the repo (which is generally the recommended thing to do).
With these changes, this website can either be viewed stand-alone (using DATA/ directory) or embedded as a figurl figure.
Figurl example:
https://figurl.org/f?v=https://figurl-raster-vis.surge.sh/index.html&d=sha1://6960bfacd9d975c8aab448b80713e2e5c440f69e&label=figurl_data.json
As you can see from the
v
query parameter, this is deployed to surge.sh for now. See devel/deploy_surge.shThe right way to do this is to utilize the @fi-sci/figurl-interface package. However, I was running into trouble bundling that in (I'm not too familiar with bower/gulp). So I converted the typescript to javascript, removed the
await
syntax, and included the figurl-interface code directly into this source.See loadData.js -- it detects whether the site is being embedded in an iframe or not. If so, it communicates with the parent figurl window. If not, it loads the data from DATA/ as normal.
See devel/gather_example_for_figurl.py to see the format of the .json file that figurl is expecting.