[BUG]: `shape.pattern` for bar trace causes color and pattern to be applied to wrong traces in unified hover tooltip
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 18.3k
- Forks
- 2k
- Merge moyen
- 2 j 12 h
- PR mergées (30 j)
- 28
Description
Description
When shape.pattern is provided as an array to a bar trace, the first bar's pattern (and color!) are incorrectly applied to both bars in the hovermode: 'x unified' hover tooltip.
Expected: Swatch in hover tooltip should match color and pattern of bar which is being hovered over.
Actual: Swatch in hover tooltip matches color and pattern of first bar in trace, even when hovering over the second bar.
When shape.pattern is not provided, each hover tooltip correctly shows the color of the bar that's being hovered over.
Screenshots/Video
Steps to reproduce
Codepen: https://codepen.io/emilykl-code/pen/azJvXPy
Code:
var fig = {
"data": [
{
"marker": {
"color": ["red", "purple"],
"pattern": {"shape": ["/", ""]}
},
"textposition": "outside",
"x": ["A", "B"],
"y": [1, 2],
"type": "bar"
}
],
"layout": {
"hovermode": "x unified",
"title": {
"text": "Hover over 'B' to see wrong color and pattern"
}}
};
Plotly.newPlot("div1", fig.data, fig.layout);
Notes
First reported in plotly.py by https://github.com/plotly/plotly.py/issues/4882
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la reproduction dans CodePen et la configuration de Plotly.newPlot utilisant hovermode: 'x unified', marker.color et marker.pattern. Suivez la manière dont l’infobulle de survol unifiée choisit l’échantillon de couleur de chaque barre, puis vérifiez que le survol de A et de B affiche la couleur et le motif correspondants pour chaque barre.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- data-visualization, frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 70/100