Closed ghost closed 6 years ago
This is a bit awkward but works for showing static images:
Install selenium and chromedriver. In ob-ipython call chart.save('chart.png')
. In org, insert a link to chart.png
. Execute (org-toggle-inline-images)
. The image appears in the org document.
Some docs here: https://altair-viz.github.io/user_guide/saving_charts.html#png-and-svg-format
I'm trying to use Altair (which uses the Vega JSON spec for graphs) per https://altair-viz.github.io/gallery/simple_heatmap.html. Running the code in Emacs generates the javascript code below as a source block, rather than rendering the image. Altair has the ability to download PNG files directly, which may be useful here.
Incidentally, also makes very cool interactive graphics in JS for the browser. It'd be really nice to render the static PNG graphs in ob-ipython. (Of course it'd be super cool to get the interactive ones too, but I have no idea how to make work.)
Has anybody tried getting Vega-style graphs working in ob-ipython? I've looked around a bit but didn't see any examples. Thanks!