plotly / plotly/react-plotly.js

Tooltip misaligned when using global data object, layout prop and onHover that manipulates state

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

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

主要言語
JavaScript
スター
1.1k
フォーク
138
平均マージ
3日 2時間
マージ済み PR(30日)
4

説明

The tooltip hover functionality gets messed up when the following conditions are met:

  • You got your own data object which isn't reinitialized every time the plot is rendered.
  • You have declared a custom onHover function
  • You update state to get the component to re-render
  • You have defined the layout property in the Plot component

This sandbox reproduces the error
https://codesandbox.io/s/qx5qr2m5x4

Hover one of the points in the plot. The tooltip will be shown briefly and afterwards the rest of the points will be misaligned towards the axes.

Versions used:
plotly.js 1.37.1
react-plotly.js 2.2.0

Tested on:
chrome
edge

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

まず、記載されている plotly.js と react-plotly.js のバージョンでリンク先の CodeSandbox を実行し、カスタム onHover が state を更新している間にポイントへホバーして、位置ずれを再現します。Plot コンポーネントによる global data object、layout prop、rerender の処理を追跡します。state の更新後に tooltip が正しく表示され、残りのポイントが整列したままになれば完了です。

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

評価

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

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

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