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

Ouverte
#276 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
66/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
rust

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Rust
Étoiles
494
Forks
110
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de emilk/egui_plot

Toutes les issues de emilk/egui_plot

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.