Return the hovered point (item, index, value) in PlotResponse

Đang mở
#276 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.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
data-visualization

Hướng nghiên cứu

Start by reading PlotResponse::hovered_plot_item and the existing PlotItem::find_closest → ClosestElem flow that supplies the hover label and cursor. The proposal is to expose the closest item's ID, point index, and value using that same search and radius; done when applications can read that hovered point from PlotResponse without repeating the series search.

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

Mô tả

PlotResponse::hovered_plot_item tells which item is hovered, but not which point of it. egui_plot already finds the element closest to the pointer (PlotItem::find_closest → ClosestElem) to draw the hover label and cursor, yet that result is not returned.

Proposal: add the closest element to PlotResponse, e.g. hovered_point: Option<HoveredPoint { item: ItemId, index: usize, value: PlotPoint }>, using the same search and radius as the label. Applications that show the hovered value elsewhere (a status line, a linked view, a tooltip of their own) would not have to repeat the search over all series.

Happy to open a small PR if this is welcome.

Ngôn ngữ chính
Rust
Star
494
Fork
110
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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.

Issue khác của emilk/egui_plot

Tất cả issue của emilk/egui_plot

Issue tương tự

Thêm issue về Rust

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.