plotly / plotly/plotly.js

[FEATURE]: Freeze hovertext on click

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

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

feature
Ngôn ngữ chính
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

Description

I would like to freeze the location of my hovertext with a click callback. Once frozen, the hovertext would no longer follow the cursor, but instead be frozen in place. Another click would release the hovertext, so that it follows the cursor again. I feel like this should be possible by temporarily disabling the internal plotly callback that moves the hovertext with the cursor.

Why should this feature be added?

There are two ways for moving the hovertext. You can move it with the cursor or you can move it programmatically with Plotly.Fx.hover. If you are moving the hovertext programmatically, it is helpful to 'turn off' the cursor interaction, otherwise the user may inadvertently move the hovertext when they move the cursor. In my project, the user is trying to find an 'optimal' location in the heatmap. I think it would be useful if they could make an initial placement of hovertext using the cursor, click to freeze it there, and then make subsequent 'tweeks' to the hovertext location using input fields elsewhere in the app.

Mocks/Designs

This prototype is built from the D3.js heatmap example and a global frozen variable as suggested on StackOverflow. Notice how the tooltip follows the cursor until the user clicks, whereupon the tooltip is frozen at the clicked location until the user clicks again and unfreezes the tooltip. I would be happy to neaten & share the code if that would be helpful.

Image

Notes
  • Similar to #7578 but slightly simpler, since I am not seeking to make comparisons between different parts of the same plot.
  • Similar to #998 in the sense that I want to persist the hovertext on click.
  • There is a workaround for temporarily disabling all mouse interactions on StackOverflow.

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 lần theo Plotly.Fx.hover và callback nội bộ di chuyển hovertext theo con trỏ. Xem xét các issue liên quan #7578 và #998 cùng với prototype D3.js được liên kết. Công việc được coi là hoàn tất khi một lần nhấp cố định vị trí hovertext hiện tại, lần nhấp thứ hai khôi phục chuyển động của con trỏ và hover theo chương trình vẫn có thể sử dụng được.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
data-visualization
Loại issue
Tính năng
Độ 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
35/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.