Comments (7)
Cool stuff! Whatβs your use case for an electron app exactly?
from webviz.
I'm new to Node/React and Electron so mainly I was just curious to learn about how the projects are structured, built, and deployed/packaged.
From previous work in automotive development though, a few potential use cases for offline stand-alone data analysis that I was thinking about are:
- On-road testing in development vehicles using laptops without online access
- Lab PCs that might be isolated from the internet for data/source code confidentiality
- Keeping a local stable build version to use vs the latest deployed online release
It's definitely nice to have a central server-based, continuously updated distribution option for this kind of app, but maybe an offline packaged option could also fill some use case gaps since Electron makes it fairly easy to add on this capability for Node/React projects.
from webviz.
Ah that makes sense! Since Webviz is just a static page I'd recommend downloading the gh-pages branch (or going to the website and using the "Save as" feature of most browsers) and then opening webviz-core.html in a browser.
That said, we might revisit using an Electron app in the future, since it would allow us to use some more powerful local APIs. In that case we'd definitely use your contribution, so thanks! Definitely a good learning experience though I bet. :) Closing for now.
from webviz.
Ah, I see. Thanks for the feedback.
Actually, before using Electron, I had tried just loading the webviz-core.html file from the gh-pages branch pack but it fails to load a bag file when dropped onto the page (Chrome, Firefox, and Safari, Mac and Linux), so I figured there was something dynamic that needed a web server to load.
I looked into it some more, and it seems there are a couple issues with just loading a local file version:
- Chrome throws the error:
webvizCoreBundle.js:8077 Uncaught (in promise) DOMException: Failed to construct 'Worker': Script at 'file:///webviz/dist/BagDataProvider.worker.js?c96bbc24cbd8fb74039a' cannot be accessed from origin 'null'.
By default, Chrome doesn't allow loading web workers from local files. There is a possible workaround by launching Chrome from the command line with the --allow-file-access-from-files flag, but then this results in a file path error:
GET file:///webviz/dist/BagDataProvider.worker.js?c96bbc24cbd8fb74039a net::ERR_FILE_NOT_FOUND
I ran into this when packaging the Electron app, and I patched it by changing the webpack.config.js publicPath from "/webviz/dist/" to the relative "dist/" and deploying the files into a "webviz" base folder.
- Patching the publicPath and allowing Chrome to access local files still leads to another error:
Fetch API cannot load file:///home/student/Downloads/webviz/dist/wasm-lz4.wasm. URL scheme "file" is not supported.
I'm not sure the root cause or patch for this, but switching to Firefox (with default options) instead of Chrome and the patched publicPath finally does allow working from the local html file directly.
Anyways, from this it seems that one more advantage to Electron is avoiding these direct local file access permission issues and different browser discrepancies!
from webviz.
Ah good points! And thanks for the writeup! For now the simple workaround for most of this is running a http server, which can be done by running python -m SimpleHTTPServer 8000
in the root of the gh-pages branch, or by running npm run docs
in the master branch.
from webviz.
I know this is an old/stale issue, but for anyone who comes across it searching for how to run webviz inside electron, we are doing that over at https://github.com/foxglove/studio
from webviz.
Shameless π
from webviz.
Related Issues (20)
- Delayed laserscans when clock times are out of sync HOT 1
- Bag not available HOT 2
- How large rosbag can webviz remote load?
- Consume React components directly HOT 3
- Errors when bootstraping the app HOT 1
- Error in fetching topics and datatypes HOT 1
- npm run bootstrap error
- Wrong visulization when coordinate values are large HOT 1
- Please update the invite HOT 1
- Pause button does not work HOT 2
- Why is the setting for transparency not working? HOT 1
- Can this this application be used as a part of custom application
- Can this application be used as a part of custom application? HOT 2
- Which node version should be used under Windows
- Information on the audio panal?
- Wrong Numeric Interpretation: how to fix? HOT 1
- ROS Demo.bag not available HOT 1
- /dist/vendor.js" Error (404): "Not found HOT 1
- root@ build-static-webviz: `lerna run build && rm -rf __static_webviz__ && cp -r docs/public/app __static_webviz__ && rm __static_webviz__/index.html && cp packages/webviz-core/public/index.html __static_webviz__/index.html && sed -i -- 's/\/dist\/webvizCoreBundle.js/webvizCoreBundle.js/' __static_webviz__/index.html && NODE_ENV=production STATIC_WEBVIZ=true webpack`
- Error: Minified React error #321
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webviz.