remove graph smoothing behavior, add null playerCount support

This commit is contained in:
Nick Krecklow
2020-05-11 03:10:23 -05:00
parent 19190f8d79
commit ef0c41ee1d
5 changed files with 89 additions and 51 deletions

View File

@ -38,6 +38,10 @@ export class RelativeScale {
}
}
if (max === Number.MAX_VALUE) {
max = 0
}
return RelativeScale.scale([0, max], tickCount)
}
@ -57,14 +61,23 @@ export class RelativeScale {
let max = Number.MIN_VALUE
for (const point of data) {
if (point > max) {
max = point
}
if (point < min) {
min = point
if (typeof point === 'number') {
if (point > max) {
max = point
}
if (point < min) {
min = point
}
}
}
if (min === Number.MAX_VALUE) {
min = 0
}
if (max === Number.MIN_VALUE) {
max = 0
}
return [min, max]
}
}