Based on a lot of work and ideas by Kurt Pagani, I have now put together
a little extension to jfricas that allows to include FriCAS graphics
into a Jupyter notebook.
It is basically transforming the data from TwoDimensionalViewport or
ThreeDimensionalViewport to .ps -> .png -> base64 encode PNG (all
written into /tmp).
To use it, you musst have the programs "pstoimg" and "uuencode" in your
PATH (that is hopefully something that can be replaced by python modules
in th future).
Either compile the attached files (see attached .ipynb) or compile a
full FriCAS from my clone
https://github.com/hemmecke/fricas.git (branch
wip/jview) and install kernel.json and fricaskernel.py according to
https://hemmecke.github.io/fricas/install.html#install-jfricas
Note that you should edit fricaskernel.py to use the option
pid = Popen(['fricas','-eval',start])
(comment/uncomment accordingly).
After execution the commands you should see a notebook similar to
jview.html.
It's just a demonstration of what is possible. Feedback is welcome.
Ralf