FigureWidget missing update for annotations/static lines
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
I use a FigureWidget as container for an updating Figure within JupyterLab. When I update the FigureWidget within a batch_update, the data and the layout overall are updated, but if I introduced a static object like a vline, this persists on the graphic. New executions of the very same FigureWidget instance show the refreshed frame. The properties of the instance itself are also indeed correctly update. Only the old frame in the previous executed cell misses the update on the static lines (but the data and other parts of the layout are correctly update every time as expected).
Here the basic code for reproducing the bug:
import plotly.graph_objects as go
import ipywidgets as wdgt
from plotly import __version__
print(f"Plotly: {__version__}")
print(f"IPywidgets: {wdgt.__version__}")
fig_wdgt = go.FigureWidget()
fig_wdgt
fig = go.Figure()
# fig.add_trace(go.Scatter(x=[1, 2, 3], y=[2, 1, 3]))
# fig.add_vline(x=2, annotation_text="my test line")
with fig_wdgt.batch_update():
fig_wdgt.data = []
fig_wdgt.layout = {}
fig_wdgt.add_traces(fig.data)
fig_wdgt.layout = fig.layout
and here screenshots with the bug, and suggested use of the code within Jupyter cells:
I tested the behaviour with python 3.10, Plotly: 5.15.0 and IPywidgets: 8.0.4, on OS, Linux, Windows, and on both Chrome and Edge browsers.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue に記載されている FigureWidget と batch_update の再現から始め、JupyterLab で指定されている Python、Plotly、ipywidgets のバージョンを使用します。データ、レイアウト、vlines などの静的オブジェクトに対する更新を比較します。新たに実行しなくても、以前に実行したセルがアノテーションと静的な線を更新すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- jupyter-notebook, python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100