thomasballinger / observable-jupyter Goto Github PK
View Code? Open in Web Editor NEWEmbed visualizations and code from Observable notebooks in Jupyter
Home Page: https://observable-jupyter.readthedocs.io/
License: ISC License
Embed visualizations and code from Observable notebooks in Jupyter
Home Page: https://observable-jupyter.readthedocs.io/
License: ISC License
I'm seeing an error in the embeds of Observable visualizations in previously run Jupyter notebooks that says @variable is not defined
. This appears to have just started to happen today and can be reproduced in some of the examples from the demo Google Colab notebook from this repo:
Here's an example
import this
text = ''.join(this.d.get(l, l) for l in this.s)
embed('@ballingt/word-cloud-example', cells=['chart'], inputs={'source': text})
chart = RuntimeError: @variable is not defined
Also, here's a screenshot
It is interesting since the first gear embedding is working and the visuals from the embedded Observable notebooks are working properly
I tried the demo Colab jupyter notebook. Given this cell:
embed('@d3/gallery')
one cannot click on a map type and have an execution. Nothing
happens. Is that intended or is there a workaround?
The cell before that one works fine and allows for interactive control.
The least important of the many things I'm jealous of robservable for.
inconsistent too:
from observable_jupyter import embed
is the module name, that's finehttps://pypi.org/project/observable-jupyter/
currently points to the dead https://github.com/observablehq/observable_jupyter/
https://talk.observablehq.com/t/webgl-error-when-using-observable-jupyter/5019
@cornhundred did this keep happening?
The cells above this work, but not this last one. Perhaps it's embedding a whole notebook that no longer works?
https://colab.research.google.com/drive/1t_wcE-NqoPO-dpnrB9VMQ0KUxR5e1rML?usp=sharing
observable-jupyter currently runs all cells of a notebook. It may come up that people want to run only a selection of cells. (I messed this up in #5)
Robservable uses include=[a, b, c] and hide=[c] to run a, b, and c but only display a and b. This API wouldn't be backwards-compatible, but it seems nice.
There are a variety of possible APIs!
Hi, I'm seeing an error when I import the newer version 0.1.11 of observable_jupyter
The example can be seen in this colab notebok
!pip install observable_jupyter
from observable_jupyter import embed
embed('@mbostock/epicyclic-gearing', cells=['graphic'], inputs={'speed': 0.2})
gives
Collecting observable_jupyter
Downloading observable_jupyter-0.1.11.tar.gz (218 kB)
|████████████████████████████████| 218 kB 24.9 MB/s
Building wheels for collected packages: observable-jupyter
Building wheel for observable-jupyter (setup.py) ... error
ERROR: Failed building wheel for observable-jupyter
Running setup.py clean for observable-jupyter
Failed to build observable-jupyter
Installing collected packages: observable-jupyter
Running setup.py install for observable-jupyter ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ou6cpj4y/observable-jupyter_aeeb949b00664482a1f6b29190831e9c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ou6cpj4y/observable-jupyter_aeeb949b00664482a1f6b29190831e9c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6r6c2eme/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/observable-jupyter Check the logs for full command output.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-ed6c3cb33f01> in <module>()
1 get_ipython().system('pip install observable_jupyter')
----> 2 from observable_jupyter import embed
3 embed('@mbostock/epicyclic-gearing', cells=['graphic'], inputs={'speed': 0.2})
ModuleNotFoundError: No module named 'observable_jupyter'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
But, if I pip install 1.1.10 it works - see this colab notebook
A good API change (any falsy value observer value causes a cell not to be observed) causes a behavior change in observable_jupyter: when specific cells are embedded, other cells they implicitly depend on for side effects will not run!
This change was published in 0.1.8 for about five minutes, from 5:43pm to 5:49 today, at which point I deleted the release.
This may be a behavior uses want — the hide=
option that robservable uses is nice — but this would be a confusing breaking change to surprise users with. observable_jupyter users expect all cells to be run by default.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.