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

Function sample

examples/transform.rs:30–37  ·  view source on GitHub ↗
(count: usize, mut f: impl FnMut(f64) -> [f64; 2])

Source from the content-addressed store, hash-verified

28}
29
30fn sample(count: usize, mut f: impl FnMut(f64) -> [f64; 2]) -> Vec<[f64; 2]> {
31 (0..count)
32 .map(|i| {
33 let t = i as f64 / (count.saturating_sub(1).max(1)) as f64;
34 f(t)
35 })
36 .collect()
37}
38
39fn new() -> PlotWidget {
40 let identity = Series::line_only(

Callers 1

newFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected