The goal is a collection of demos and documentation for observable-jupyter, a new Python library that allows Python users to create interactive browser-based data visualizations...with JavaScript.
This Python notebook, , demonstrates exploratory data analysis with Observable Plot, a new JavaScript library for EDA that's built with D3. The Python notebook uses the observable-jupyter API to access the powerful Observable Plot library, which is 100% JavaScript.
Yet another new Python plotting package?
No. What's new is that observable-jupyter integrates JavaScript data-viz capabilities directly into Python with a super simple API. That makes the power of HTML5 data visualization readily accessible from Python. The demo above shows how it's done with Observable Plot, a library by Mike Bostock, creator of D3 and co-founder of Observable, Inc. But the capability is not restricted to Observable Plot. You can take the same approach to provide direct Python access to all sorts of JavaScript data-viz libraries.
Do you need to be front-end developer to customize things?
No. Integrating JavaScript data viz into Python used to be hard, but not anymore -- you no longer need to be a front-end web dev to do it. The demo shows how it's done. And once things are set up, it's easy to create custom data visualizations in Python without touching the JavaScript.
It can't be that easy. What's the catch?
Someone needs to set up a library-specific Observable notebook for use by observable-jupyter. That notebook must expose the parameters and data variables needed on the JavaScript side. You need to know some JavaScript to set it up, but it's not hard. The demo above uses this Observable notebook. It's a very slightly modified fork of Mike Bostock's original. Parameters and data are specified in Python and then observable-jupyter sends it as JSON to the JavaScript side with a simple Python function call. Once the Observable notebook is set up, anyone can use it.
What's next?
The goal is a collection of demos and documentation for doing data visualization in Python with observable-jupyter. These demos will showcase a variety of cutting-edge JavaScript libraries ranging from interactive maps to 3-D scatterplots. We'll show how to create the kinds of interactive visualizations that aren't currently possible in Python, such as this Mona Lisa Histogram. And for those data scientists who know a little JavaScript, we'll also create documentation that shows how to set up Observable notebooks so that they're easily usable with observable-jupyter.
- robservable gallery
- discussions
- examples
- Ideas being tossed around:
- Sphinx or other standard Python documentation format and likely hosted on https://readthedocs.org/
- exported Jupyter notebooks or colab notebooks might be a good fit for documenting the project
- observable-jupyter-widget
- advanced embedding and downloading
- github primer