[BUG]: `histogram2dcontour` uses wrong fill colors for negative values
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 65/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript
- Domínio
- data-visualization
Direção de pesquisa
Comece executando a reprodução fornecida no CodePen para um trace histogram2dcontour usando valores z negativos e com histfunc definido como avg, min ou max. Rastreie o caminho de renderização de histogram2dcontour e verifique se os preenchimentos de contorno dos bins negativos correspondem aos seus rótulos e à colorscale nas três funções.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
First reported in plotly.py: https://github.com/plotly/plotly.py/issues/3799
histogram2dcontour traces use incorrect fill colors when bin values are negative.
Negative bin values can occur when histfunc is set to 'avg', 'min', or 'max', and the input z array contains negative values.
When some bin values are negative, all negative bin values are filled with the same color as 0 on the colorscale, while the outermost fill level is filled with the same color as the lowest number on the colorscale.
Example
Codepen reproduction: https://codepen.io/emilykl-code/pen/PwpPjMb
Code:
Show code
const x = [1, 2, 3, 4, 1, 2, 3, 4];
const y = [1, 1, 1, 1, 2, 2, 2, 2];
// The bug is triggered when histfunc is 'avg', 'min', or 'max',
// and some z-values are negative such that some resulting bin values
// end up negative
// This example uses all-negative z values to show the most extreme
// case, but not all z-values need to be negative to trigger the bug
const z = [-10, -50, -100, -150, -10, -50, -100, -150];
Plotly.newPlot('div1', [{
type: 'histogram2dcontour',
x: x,
y: y,
z: z,
histfunc: 'avg', // or 'min' or 'max'
contours: {
coloring: 'fill',
showlabels: true,
},
}],
{
title: {
text: 'histogram2d contour plot: wrong fill colors!',
subtitle: {
text: 'Compare contour labels on plot to colorscale'
}
}
});
Screenshot:
Expected behavior
Contour fills should match fill colors indicated by colorscale
- Linguagem predominante
- JavaScript
- Estrelas
- 18.3k
- Forks
- 2k
- Merge médio
- 2d 12h
- PRs com merge (30d)
- 28
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.js
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
chore P1 plotly-internal size: 1 task
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
-
chore P3 plotly-internal size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
bug infrastructure P2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
Todas as issues de plotly/plotly.js
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
bevyengine/bevy-website#2595 ·