plotly / plotly/react-plotly.js

How do I use Plotly.Fx.hover with react-plotly.js?

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

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

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

説明

I am building something like this: https://plotly.com/javascript/hover-events/#coupled-hover-events, but I can't find a way to reproduce this behavior with react-plotly.js

Fx is not present in plotly.js anymore (isn't it?), and I can't find a way to find a Plotly's Plot instance (not the wrapper's instance) in order to try different methods.

Does anyone know how I could achieve a similar effect?

What I have so far looks something like:

import {FC, useEffect, useMemo, useRef} from "react";
import {BoxPlotData, Layout} from 'plotly.js'
import Plot from 'react-plotly.js';

export const MyPlot: FC = () => {
  const boxplotRef = useRef<Plot>(null)

  useEffect(() => {
    if (boxplotRef.current) {
      // What now?
      // I would like to do something like
      // boxplotRef.current.plot.hover([ { pointNumber: 1 }, { pointNumber: 2 }, { pointNumber: 3 } ])
    }
  }, []);

  const myLayout = useMemo((): Layout => { ... }, [])
  const myData = useMemo((): Partial<BoxPlotData> => { ... }, [])

  return (
    <Plot
      ref={boxplotRef}
      data={myData}
      layout={myLayout}
    />
  )
}

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

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

はじめの一歩

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

調査の方向性

リンクされている Plotly coupled-hover-events の例と、issue に示されている react-plotly.js ref から始めます。wrapper ref と、要求されている Plotly.Fx.hover の動作を比較します。完了の条件は、示されているコンポーネントで連動した hover インタラクションを再現する、サポートされている方法を特定することです。

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

評価

技術スタック
javascript, plotly, react, typescript
領域
data-visualization, frontend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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