plotly / plotly/plotly.py

Automatically set correct renderer for Plotly charts in VSCode Notebooks

未关闭
#4,827 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P2
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

Because https://github.com/microsoft/vscode-notebook-renderers/pull/199 is unmerged, users of Plotly.py using the VSCode notebooks cannot access the latest Plotly.js/Plotly.py features and no discernible error message is provided. This leads to confusion, because users are working with the latest version of Plotly.py and their charts don't work properly.

This has caused issues for adoption of new features like MapLibre and subtitles in charts, and may others. See e.g.:

Developers can workaround this by adding to their notebook:

import plotly.io as pio
pio.renderers.default = "notebook_connected"

While this is trivial to change, it's undiscoverable and non-intuitive. If you have the latest version of Plotly.py installed, you should be able to use the latest features in any Python environment!

Regardless of whether https://github.com/microsoft/vscode-notebook-renderers/pull/199 is merged, this dependency means VSCode Notebook users will always lag behind Plotly.py releases as we wait for VSCode to adopt and release their own updates, which means VSCode users would never have day-of updates without a workaround 🙁

Is it possible to detect that we're in a VSCode Notebook environment and automatically set the correct renderer to avoid this dependency on a VSCode update?

贡献指南

打开贡献指南

从这里开始

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

调研方向

没有指定 repository 文件或测试。首先阅读通过 plotly.io 暴露的 renderer 配置,尤其是入口点 pio.renderers.default,并调查如何识别 notebook 环境。当 VSCode Notebook 用户无需添加文档中说明的 workaround 就能自动获得当前兼容的 renderer,且检测行为有覆盖时,即表示完成。

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

评估

技术栈
javascript, jupyter-notebook, python
领域
data-visualization, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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