[BUG]: `shape.pattern` for bar trace causes color and pattern to be applied to wrong traces in unified hover tooltip
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der CodePen-Reproduktion und der Plotly.newPlot-Konfiguration mit hovermode: 'x unified', marker.color und marker.pattern. Verfolge, wie der vereinheitlichte Hover-Tooltip den Farbfeld jedes Balkens auswählt, und überprüfe anschließend, dass beim Überfahren von A und B die passende Farbe und das passende Muster für jeden Balken angezeigt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 70/100