plotly / plotly/plotly.py

Plolty graph not showing up in JupyterLab 4.3.1 on MacBook

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

还没有人认领这个 Issue。

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

描述

mamba create -n jupyter jupyterlab pandas plotly
mamba activate jupyter
jupyter lab
import plotly.express as px
import plotly.io as pio

# Ensure Plotly renders in the notebook
pio.renderers.default = "notebook"

# Example data
data = {
    "Category": ["A", "A", "A", "B", "B", "B", "C", "C", "C"],
    "Value": [10, 15, 13, 20, 22, 25, 30, 28, 35]
}

# Create a DataFrame
import pandas as pd
df = pd.DataFrame(data)

# Create the boxplot
fig = px.box(df, x="Category", y="Value", title="Boxplot Example")

# Show the plot
fig.show()

Image

environment.yml

name: jupyter
channels:
  - conda-forge
dependencies:
  - anyio=4.6.2.post1
  - appnope=0.1.4
  - argon2-cffi=23.1.0
  - argon2-cffi-bindings=21.2.0
  - arrow=1.3.0
  - asttokens=2.4.1
  - async-lru=2.0.4
  - attrs=24.2.0
  - babel=2.16.0
  - beautifulsoup4=4.12.3
  - bleach=6.2.0
  - brotli-python=1.1.0
  - bzip2=1.0.8
  - ca-certificates=2024.8.30
  - cached-property=1.5.2
  - cached_property=1.5.2
  - certifi=2024.8.30
  - cffi=1.17.1
  - charset-normalizer=3.4.0
  - comm=0.2.2
  - debugpy=1.8.8
  - decorator=5.1.1
  - defusedxml=0.7.1
  - entrypoints=0.4
  - exceptiongroup=1.2.2
  - executing=2.1.0
  - fqdn=1.5.1
  - h11=0.14.0
  - h2=4.1.0
  - hpack=4.0.0
  - httpcore=1.0.7
  - httpx=0.27.2
  - hyperframe=6.0.1
  - icu=75.1
  - idna=3.10
  - importlib-metadata=8.5.0
  - importlib_resources=6.4.5
  - ipykernel=6.29.5
  - ipython=8.29.0
  - isoduration=20.11.0
  - jedi=0.19.2
  - jinja2=3.1.4
  - json5=0.9.28
  - jsonpointer=3.0.0
  - jsonschema=4.23.0
  - jsonschema-specifications=2024.10.1
  - jsonschema-with-format-nongpl=4.23.0
  - jupyter-lsp=2.2.5
  - jupyter_client=8.6.3
  - jupyter_core=5.7.2
  - jupyter_events=0.10.0
  - jupyter_server=2.14.2
  - jupyter_server_terminals=0.5.3
  - jupyterlab=4.3.1
  - jupyterlab_pygments=0.3.0
  - jupyterlab_server=2.27.3
  - krb5=1.21.3
  - libblas=3.9.0
  - libcblas=3.9.0
  - libcxx=19.1.4
  - libedit=3.1.20191231
  - libexpat=2.6.4
  - libffi=3.4.2
  - libgfortran=5.0.0
  - libgfortran5=13.2.0
  - liblapack=3.9.0
  - libopenblas=0.3.28
  - libsodium=1.0.20
  - libsqlite=3.47.0
  - libuv=1.49.2
  - libzlib=1.3.1
  - llvm-openmp=19.1.4
  - markupsafe=3.0.2
  - matplotlib-inline=0.1.7
  - mistune=3.0.2
  - nbclient=0.10.0
  - nbconvert-core=7.16.4
  - nbformat=5.10.4
  - ncurses=6.5
  - nest-asyncio=1.6.0
  - nodejs=22.11.0
  - notebook-shim=0.2.4
  - numpy=2.1.3
  - openssl=3.4.0
  - overrides=7.7.0
  - packaging=24.2
  - pandas=2.2.3
  - pandocfilters=1.5.0
  - parso=0.8.4
  - pexpect=4.9.0
  - pickleshare=0.7.5
  - pip=24.3.1
  - pkgutil-resolve-name=1.3.10
  - platformdirs=4.3.6
  - plotly=5.24.1
  - prometheus_client=0.21.0
  - prompt-toolkit=3.0.48
  - psutil=6.1.0
  - ptyprocess=0.7.0
  - pure_eval=0.2.3
  - pycparser=2.22
  - pygments=2.18.0
  - pyobjc-core=10.3.1
  - pyobjc-framework-cocoa=10.3.1
  - pysocks=1.7.1
  - python=3.12.7
  - python-dateutil=2.9.0.post0
  - python-fastjsonschema=2.20.0
  - python-json-logger=2.0.7
  - python-tzdata=2024.2
  - python_abi=3.12
  - pytz=2024.1
  - pyyaml=6.0.2
  - pyzmq=26.2.0
  - readline=8.2
  - referencing=0.35.1
  - requests=2.32.3
  - rfc3339-validator=0.1.4
  - rfc3986-validator=0.1.1
  - rpds-py=0.21.0
  - send2trash=1.8.3
  - setuptools=75.5.0
  - six=1.16.0
  - sniffio=1.3.1
  - soupsieve=2.5
  - stack_data=0.6.2
  - tenacity=9.0.0
  - terminado=0.18.1
  - tinycss2=1.4.0
  - tk=8.6.13
  - tomli=2.1.0
  - tornado=6.4.1
  - traitlets=5.14.3
  - types-python-dateutil=2.9.0.20241003
  - typing-extensions=4.12.2
  - typing_extensions=4.12.2
  - typing_utils=0.1.0
  - tzdata=2024b
  - uri-template=1.3.0
  - urllib3=2.2.3
  - wcwidth=0.2.13
  - webcolors=24.8.0
  - webencodings=0.5.1
  - websocket-client=1.8.0
  - wheel=0.45.0
  - xz=5.2.6
  - yaml=0.2.5
  - zeromq=4.3.5
  - zipp=3.21.0
  - zlib=1.3.1
  - zstandard=0.23.0
  - zstd=1.5.6

贡献指南

打开贡献指南

从这里开始

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

调研方向

在提供的 mamba 环境中使用 JupyterLab 4.3.1 重现该示例,重点关注 pio.renderers.default = "notebook" 设置和 fig.show()。跟踪 Plotly notebook 渲染的入口点,并将输出与正常工作的 renderer 进行比较;当 boxplot 在报告的 JupyterLab 设置中成功渲染,并且该回归问题由适当的测试覆盖时,即视为完成。

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

评估

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

把新 issue 发到你的邮箱

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