plotly / plotly/plotly.py

enable multiple hover boxes for overlapping/multiple points

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

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

feature P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

This has been tested in version 4.7.1.

When hover information is shown for points e.g. in a scatter plot, the following situations can occur:

  • there are multiple points on exactly the same coordinates
  • there are multiple points close to the same coordinates and the markers used to visualize those points overlap in the graph

Hover information for all those multiple points should be shown, especially in cases where the hover information includes additional data not shown directly in the graph.

The hvPlot library does this correctly: it shows stacked hover boxes for all the data points under the cursor. Plotly only shows one hover box and it is not clear which one.

I think this is an actual bug since it makes it easy to miss data and the hover information does not represent the actual data in the graph.

Here is an example using the Iris data set and Plotly:

import plotly.express as px
from bokeh.sampledata import iris
df = iris.flowers.copy()
fig = px.scatter(df, x="sepal_length", y="sepal_width", color="species",
                 opacity=0.4, hover_data=["petal_length", "petal_width"]
                )
fig.show()

This shows:
plotly01

With hvPlot:

df.hvplot(kind="scatter", 
          x="sepal_length", y="sepal_width", by="species", 
          hover_cols=["petal_length", "petal_width"], 
          alpha=0.4)

Hvplot01

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

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

はじめの一歩

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

調査の方向性

まず、提供されている iris データセットと px.scatter の例を使って重なっている点の挙動を再現し、その後 hvPlot の結果と比較します。fig.show() が一致する点または重なっている点の hover 情報をどのようにレンダリングするかを追跡し、関連する Plotly コンポーネントの境界を特定します。カーソル下にあるすべての点が区別可能な hover 情報を受け取り、完全一致する重なりと近接した重なりの両方についてリグレッションテストのカバレッジがあることを完了条件とします。

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

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
28/100

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

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