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

Function monotonic_increasing_x

src/plot_state.rs:1005–1018  ·  view source on GitHub ↗

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]>)

Source from the content-addressed store, hash-verified

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
1016fn 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

Calls

no outgoing calls

Tested by

no test coverage detected