New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notebook 7 does not render images in SVG, notebook 6 did. #7114
Comments
Also I just realized another unfortunate consequence of rendering SVG using |
Thanks @adl for the detailed report 👍 Do you know if this also happens in JupyterLab 4.0.7? |
Thanks for checking. Since Notebook 7 uses the same components as in JupyterLab, should we move this issue to https://github.com/jupyterlab/jupyterlab then? |
I don't now much about the architecture of Notebook, so whatever makes sense for you works for me. |
Closing in favor of jupyterlab/jupyterlab#10464, which was opened on JupyterLab 3, but which has attracted new comments even after JupyterLab 4 was released. @adl thank you for your contribution! |
I have read jupyterlab/jupyterlab#10464 but it seems to focus on embedding SVG into the notebook, while I'm precisely trying to achieve the opposite: I use SVG that refer to third-party files (shared style-sheets, or images) that cannot be embedded. These would require some rewriting of the href links so that the JupyterLab can serve those third-party files. Should I copy the above examples in that other issue? |
Description
Here is an example notebook I used to teach model checking. The
lift_display
functions is returning a SVG file (built by GraphViz that contains links to other SVG files stored in a subdirectory. Each configuration of the lift in the displayed graph is represented by a separate SVG file. This allows those small pictures to be cached by the browser when we regenerate the graph with different values. This was working very well with Notebook 6.x: the main SVG was inlined into the page, and the<image href=...>
tags inside that SVG were served by the notebook server.Nowadays, with notebook 7, I believe this has been broken in two ways:
<img>
will ignore links to external style sheets or external images.href="cache/1234.svg"
do not seem to be served by the notebook 7 server anymore. (Judging from how markdown links are rewritten) I believe those need to be rewriten ashref="file/cache/1234.svg?_xsrf=sometoken
.Reproduce
Here is a smaller reproducible example, assuming graphviz's
dot
command is installed:On Notebook 6 I get
On Notebook 7 I get
Obviously I would expect the last cell to contain the red ellipse.
For anyone without GraphViz, let me also attach a.svg and b.svg.
Context
Running Debian Unstable with Firefox 118.0.2.
The "notebook 6" I was using is 6.4.12 troubleshoot6.txt
The "notebook 7" I'm using is 7.0.4 troubleshoot7.txt
The text was updated successfully, but these errors were encountered: