[BUG]: deserialization of xrange of box select in figure with multiple subplots broken
未关闭
还没有人认领这个 Issue。
bug
P2
size: 1
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Description
When you do a box (or lasso) select in a figure with multiple subplots (not the first subplot) the selection x/yrange is not a list/dict but a plain python object.
The gif above was created with this example:
import plotly.graph_objects as go
import solara
from plotly.subplots import make_subplots
def build_figure() -> go.Figure:
fig = make_subplots(rows=1, cols=2, subplot_titles=("Scatter", "Bar"))
fig.add_trace(go.Scatter(x=[1, 2, 3, 4, 5, 6], y=[2, 1, 3, 5, 4, 6], name="Series A"), row=1, col=1)
fig.add_trace(go.Bar(x=["A", "B", "C"], y=[3, 1, 2], name="Series B"), row=1, col=2)
fig.update_layout(title="FigureWidget example with 2 subplots",)
return fig
@solara.component
def Page():
def on_selection(data):
print("on_select data:", data, flush=True)
solara.FigurePlotly(build_figure(), on_selection=on_selection)
Steps to reproduce
- Create a figure with more than one subplot.
- Do a box select in the second subplot.
- Observe the data send to on_select.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行使用 plotly.subplots 和 solara.FigurePlotly 提供的 Python 示例,然后检查第二个 subplot 中进行 box 选择时的 on_selection 回调数据。跟踪非第一个 subplot 的 selection x/yrange 是如何被反序列化的。当这些范围以 list 或 dictionary 而不是普通 Python object 的形式到达时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100