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

passing what input data to load from another site #5

Open
havok2063 opened this issue Feb 3, 2020 · 2 comments
Open

passing what input data to load from another site #5

havok2063 opened this issue Feb 3, 2020 · 2 comments

Comments

@havok2063
Copy link

Rather than having a path to a data file be hardcoded in the notebook, or data pre-loaded in a notebook that Voila serves, I need to be able dynamically load content based on an input filename, id, path, etc. Is this possible within the Vue/Voila framework?

My use cases:

  1. From website A, perform a search on data which returns a table of results, i.e. a list of objects. Each row in the table has a link/button that opens up a new page (website B) containing the Voila-embedded content generated for that object.
  2. Given an list of object identifiers (or data files), a user can upload that list to generate a series of web-based visualizations generated by the Voila-served notebooks.

My guess is that this is possible for Use Case 2, or in any case where I can control the front-end web code. Perhaps with a hidden input box mapped to a notebook event that gets called during Vue.created() and loads the data specific to that object?

However, for use case 1, website A is a different site other than the front-end web server (website B) managing the embedded Voila content. It won't have a Vue front-end, or be a website that I can easily change it's content. The most we can do is have a html link that points to a url, or perhaps a button that performs a get/post request. Website B I have more control over.

Thoughts?

@mariobuikhuizen
Copy link
Owner

In case 2 you don't need a hidden input box, you can just set widget properties directly since this PR: #3 (Which I will merge shortly).

In case 1 you could encode the information in the query string or fragment identifier of the link to site B. On site B you can read the query string or fragment identifier in the front-end (window.location.search, window.location.hash) and pass it with an event or set a widget property. The notebook can react to this event/property change and load the requested data.

@havok2063
Copy link
Author

Ok that makes sense. That at least gives me a place to start. Thanks a lot. I'll let you know if I have any more questions.

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

No branches or pull requests

2 participants