Skip to content

Commit 2193455

Browse files
committed
Show observed peaks in dashboard chart labels
Label each chart with the maximum value in its displayed series while retaining 15% plotting headroom and the minimum vertical scale. The shared renderer applies this to the serving and Orbit dashboards, including zero and sub-unit peaks. Validation: all 5 dashboard tests passed; Flare release build and Heliopause installation passed. The live dashboard has not been restarted. Design-Signed-Off-By: Codex (GPT-6); design-review=6aeb
1 parent 01a4e4d commit 2193455

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎helios/src/server/dashboard.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ fn render_overview(frame: &mut Frame, history: &History, area: Rect) {
610610
pub type Series = (&'static str, Color, fn(Rates) -> f64);
611611

612612
/// Draws `series` from the history's rate points as Braille lines over the last
613-
/// 120 seconds in a rounded block titled `title`, scaled to 115% of the peak.
613+
/// 120 seconds in a rounded block titled `title`, with 15% headroom.
614+
/// The upper label shows the observed maximum across the series.
614615
pub fn plot(frame: &mut Frame, area: Rect, title: &str, history: &History, series: &[Series]) {
615616
let now = history.points.back().map_or(0.0, |(time, _)| *time);
616617
let points: Vec<Vec<_>> = series
@@ -627,8 +628,7 @@ pub fn plot(frame: &mut Frame, area: Rect, title: &str, history: &History, serie
627628
.iter()
628629
.flatten()
629630
.map(|(_, value)| *value)
630-
.fold(1.0, f64::max)
631-
* 1.15;
631+
.fold(0.0, f64::max);
632632
let datasets = series
633633
.iter()
634634
.zip(&points)
@@ -663,8 +663,8 @@ pub fn plot(frame: &mut Frame, area: Rect, title: &str, history: &History, serie
663663
)
664664
.y_axis(
665665
Axis::default()
666-
.bounds([0.0, peak])
667-
.labels(["0".to_owned(), rate(peak)])
666+
.bounds([0.0, peak.max(1.0) * 1.15])
667+
.labels(["0".to_owned(), format!("max {}", rate(peak))])
668668
.style(Style::default().fg(MUTED)),
669669
),
670670
area,

0 commit comments

Comments
 (0)