Keep only strictly increasing-x points in their original order. This avoids sorting and lets fill interpolation run in linear time. Out-of-order (or duplicate-x) points are skipped.
(points: Vec<[f64; 2]>)
| 1003 | && let (Some(min), Some(max)) = ( |
| 1004 | widget.x_axis_scale.data_to_plot(min), |
| 1005 | widget.x_axis_scale.data_to_plot(max), |
| 1006 | ) |
| 1007 | { |
| 1008 | return (min < max).then_some((min, max)); |
| 1009 | } |
| 1010 | match (data_min, data_max) { |
| 1011 | (Some(min), Some(max)) if min.x < max.x => Some((min.x, max.x)), |
| 1012 | _ => None, |
| 1013 | } |
| 1014 | } |
| 1015 | |
| 1016 | fn plot_y_domain( |
| 1017 | widget: &PlotWidget, |
| 1018 | data_min: Option<DVec2>, |
| 1019 | data_max: Option<DVec2>, |
| 1020 | ) -> Option<(f64, f64)> { |
| 1021 | if let Some((min, max)) = widget.y_lim |
no outgoing calls
no test coverage detected