feat(web): long-range trend chart (min/max band + average) - #45
Merged
Conversation
…m page Add a long-range chart backed by the hourly trend rollups: a min/max band with the average line, so an item's long-term shape stays visible after raw samples are pruned by retention. Sits alongside the raw-history chart on the item page. - charts.py: a pure `band_chart` helper → SVG geometry (avg polyline + a band polygon from the max edge then the min edge), with axis ticks; flat/too-few-points handled. - Item page renders it from up to ~30 days of trends (numeric items only). Tests: band geometry (line + band point counts, value range) and the item-page render. Full suite 221 passed; ruff + mypy(strict) green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Phase 4 follow-up — long-range charts backed by trends (the trends from #28 finally
get a long-term visual consumer).
Changes
band_chart(pure, unit-tested): SVG geometry for an average polyline + a min/maxband polygon, with axis ticks.
alongside the existing raw-history chart. Long-term shape survives raw-sample retention.
Tests
Band geometry + the item-page render. Full suite 221 passed; ruff + mypy(strict)
green. Screenshot in the README.