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

Function find_segment_covering_x

src/plot_state.rs:1020–1035  ·  view source on GitHub ↗
(points: &[[f64; 2]], x: f64)

Source from the content-addressed store, hash-verified

1018 data_min: Option<DVec2>,
1019 data_max: Option<DVec2>,
1020) -> Option<(f64, f64)> {
1021 if let Some((min, max)) = widget.y_lim
1022 && let (Some(min), Some(max)) = (
1023 widget.y_axis_scale.data_to_plot(min),
1024 widget.y_axis_scale.data_to_plot(max),
1025 )
1026 {
1027 return (min < max).then_some((min, max));
1028 }
1029 match (data_min, data_max) {
1030 (Some(min), Some(max)) if min.y < max.y => Some((min.y, max.y)),
1031 _ => None,
1032 }
1033}
1034
1035fn transformed_series_points(
1036 series: &crate::Series,
1037 x_axis_scale: AxisScale,
1038 y_axis_scale: AxisScale,

Calls

no outgoing calls

Tested by

no test coverage detected