use NANs instead of zeros

This commit is contained in:
Simon Gardling 2022-02-16 12:07:23 -05:00
parent fcd7d985d6
commit 589ceb60a3

View File

@ -219,10 +219,10 @@ impl ChartManager {
if !y.is_nan() {
(x, x2, y)
} else {
(0.0, 0.0, 0.0)
(f32::NAN, f32::NAN, f32::NAN)
}
})
.filter(|ele| ele != &(0.0, 0.0, 0.0))
.filter(|ele| ele != &(f32::NAN, f32::NAN, f32::NAN))
.collect();
let area: f32 = data2.iter().map(|(_, _, y)| y * step).sum(); // sum of all rectangles' areas
(data2, area)