plotly / plotly/plotly.js

Clickmode "event+select" activated and Clicking outside of Graph calls onUpdate incorrectly

Aperta
#6,977 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P2
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

I have looked for issues but couldn't find anything and just wanted to bring awareness to clickmode: "event+select" issue.

Hi, currently working on Streamlit + Plotly selections! I noticed this bug that didn't seem like a bug on Streamlit's side.

It seems like onUpdate gets called and graph gets updated visually incorrectly when clickmode: "event+select" and dragmode: "select" and doing selection clicks. I would expect onDeselect to be called and layout.selections to remove the selection because selectedpoints in data has []

Reproducible example: https://codesandbox.io/p/sandbox/react-forked-6rypkr?file=%2Fsrc%2FApp.tsx

Steps to reproduce:

  1. Click on a single point
  2. Click outside of a point

Expectation: Graph is not less than 100% opaque
Actual: Graph is less than 100% opaque and weird and onUpdate is not called

Video to show actual:

https://github.com/plotly/react-plotly.js/assets/16749069/632b9ef7-c213-4a27-a7c7-08f5b8c9417e

I read that most issues here are likely Plotly.js problems but not sure if that's the case because I went to check plotly.js code and onUpdate is a callback while plotly.js contains an update function as far as I can tell but I assume everything in react-plotly.js is based off plotly.js so just trying to bring extra awareness to this issue.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal punto di ingresso CodeSandbox collegato, App.tsx, e riproduci il comportamento usando clickmode "event+select" e dragmode "select". Poi traccia il percorso di selezione/aggiornamento di Plotly.js e il modo in cui react-plotly.js gestisce i callback; il lavoro è completato quando fare clic al di fuori di un punto selezionato ripristina l’opacità completa e produce lo stato di deselection e il comportamento dei callback attesi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
data-visualization, frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.