Plotly graphs in jupyter notebooks re-render entire page html
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
When attempting to run the first graph in the getting started documents, after following the steps here, the entire page html is output ontop of the graph like in the screenshot below. This occurs for all other graphs I've tried as well.
library(plotly)
fig <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
fig

Steps to Reproduce:
- pull the
jupyter/r-notebookdocker image from here with the commanddocker pull jupyter/r-notebook
a. This allows you to skip the "add r-kernel" steps because the R kernel is included with the r-notebook. Specifically these two lines can be skipped:
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()
Alternatively, start with the jupyter/minimal-notebook and do the steps to add the R kernel.
- Run the docker image with
docker run -p '8888:8888' -e JUPYTER_ENABLE_LAB=yes jupyter/r-notebook - Open an R console and run
install.packages(c('repr', 'IRdisplay', 'pbdZMQ', 'devtools'))from the setup steps - Install pandoc - get to the container bash as root user. First get the container ID with
docker psthen use the ID you see there indocker exec -u root -ti <container id> bash. Runapt updatethenapt install pandoc.
a. Open the notebook from the link that step 2 output and you can verify pandoc is installed in/usr/bin/pandocby opening a terminal and navigating to the/usr/bindirectory. - Install plotly - either use the R console or the terminal. Personally, I used the terminal and ran
conda install r-plotly. I attempted with both the latest version and also withv4.9.2.2. Both showed the issue. - Once that's all setup, open an R-kernel notebook and attempt to create any plotly graph. It will initially load the graph correctly, then a few seconds later, you will see the issue from the screenshot above.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 R-in-Jupyter 入门指南开始,并在使用 R-kernel notebook 的 jupyter/r-notebook Docker 容器中重现该示例。将初始图表渲染结果与 issue 中描述的后续输出进行比较;当 Plotly 图表能够渲染且不会将整个页面 HTML 附加到图表上时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- docker, jupyter-notebook, r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100