- {/* Hover reads out in the caption below rather than in a tooltip per
- day: a month is thirty-one triggers, and a floating card that covers
- its neighbours is the wrong shape for asking "what was that bar".
+
+ {/* The reading appears over the bar the pointer is on, not in the
+ caption below. Put anywhere else it is a change in the middle of a
+ chart, which is exactly where a reader looking at one bar does not
+ look — they hover, the number moves somewhere in their periphery, and
+ they never learn it was there.
+
+ One positioned element rather than a tooltip per day: a month is
+ thirty-one triggers, and thirty-one floating cards is both heavy and
+ the wrong shape. It sits ABOVE the bars so it never covers the
+ neighbours being compared against.
The strip carries its own description rather than making each day
focusable. Thirty-one tab stops per strip, three strips to a section,
@@ -307,11 +314,30 @@ function DayStrip({
the shape is — and the per-day figure is an enhancement over content
the header and caption already state. */}
setHovered(null)}
>
+ {hoveredDay && hovered != null ? (
+
+ {dayTitle(metric, hoveredDay)}
+
+ ) : null}
{days.map((day, index) => (
{period ? formatDate(period.from) : null}
-
- {hoveredDay
- ? dayTitle(metric, hoveredDay)
- : constantDenominator != null
- ? `measured against ${constantDenominator} per day`
- : silent > 0
- ? `${silent} ${silent === 1 ? "day" : "days"} with no reading`
- : null}
+
+ {constantDenominator != null
+ ? `measured against ${constantDenominator} per day`
+ : silent > 0
+ ? `${silent} ${silent === 1 ? "day" : "days"} with no reading`
+ : null}
{period ? formatDate(period.to) : null}