enable multiple hover boxes for overlapping/multiple points
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 18.8k
- Fork
- 2.8k
- Merge trung bình
- 16 giờ 26 phút
- Pull request đã merge (30 ngày)
- 21
Mô tả
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:

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

Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện hành vi của các điểm chồng lấp bằng dataset iris được cung cấp và ví dụ px.scatter, sau đó so sánh với kết quả của hvPlot. Theo dõi cách fig.show() kết xuất thông tin hover cho các điểm trùng nhau hoặc chồng lấp, và xác định ranh giới của thành phần Plotly liên quan. Được xem là hoàn tất khi tất cả các điểm dưới con trỏ nhận được thông tin hover có thể phân biệt, với phạm vi kiểm thử hồi quy cho cả các trường hợp chồng lấp chính xác và chồng lấp gần nhau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 28/100