plotly / plotly/react-plotly.js
How do I use Plotly.Fx.hover with react-plotly.js?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 138
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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}
/>
)
}
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem verlinkten Plotly coupled-hover-events-Beispiel und dem im Issue gezeigten react-plotly.js ref. Vergleiche den Wrapper-Ref mit dem angeforderten Plotly.Fx.hover-Verhalten; abgeschlossen ist die Aufgabe, wenn eine unterstützte Möglichkeit identifiziert wurde, die gekoppelte Hover-Interaktion mit der gezeigten Komponente zu reproduzieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, plotly, react, typescript
- Bereich
- data-visualization, frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100