Clear all hover points from the plot.
(&mut self)
| 493 | nearest_point |
| 494 | } |
| 495 | |
| 496 | /// Find the nearest point to a given y-coordinate in the plot. |
| 497 | pub fn nearest_point_vertical(&self, series_id: ShapeId, y: f64) -> Option<PointId> { |
| 498 | let series = self.series.get(&series_id)?; |
| 499 | let mut min_distance = f64::INFINITY; |
| 500 | let mut nearest_point = None; |
| 501 | for (i, position) in series.positions.iter().enumerate() { |
| 502 | let distance = (position[1] - y).abs(); |