WebDash is a Plotly Dash distribution that runs entirely in the browser.
⚠️ Currently in alpha stage - do not use in production! ⚠️ (Seriously, don't do it 😼)
The Python scientific stack, including Plotly Dash, Flask and their dependencies, are compiled to WebAssembly via Emscripten and bundled by pyodide. WebDash loads a full Python kernel (version 3.8) and runs it in a dedicated Web Worker. The kernel acts as a virtual Flask web server, serving Dash requests as if it were a normal server. On the front-end, WebDash intercepts any requests intended to go to Dash and routes them to the virtual Flask web server.
This allows the entire distribution to be served as a static website, eliminating the need for containers or virtual environments, thus enabling great scalability.
Demo app available on Netlify and Vercel.
We have seen issues with Vercel being slow to load pyodide dependencies on Chrome. If that's the case for you, please consider using FireFox to try the demo (we are working with Vercel on this) or try the Netlify deployment link instead
dash
, dash-core-components
and dash-html-components
have been compiled to WebAssembly. dash-daq
is not yet available. Therefore, if your application is relying on dash-daq
or any packages outside the three mentioned above - your app won't work. Please open an issue if there's a package you'd like to add or, even better - open a PR 😻.location
etc. When you find a feature which does not work, please open an issue with a self-contained, sample app we can use to reproduce the issue.requests
module, although available, won't work (nor will other modules that rely on it). The good news is that you can still retrieve data using the JavaScript fetch
API, and pyodide ships with a wrapper pyodide.open_url()
which makes this easy to use from Python. See the cross_filter_app.ts
file under src/dash_apps
for an example of how to use this.src/dash_apps
directory as a TypeScript file. The file should contain a JavaScript variable with the app as a string of Python code (we will improve this process in future releases).window.dashApp
variable before running the boot sequence. Your app file should set that variable - look at the cross_filter_app.ts
file for an example of how to set this.index.html
file under the src
directory so it gets loaded.See the contributing guide for information about the project's structure and setting up a development environment.
WebDash started as a research project Itay Dafna (@ibdafna) worked on at Bloomberg LP, with help from Paul Ivanov (@ivanov) who provided technical mentorship, guidance and some laughs. All rights are reserved to Bloomberg LP.
Much of this README is based on repos @jtpio owns.