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 figurl support #39

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

add figurl support #39

wants to merge 27 commits into from

Conversation

magland
Copy link
Collaborator

@magland magland commented Feb 21, 2024

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.sh

The 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.

@@ -0,0 +1,8 @@
rm -rf dist
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

devel/gather_example_for_figurl.py Show resolved Hide resolved
@@ -1,11765 +0,0 @@
{
Copy link
Collaborator

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?

Copy link
Collaborator Author

@magland magland Feb 22, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants