[Question] How to tell which point is clicked on when using onClick Event with multiple traces?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- data-visualization, frontend
Direzione di ricerca
Inizia con l’uso di createPlotComponent e del callback onClick mostrati nell’issue, quindi esamina l’array event.points e il MouseEvent prodotto per più trace. Determina se i dati dell’evento esistenti identificano la trace e il punto selezionati; il lavoro è completato quando viene documentato o esposto un modo affidabile per distinguere il punto cliccato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have setup a react application where I am using createPlotComponent to create an instance of an graph that I can interact with and I am controlling it using react-chart-editor
constructor() {
this.PlotComponent = createPlotComponent(plotly)
}
<this.PlotComponent
...data ,frames etc
onClick={(e) => {
console.log(e)
}}/>
The problem I am having is that when I have multiple traces on my graph, I want to determine which trace I am clicking. At the moment the event from onClick exposes the points (an array of all of the points clicked) and a MouseEvent which shows information about the point on the graph that is clicked. Is there any way to get specifically the information about the one point that is clicked on?
There might be a way to determine which point is clicked by using the mouse event and matching up the position of the mouse click on the graph with the position of the point on the graph. However, there doesn't seem to access the position of the points on the graph in terms of their coordinates
- Lingua principale
- JavaScript
- Stelle
- 1.1k
- Fork
- 138
- Merge medio
- 3g 2h
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/react-plotly.js
-
P3 plotly-internal size: 1 task
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
plotly/react-plotly.js#386 ·
-
enhancement P3 size: 1
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
plotly/react-plotly.js#380 · 7 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
plotly/react-plotly.js#358 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
plotly/react-plotly.js#354 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
plotly/react-plotly.js#353 · 1 commento ·
Tutte le issue di plotly/react-plotly.js
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·