mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: made log scale graph have a better dynamic range (#2090)
* fixup * Apply suggestions from code review Signed-off-by: Cornelius Roemer <cornelius.roemer@gmail.com> --------- Signed-off-by: Cornelius Roemer <cornelius.roemer@gmail.com>
This commit is contained in:
@@ -45,11 +45,12 @@ internal func scaleValue(scale: Scale = .linear, value: Double, maxValue: Double
|
||||
localMaxValue = cbrt(maxValue)
|
||||
}
|
||||
case .logarithmic:
|
||||
let zeroVal = 256.0
|
||||
if value > 0 {
|
||||
value = log(value*100)
|
||||
value = log(value/zeroVal)
|
||||
}
|
||||
if localMaxValue > 0 {
|
||||
localMaxValue = log(maxValue*100)
|
||||
localMaxValue = log(maxValue/zeroVal)
|
||||
}
|
||||
case .fixed:
|
||||
if value > limit {
|
||||
|
||||
Reference in New Issue
Block a user