`FigureWidget` fails with `anywidget` in colab
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 18.8k
- Fork
- 2.8k
- Merge trung bình
- 16 giờ 26 phút
- Pull request đã merge (30 ngày)
- 21
Mô tả
Problem:
Since v6.0.0 FigureWidget uses anywidget. However, it fails with a java script error.
$ pip show plotly anywidget
Name: plotly
Version: 6.0.0
Summary: An open-source, interactive data visualization library for Python
Home-page: https://plotly.com/python/
Author: Chris P
Author-email: chris@plot.ly
License: MIT
Location: /home/erti/PROJECT_repos/ForeST_HPO/hpo-innosuisse/.venv_anywidget/lib/python3.11/site-packages
Requires: narwhals, packaging
Required-by:
---
Name: anywidget
Version: 0.9.13
Summary: custom jupyter widgets made easy
Home-page:
Author:
Author-email: Trevor Manz <trevor.j.manz@gmail.com>
License: MIT
Location: /home/erti/PROJECT_repos/ForeST_HPO/hpo-innosuisse/.venv_anywidget/lib/python3.11/site-packages
Requires: ipywidgets, psygnal, typing-extensions
Required-by:
import plotly.graph_objs as go
fig = go.FigureWidget()
fig.add_scatter(y=[2, 1, 4, 3])
fig
Either, no output (no figure) is shown or this is shown:
Failed to load view class 'AnyView' from module 'anywidget'
Error: No version of module anywidget is registered
at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2420023)
at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2803837)
at WidgetManager.loadViewClass (https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2417001)
at https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2410155
at async Tt.renderWidget (https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-linux-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:17:17328)
at async op (https://file+.vscode-resource.vscode-cdn.net/home/erti/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-linux-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:17:31113)
Workaround:
Downgrading to plotly-5.24 solves the problem
Related:
Maybe somewhat related to https://github.com/plotly/plotly.py/issues/4996
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện vấn đề với Plotly 6.0.0 và anywidget 0.9.13 bằng đoạn mã FigureWidget được cung cấp, sau đó so sánh với plotly-5.24. Bắt đầu bằng cách truy vết quá trình tích hợp FigureWidget và anywidget; hoàn thành khi biểu đồ được render mà không có lỗi JavaScript đã được báo cáo trong môi trường notebook bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- jupyter-notebook, python
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100