plotly / plotly/plotly.py

Hover tooltip works incorrectly in scatter WebGL

Đang mở
#3,516 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P3
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ả

In the code example below (using the scattergl) when the cursor is rolled over the bubble, the hover tooltip does not appear until the cursor is close to the center of the bubble. The tooltip itself also points to the center of the bubble.

This is different from the expected behavior observed with the regular scatter where the tooltip appears in relation to the boundary of the bubble, rather than its center. And the tooltip points to the boundary as well.

For the Plotly Express px.scatter, one needs to set render_mode='svg' to switch out of WebGL for the correct behaviour.

This results in an incorrect tooltip in WebGL appearing when the cursor is over the larger bubble in an example such as this one:

bubble

import pandas as pd
import plotly.graph_objects as go

df = pd.DataFrame({'x': [1], 'y': [1],'z': [100]})

fig = go.Figure()

fig.add_scattergl(
    x=df['x'],
    y=df['y'],
    marker_size=df['z'],
    mode='markers',
    marker_sizeref=0.01,
    marker_sizemode='area',
    showlegend=True,
    hovertemplate=(
        'x: %{x:.2f}<br>'
        'y: %{y:.2f}<br>'
        '<extra></extra>'
    ),
)

fig.show()

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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 chạy ví dụ Python được cung cấp với go.Figure.add_scattergl và so sánh hành vi hover của nó với scatter thông thường. Truy theo cách xử lý hover của WebGL từ điểm vào scattergl, sử dụng hành vi tooltip dựa trên biên như mong đợi và phép so sánh với render_mode='svg' làm tham chiếu. Hoàn thành khi các bong bóng lớn phản hồi trên toàn bộ vùng hiển thị của chúng và tooltip trỏ đến biên.

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, frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.