Problems with SVG rendering in IPython.display in Jupyter ipynb

未关闭
#969 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
jupyter-notebook, python
领域
frontend

调研方向

首先运行 SVG_Woe_Demo.ipynb 并比较附带的三个 SVG 文件,重点关注将 IPython.display.SVG 对象传递给 display 的顺序。复现后续代码单元输出中的乱码文本,并追踪 notebook 输出的渲染路径。完成的标准是 SVG 能够一致地渲染,并且无论 display 顺序如何,其文本都不再错乱。

由索引模型根据 Issue 内容生成。

描述

I'm trying to use IPython to display SVGs in the output of code cells, but I've observed some very strange behaviour in the way it renders: text in the images displays correctly in the first SVG I display, but in all the subsequent SVGs displayed, it is scrambled.

Displayed in markdown cells using html, all the SVGs display perfectly, but rendered in the code output by IPython they are scrambled. If I create a new IPython.display.SVG object from the file that was the first to display, it also displays correctly. It seems that the factor that determines which image will be displayed correctly is the order in which the IPython.display.SVG object is passed to display, not the order in which the filenames for the svg-files are passed to SVG. I've included the three svg-files, and an ipynb that demonstrates all of this.

This is very confusing - can you help?

figtree_0
figtree_1
figtree_2
SVG_Woe_Demo.ipynb.zip

主要语言
Python
星标
734
派生
411
平均合并
1 天 2 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ipython/ipykernel 的其他 Issue

查看 ipython/ipykernel 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。