Files
HealthLog/src/components
Marc-André Bombeck 1332342c59 feat(charts): weight chart accepts vertical injection-day markers
Adds an optional `verticalMarkers` prop to `<HealthChart>` so the
v1.4.25 GLP-1 dashboard tile + the Insights /medikamente sub-page can
paint dashed vertical reference lines at each recorded injection day.
Each marker = `{ date: 'YYYY-MM-DD', label?, color? }`. Defaults to
the strip-tile green (`#50fa7b`) so a row of markers reads as
"injection cadence" at a glance; callers can override per marker.

Rendering:
  - Recharts `<ReferenceLine>` with `strokeDasharray='3 3'`,
    `strokeOpacity=0.55`, no label by default (inline labels would
    crowd a once-weekly cadence over a 90-day window).
  - A small filled `<ReferenceDot>` (r=3) at the y-axis minimum so
    the markers also read along the x-axis baseline.
  - Off-window markers silently drop via `ifOverflow='discard'`,
    matching the existing storyboard-annotation contract.

The marker math is factored into a pure helper
`resolveVerticalMarkerPositions` so the unit suite can pin behaviour
without mounting Recharts. Day-keys are matched by EXACT string
comparison against `chartData[i].date` (no ±7-day snap like the
storyboard annotations) — drawing a marker on a day the chart has no
data point reads as a rendering bug rather than as orientation.

Tests pin: empty input, undefined input, single in-window match,
multi-marker order, caller-supplied color/label overrides, off-window
drop, sparse weekly-bucket exact-day matching.
2026-05-14 13:31:41 +02:00
..
2026-05-12 22:33:35 +02:00
2026-03-10 20:14:33 +01:00