Examples showing the problem described below are in the notebook notebooks/A2_Matrix_Layout_Displays.ipynb
The notebooks exercise code that returns IPython.display.SVG objects.
These render correctly when I run jupyter directly, but not when I run jupyter in the docker image.
When I display the svg file, e.g., using and HTML div in a markdown cell, the figures are correct,
so the issue seems to be the IPythib.display.SVG code?
Can anybody tell me what I need to do to get this working?
I wonder if Discourse mangled your posted link? It happened the other day when someone tried posting a complex link, too. Anyway, clicking your link above fails.
As for you issue. I’m not following 100% what you are trying to point at? It looks like the SVG at the top very top works? And the ones at the bottom, such as after section 1.3, aren’t rendering right in your notebook A2_Matrix_Layout_Displays.ipynb. Is that what you mean?
Maybe its a Jupyter thing because it’s not serving the image? Maybe its a binder thing due to the reverse proxy. Maybe it’s because you are using “…” in your path?
A workaround could be to convert the svg to a data url. For example Panel seems to do this. So you could probably use panel.pane.SVG to get it working.
Hi @MarcSkovMadsen
Oh, sorry the notebook is fixed to actually render the image!!!
It is
h
that does not render correctly. h is the file contents wrapped in IPython.core.display.SVG(file_contents)
This normally works fine, but does not work in the docker image!
If I try to use panel, e.g.,
import re
svg_version_re = re.compile('^<\?xml version=[^>]*>' )
with open("../work/figs/f12sym.svg", "r") as f:
svg = svg_version_re.sub('', f.read() )
pn.pane.SVG(svg)
the result is still messed up. Panel may be using IPython.core.display.SVG internally?
The only workaround I know so far is to display an HTML img