[BUG]: deserialization of xrange of box select in figure with multiple subplots broken
オープン
まだ誰も着手していません。
bug
P2
size: 1
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、plotly.subplots と solara.FigurePlotly を使った提供済みの Python 例を実行し、次に 2 番目の subplot での box 選択に対する on_selection callback のデータを調べます。最初の subplot 以外で selection x/yrange がどのようにデシリアライズされるかを追跡します。これらの範囲が単純な Python object ではなく、list または dictionary として渡されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100