ipywidgets GridspecLayout not supported
未关闭
还没有人认领这个 Issue。
bug
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
import plotly.graph_objects as go
fig = go.FigureWidget(go.Bar(
x=[20, 14, 23],
y=['giraffes', 'orangutans', 'monkeys'],
orientation='h'))
from ipywidgets.widgets import HBox
HBox([fig,fig])

from ipywidgets import GridspecLayout
grid = GridspecLayout(1, 2)
grid[1,1]=fig
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-551846bd84cb> in <module>
1 from ipywidgets import GridspecLayout
2 grid = GridspecLayout(1, 2)
----> 3 grid[1,1]=fig
/opt/conda/lib/python3.8/site-packages/ipywidgets/widgets/widget_templates.py in __setitem__(self, key, value)
316 self._id_count += 1
317 obj_id = 'widget%03d' % self._id_count
--> 318 value.layout.grid_area = obj_id
319
320 rows, columns = self._get_indices_from_slice(row, column)
/opt/conda/lib/python3.8/site-packages/plotly/basedatatypes.py in __setattr__(self, prop, value)
4978 if match is None:
4979 # Set as ordinary property
-> 4980 super(BaseLayoutHierarchyType, self).__setattr__(prop, value)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 Jupyter notebook 中运行提供的 Python 示例,比较可正常工作的 HBox 情况与会引发 ValueError 的 GridspecLayout 赋值。跟踪图形 widget 如何处理布局赋值,然后验证将 FigureWidget 放入 GridspecLayout 中可以正常工作且不会出现所报告的异常。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- jupyter-notebook, python
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100