cruise-automation / webviz

web-based visualization libraries
https://webviz.io/
Apache License 2.0
2.01k stars 408 forks source link

Run webviz from source build without launching docs page #406

Open ben-greenberg opened 4 years ago

ben-greenberg commented 4 years ago

I've built webviz from source and have been using it with great success. The only kink in my system is that currently when I want to open up the webviz application in a browser, I have to run npm run docs which launches the docs app in addition to running the webviz application.

Is there another way to run just the application without launching the docs page?

janpaul123 commented 4 years ago

You could host it online somewhere? We host webviz.io/app using Github Pages.

castaway2000 commented 4 years ago

@janpaul123 I think what they are saying is that they would like to run the webviz App as landing page. Is there an easy way to implement the webviz-core package in a standard html page or modify the existing React application to point the landing page to be the webviz app?

I was also looking into doing this using the webviz-core package as a static website however it seems the webviz-core package is not able to source /dist/webvizCoreBundle.js and is not in the repo from what I can tell, How is this bundle sourced?

if the bundle was included it would make for an easier solution to the problem by simply running the package as a standalone app.

janpaul123 commented 4 years ago

You can see here how we publish our gh-pages branch: https://github.com/cruise-automation/webviz/blob/6623f080b2bee11144df1bb70c2ac93db51a37fa/package.json#L134

You can also statically host the gh-pages branch directly yourself. It's what gets hosted on webviz.io. You can see that it has an app/index.html that contains the actual application.

janpaul123 commented 4 years ago

Maybe we should pull that out into its own command so everyone can easily generate a static build? Happy to take PRs for that!

kevinrev26 commented 4 years ago

What if I wanted to use the individual components of the WebViz Core?

How should I import them?

janpaul123 commented 4 years ago

We don't currently support that. Those are considered internal API and might change heavily on every release. But if you really want to I guess you can just import them like any other component; e.g. import useDataSourceInfo from "webviz-core/src/PanelAPI/useDataSourceInfo";

janpaul123 commented 4 years ago

Btw I set up a Slack workspace to make it easier for us to chat; join us using the link here: #461