Skip to content

feat(site): draw the track chart with axes, gridlines and a hover readout - #70

Merged
HaoweiChan merged 1 commit into
mainfrom
claude/track-chart-pro
Oct 20, 2026
Merged

HaoweiChan merged 1 commit into
mainfrom
claude/track-chart-pro

Conversation

@HaoweiChan

Copy link
Copy Markdown
Owner

Why

The track page's cumulative-return chart had no value axis, no gridlines and oversized labels, so it read as a sketch: the reader could not tell what a line's height meant or what any day's values were.

Task (verbatim): none — untracked work

What changed

  • The chart is drawn in the browser from the series embedded on its container (trackDraw in TRACK_JS) at the container's real width, so type stays 11px at any size and redraws on resize.
  • Y axis with percent ticks and hairline gridlines, a stronger zero line, date ticks every 1–2 weeks, an end-point dot per line, thinner reference lines (dashed) against a heavier book line.
  • Hover (or touch-drag) shows a crosshair, a dot on every visible line and a tooltip with that day's values, ranked.
  • Legend toggles from PR 68 still hide a line and now rescale the axis through the same draw; the "range" caption is gone because the axis shows it.
    Not changed: the series data, the stats row, the legend values.

Verification

Gate: ruff 0 errors in the committed tree · pytest 511/511 · f1c5c48
Red-first: test_chart_carries_its_series_and_labels_the_actual_benchmark written with the change, not watched red separately
Live: not run — drawn and driven (hover, toggle, 375px width) in a browser against the real latest track.json; the deployed site is not yet rebuilt
Not verified: older browsers without ResizeObserver or pointer events

Problems found

none

Follow-ups

none

Reviewer notes

Start here: TRACK_JS and _track_chart in kuroshio/site/render.py
Reproduce: pytest tests/test_track.py -q

🤖 Generated with Claude Code

…dout

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@HaoweiChan
HaoweiChan merged commit eae0f8b into main Oct 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant