From cee44556511b9adcfa0895ba2bad42eb6288b1a5 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Mon, 13 Jul 2026 20:52:48 +0000 Subject: [PATCH] Make the food chart y-axis much finer The grams axis now targets ~10 segments instead of ~4, so a 240 g day gets 25 g gridlines; steps stay round numbers at any scale. --- src/app.js | 5 +++-- src/changelog.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 15d0e75..2793525 100644 --- a/src/app.js +++ b/src/app.js @@ -873,9 +873,10 @@ // Grams axis: 0-based with a "nice" step so tick labels stay round whatever // the daily totals are (tens of grams for a tiny puppy, hundreds+ later). + // Aims for ~10 segments so day-to-day differences of a few grams show. function niceAxisGrams(rawMax) { - if (!(rawMax > 0)) return { yMax: 100, steps: 2 }; - const rawStep = rawMax / 4; + if (!(rawMax > 0)) return { yMax: 100, steps: 4 }; + const rawStep = rawMax / 10; const mag = Math.pow(10, Math.floor(Math.log10(rawStep))); const norm = rawStep / mag; const step = (norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 2.5 ? 2.5 : norm <= 5 ? 5 : 10) * mag; diff --git a/src/changelog.json b/src/changelog.json index 571bcce..f13952a 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,5 @@ [ + { "date": "2026-07-13", "text": "Much finer y-axis on the food chart" }, { "date": "2026-07-13", "text": "The awake/asleep timer is bigger and sits first in the top bar" }, { "date": "2026-07-13", "text": "The sleep, daily counts and food charts now cover the last 14 days instead of 7" }, { "date": "2026-07-13", "text": "The awake/asleep timer lives in the frozen top bar" },