Embed Observable cells hosted on observablehq.com into Jupyter notebooks.
Project description
observable_jupyter
Embed cells from Observable notebooks into Jupyter notebooks.
The following ways to view the demo notebook won't work until we make this repository public:
- View example notebook with nbviewer
- Run example notebook on Binder
- [Run example notebook on Colab](current notebook on collab is just a copy, not the one under version control here)
To install the library, import the embed function, and embed the "graphic" cell from this notebook:
!pip install observable_jupyter
from observable_jupyter import embed
embed('@mbostock/epicyclic-gearing', cells=['graphic'], inputs={'speed': 0.2})
The simplest way to use embed()
is to render an entire Observable notebook:
embed('@d3/gallery')
You may want to swap in your own data into a D3 chart:
import this
text = ''.join(this.d.get(l, l) for l in this.s)
embed('@d3/word-cloud', cells=['chart'], inputs={'source': text})
With multiple cells, you can embed interactive charts!
embed(
'@observablehq/visualize-a-data-frame-with-observable-in-jupyter,
cells=['vegaPetalsWidget', 'viewof sepalLengthLimits', 'viewof sepalWidthLimits'],
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
observable_jupyter-0.1.7.tar.gz
(168.3 kB
view hashes)
Built Distribution
Close
Hashes for observable_jupyter-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 623bff6cc736bfddbc6fc9c85c647eaa5adb606e07a25370718aa7b03f5313f0 |
|
MD5 | 0187e2de35c09f9097f4e20f3293743d |
|
BLAKE2b-256 | 7df617951432a9b929637d86ce10868fadd506c25a0bd6f86b4098f7ec3e6092 |