plotly / plotly/plotly.js

Shapes are drawn outside the plot when using annotations and autorange.

オープン
#5,017 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3
主要言語
JavaScript
スター
18.3k
フォーク
2k
平均マージ
2日 12時間
マージ済み PR(30日)
28

説明

When updating shapes and annotations with Plotly.react, both are drawn outside the plot when the y-axis is automatically ranged. StackBlitz Example

This seems to be because the y range is reset to [0, 4], the data hasn't changed so the range isn't re-calculated, and the annotations draw procedure updates the y-axis _m and _b metrics used to calculate the paths (src/components/annotations/draw.js line 71). I can't pass the current range, because the axis range should be re-calculated if the data does change. This only occurs if the annotations are updated, because the shapes draw procedure doesn't update the y-axis metrics.

Plotly.js 1.54.6

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされている StackBlitz の例から始め、src/components/annotations/draw.js の 71 行目付近を調べてから、shapes の描画手順と比較します。autorange が y の範囲をどのように設定するか、また Plotly.react 中に軸の _m および _b メトリクスがどのように更新されるかを追跡します。更新された shapes と annotations がプロット内に収まり、データが変更されたときにも y 軸の自動レンジが引き続き応答すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。