Repository navigation
feat(site): index lines and show/hide toggles on the track chart - #68
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Why
The track page's cumulative-return chart compared the book against SPY only. Wanted 費半 and 那指 beside it, and a way to hide curves so one volatile line does not flatten the rest.
Task (verbatim): none — untracked work
What changed
track.track()takesindexes(default none) and adds one cumulative line per index present in the close panel, plus anindexeslist intrack.json;kuroshio book --providerpasses^SOXand^IXICforus*markets and fetches them with the book's names.track.jsonwritten before this change has noindexesand still renders the original four lines.Not changed: the book, sleeve and benchmark maths; the TW market (no index lines).
Verification
Gate: ruff 0 errors · pytest 510/510 · 9a37b85
Red-first: test_index_lines_are_tracked_and_each_legend_entry_is_a_toggle written with the feature, not watched red separately
Live: not run — the real provider fetch of ^SOX/^IXIC was not exercised; the toggle was driven in a browser on a synthetic series (hide, rescale, range text)
Not verified: that yfinance returns clean
^SOX/^IXICcloses on the cron box; untiltrack.jsonis regenerated the live page shows no new linesProblems found
none
Follow-ups
none
Reviewer notes
Start here:
_track_chartandTRACK_JSinkuroshio/site/render.pyReproduce:
pytest tests/test_track.py -q🤖 Generated with Claude Code