Panics · P15 Charts: values within charts::LIMIT; scales, shares and tangents stay finite at the edges; entries past their lists are skipped
This commit is contained in:
1 parent
2ea16f4541
commit
defbec006e
23 files changed
+483
-95
No files matched your search
@@ -11,6 +11,7 @@ use super::{
|
||||
parts::ChartTooltip,
|
||||
scale::{Linear, compact, nice},
|
||||
schedule::{days, marks},
|
||||
series::drawable,
|
||||
tiles::{Tiles, tracked},
|
||||
};
|
||||
use crate::{
|
||||
@@ -62,7 +63,10 @@ impl BurndownChart {
|
||||
/// A sprint from its first day through its last, with `scope` to do, in points or issues.
|
||||
pub fn new(id: impl Into<ElementId>, first: Date, last: Date, scope: f64) -> Self {
|
||||
assert!(last > first, "a sprint ends after its first day");
|
||||
assert!(scope.is_finite() && scope > 0.0, "a sprint has work to do");
|
||||
assert!(
|
||||
drawable(scope) && scope > 0.0,
|
||||
"a sprint has work to do, within charts::LIMIT"
|
||||
);
|
||||
Self {
|
||||
base: div(),
|
||||
id: id.into(),
|
||||
@@ -85,8 +89,8 @@ impl BurndownChart {
|
||||
assert!(
|
||||
self.left
|
||||
.iter()
|
||||
.all(|value| value.is_finite() && *value >= 0.0),
|
||||
"work left is a count, zero or more"
|
||||
.all(|value| drawable(*value) && *value >= 0.0),
|
||||
"work left is a count, zero or more, within charts::LIMIT"
|
||||
);
|
||||
self
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user