Open jpivarski opened 7 years ago
Slim hope, but hope. I have an experimental branch at https://github.com/millejoh/emacs-ipython-notebook/tree/dynamic-javascript that has very basic support for running javascript using skewer. The problem, as I understand it, is that vega works by updating the DOM of the webpage it is running in - something that does not make much sense in an Emacs buffer.
My initial thought is that this might work if I can get Vega to run in headless mode and run a jpeg/svg image - something EIN knows how to handle very well.
Wish me luck. I don't get a lot of time to work on this project but agree it would be very cool feature to have.
Do you suppose you could call out to nodejs? The Vega npm package has two executables, vg2png
and vg2svg
that can go through standard in/out. The PNG conversion uses the npm Canvas package, which requires a lot of compiled Cairo libraries, but SVG is just DOM manipulation. I think Canvas is a formal dependency for the Vega npm package, though.
This is an interesting idea - wrap this in Python and the notebook will do "the right thing" as far as letting EIN know there is a image on the way. Again, work goes slowly at times but I will try to look more into doing this.
Thanks for the suggestion!
This is wonderful, except... I can't view Vega objects (https://github.com/vega/ipyvega/blob/master/notebooks/Vega.ipynb) because of
Is there any hope that a future version will be able to deal with this? If so, when?