MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / nearest_point

Method nearest_point

src/plot_widget.rs:431–446  ·  view source on GitHub ↗

Find the nearest point to a given position in the plot.

(&self, series_id: ShapeId, x: f64, y: f64)

Source from the content-addressed store, hash-verified

429 for (highlight_point, tooltip) in self
430 .hovered_points
431 .values_mut()
432 .chain(self.picked_points.values_mut())
433 {
434 if let Some(tooltip) = tooltip {
435 tooltip.screen_xy = Self::world_to_screen_position(
436 Self::tooltip_anchor_world(highlight_point),
437 camera_bounds,
438 self.x_axis_scale,
439 self.y_axis_scale,
440 &highlight_point.transform,
441 );
442 }
443 }
444 }
445 }
446
447 /// Get an iterator over the series ids in the plot.
448 pub fn series_ids(&self) -> Vec<ShapeId> {
449 self.series.keys().copied().collect()

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected