Highlight of trace adds duplicate legend item.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, r
- Ambito
- data-visualization, frontend
Direzione di ricerca
Inizia in inst/htmlwidgets/plotly.js, nella logica di selezione di crosstalk intorno alle righe 733 e 815. Riproduci la voce duplicata “Alpha” nella legenda, quindi traccia il modo in cui le traces selezionate e non selezionate vengono aggiunte o rese più scure, incluso il caso di selezione parziale descritto nell’issue. Il lavoro è completo quando l’evidenziazione non crea voci duplicate nella legenda e preserva la legenda originale quando la selezione copre solo una parte di una trace.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The current implementation for a selection highlighting adds duplicate legend entries.
For example in the below screenshot I clicked on trace "Alpha" and a new legend item "Alpha" got added while the existing "Alpha" legend is now dimmed but is still present. Resulting in 2 "Alpha" entries.
The core problem is that the current javascript code handling crosstalk selection, simply adds a duplicate selection traces here and dims all other traces here.
Since the original 'Alpha' trace was not removed and only dimmed and since a new trace also named "Alpha" was added to the legend. It results in the above legend.
Would it be possible to update the javascript logic to just dim the non-selected traces and update the selected trace to the desired highlight color (and other aspects set by the user). This would the have the desired effect on the legend.
Or to set the selected trace with showLegend=FALSE in the restyle for all the traces that got highlighted?
Edit it is not so easy as first thought:
I guess where my above described solution fails is when the selection is only a subset the trace data and only partially covers it. In that case the original legend entry would still need to be visible.
However, in theory it is possible to detect at creation time of the plot if the crosstalk key selection is equal to the legend entries. Eg. if the crosstalk key and the aesthetic property for the legend are equal.
That said this detection would then fail if one constructs a plotly object by manually adding traces. Or if the plotly graph has other traces added from a different dataset.
So to achieve what we want, we somehow need to determine if selection data fully covers the trace data. Not sure how we could smartly do it without having and extreme impact on the performance.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
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/plotly.R
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
save_image Error Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
Tutte le issue di plotly/plotly.R
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
r-lib/pkgdepends#485 · 3 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
beginners blocker
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enviPathR ApertaBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
Bioconductor/BiocContributions#207 · 6 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
datacarpentry/semester-biology#1255 ·