diff options
author | gennyble <gen@nyble.dev> | 2025-10-14 16:04:50 -0500 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-10-16 10:30:01 -0500 |
commit | 0515c34017706e43588644387b68a6bb08cc390c (patch) | |
tree | c3a15dfa40dd80c4edb3f85d49286013b994f245 | |
parent | 19b1df3315fd7d291d8188899274c6e51f3c337f (diff) | |
download | awake-0515c34017706e43588644387b68a6bb08cc390c.tar.gz awake-0515c34017706e43588644387b68a6bb08cc390c.zip |
scale graphs 1/3rd higher than max
-rw-r--r-- | src/gatherer.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gatherer.rs b/src/gatherer.rs index 329bc1e..9bfd63a 100644 --- a/src/gatherer.rs +++ b/src/gatherer.rs @@ -171,10 +171,12 @@ pub fn make_net_graph(state: &AwakeState) { mixed.sort(); let kinda_highest = mixed[511 - 32]; - let high_bound = (kinda_highest as f32 / NET_INCREMENTS as f32) + // We add one here so we have less "surface area" covered by the lines + // which makes the vertical divisions look btter + let high_bound = ((kinda_highest as f32 / NET_INCREMENTS as f32) .ceil() .max(1.0) as usize - * NET_INCREMENTS; + + 1) * NET_INCREMENTS; state .netinfo_upper_bound @@ -224,7 +226,9 @@ pub fn make_cpu_graph(state: &AwakeState) { ); // high_vound unit: hundreths of a second (1% / 1) - let high_bound = kinda_highest.max(1.0); + // scaling by 1.33 here to drive the line down to decrease the apparent + // "surface area" of the line + let high_bound = (kinda_highest * 1.33).max(1.0); state .cpuinfo_upper_bound .store(high_bound as usize, Ordering::Release); |