diff --git a/src/plot.rs b/src/plot.rs
index e6072ed..70a13b6 100644
--- a/src/plot.rs
+++ b/src/plot.rs
@@ -43,6 +43,10 @@ impl Ring {
pub fn samples(&self) -> impl Iterator<Item = f64> + '_ {
(0..self.len).map(move |i| self.data[(self.start + i) % RING_CAP])
}
+
+ pub fn max(&self) -> f64 {
+ self.samples().fold(f64::MIN, f64::max)
+ }
}
fn levels(samples: &[f64], max: f64, rows: usize) -> Vec<usize> {
diff --git a/src/ui.rs b/src/ui.rs
index 21e454a..4a943a5 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -163,7 +163,7 @@ impl App {
})
.collect();
self.cores
- .sort_by_key(|c| (c.e_core, c.label.clone()));
+ .sort_by_key(|c| (c.e_core, c.label[5..].parse::<u64>().unwrap_or(u64::MAX)));
}
// Watts = energy delta over the tick (poll cadence IS the sample
@@ -381,7 +381,7 @@ pub fn draw(f: &mut Frame, app: &App) {
(w, 1)
};
let sections = [
- ("P-cores", p, cores_area),
+ ("P-cores", p, Rect { width: col_w, ..cores_area }),
("E-cores", e, Rect { x: area.x + col_w, width: w - col_w, ..cores_area }),
];
for (i, (title, cores, rect)) in sections.into_iter().enumerate() {
@@ -410,11 +410,20 @@ pub fn draw(f: &mut Frame, app: &App) {
if app.cfg.graphs && w >= GRAPHS_MIN_WIDTH {
let thirds = w / 3;
let mut x = area.x;
+ // Graphs scale to the RING's own window (recent history), not the
+ // session all-time peak — a flat idle line pinned to the bottom of
+ // a 1.5 V scale reads as broken. Hero bar keeps all-time scale.
+ let ring_max = |ring: &Ring, floor: f64| -> f64 {
+ (ring.max() * (1.0 + SCALE_MARGIN)).max(floor)
+ };
+ let vc_graph_max = ring_max(&app.vcore_graph, 1.0);
+ let watt_graph_max = ring_max(&app.watts_graph, 10.0);
for (i, (label, text, ring, max, color, marker)) in [
- ("vCore", hero_text.clone(), &app.vcore_graph, vc_max, vc_color,
- Some(((app.cfg.vcore_limit / vc_max).clamp(0.0, 1.0) * GRAPH_ROWS as f64).round() as u16)),
- ("Pkg power", fmt_opt_watts(app.package_watts), &app.watts_graph, watt_max, Color::Blue, None),
- ("Pkg temp", fmt_opt_temp(app.package_temp), &app.temp_graph, TEMP_BAR_MAX,
+ ("vCore", hero_text.clone(), &app.vcore_graph, vc_graph_max, vc_color,
+ Some(((1.0 - (app.cfg.vcore_limit / vc_graph_max).clamp(0.0, 1.0)) * (GRAPH_ROWS - 1) as f64).round() as u16)),
+ ("Pkg power", fmt_opt_watts(app.package_watts), &app.watts_graph, watt_graph_max, Color::Blue, None),
+ ("Pkg temp", fmt_opt_temp(app.package_temp), &app.temp_graph,
+ ring_max(&app.temp_graph, 0.0).max(50.0),
app.package_temp.map_or(Color::DarkGray, |t| temp_color(t, app.cfg.temp_warn, app.cfg.temp_crit)), None),
].into_iter().enumerate() {
let span_w = if i == 2 { w - thirds * 2 } else { thirds };
UAT fixes: numeric core sort, P column width clipped, graphs scale to ring window w/ floors, marker row math corrected (row0=top)
00b0cd7e85ba9b471a232d5f32591431125ba948
josie <administrator@josie-c.com> · 2026-08-30T13:11 ·
browse files at this commit
parents:
f11482a