plotly / plotly/plotly.js

[BUG]: `shape.pattern` for bar trace causes color and pattern to be applied to wrong traces in unified hover tooltip

オープン
#8,008 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug good for agent P3 size: 1
主要言語
JavaScript
スター
18.3k
フォーク
2k
平均マージ
2日 12時間
マージ済み PR(30日)
28

説明

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
Image
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

CodePen の再現と、hovermode: 'x unified'、marker.color、marker.pattern を使用する Plotly.newPlot の設定から始めます。統合されたホバーツールチップが各バーのスウォッチをどのように選択するかを追跡し、その後、A と B にホバーしたときに各バーに対応する色とパターンが表示されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
data-visualization, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
70/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。