-
Notifications
You must be signed in to change notification settings - Fork 2
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
Be able to 'embed' the visualization in your own web page #62
Comments
@bjdmeest |
I imagine this should be a js file in the static folder, so it can be accessed like |
Nono, embed in HTML :). You probably want to link to a released static JS file indeed |
DataFlowVisualization.init('myviz-randomid123') This code uses the imported script, right? Don't you imagine that script is written with And I think the js script will have the link |
It will be written in plain JavaScript, otherwise it won't work in the browser, or am I missing something?
|
Indeed! But how am i going to import stuff from my js files that reside in a React app? |
Imagine I have a file I don't think I can access the function from Maybe this gif makes things a bit more clear: (think about all the stuff I would need from |
And if that problem is fixed, I also need to get the |
You can probably see that as a second app without all the editing functionality but only the visualization that loads the config from, e.g. a global object. You'll probably want multiple builds, see eg https://www.labnol.org/code/react-multiple-entry-points-210512, and then you'll have in your second build a setup kind of like at https://sdk.gooddata.com/gooddata-ui/docs/4.1.1/ht_use_react_components_with_vanilla_js.html |
How do I link to a specially released version? Something like this does not work: (or is this link wrong?) This does work (but it is not a link to a release, it is a link to the version on the main branch): |
Ah yeah, you'll probably need something like https://raw.githubusercontent.com/KNowledgeOnWebScale/dataflow-visualization/v0.1.0/src/index.js (so you use a tagged version instead of just 'main') |
Wouldn't I just need to have another React component instead of a second build? That React component takes the config as a parameter. That React component is then only used by that script you link to in the |
also fine, but you need to create a built JS file, and for that I gave pointer I found after 2 min of googling, you can probably come up with something better :) |
This is partially fixed with the iframe method, and is related to #101 |
So a button that does something like below
The text was updated successfully, but these errors were encountered: