Highlight of trace adds duplicate legend item.
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, r
- Domínio
- data-visualization, frontend
Direção de pesquisa
Comece em inst/htmlwidgets/plotly.js, na lógica de seleção do crosstalk em torno das linhas 733 e 815. Reproduza a entrada de legenda duplicada “Alpha” e, em seguida, rastreie como os traces selecionados e não selecionados são adicionados ou atenuados, incluindo o caso de seleção parcial descrito na issue. O trabalho estará concluído quando o realce não criar entradas de legenda duplicadas e preservar a legenda original quando a seleção cobrir apenas parte de um trace.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- R
- Estrelas
- 2.7k
- Forks
- 640
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/plotly.R
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
-
save_image ErrorAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
Todas as issues de plotly/plotly.R
Issues semelhantes
-
bug priority: should
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
The-Strategy-Unit/nhp_outputs#477 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Open-Systems-Pharmacology/OSPSuite.ReportingEngine#1380 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#335 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100