Skip to content

Add cumulative profitability charts (chips + dollars) - #13

Merged
grenkoff merged 1 commit into
mainfrom
feature/profitability-timeline-charts
Jun 16, 2026
Merged

grenkoff merged 1 commit into
mainfrom
feature/profitability-timeline-charts

Conversation

@grenkoff

Copy link
Copy Markdown
Owner

Summary

Adds two cumulative "winnings graph" charts to the dashboard (PokerTracker/HM style):

  • chips — running sum of per-hand hero result over hands played (time-ordered);
  • dollars — running sum of per-tournament net (hero_prize − buy_in) over tournaments.

Real-money P&L resolves per tournament. The parser already extracts hero's prize from summary
finishes; this persists it in a new tournaments.hero_prize column (the table previously had no
column for it) and derives the dollar timeline from it.

Changes

  • Migration 0003_tournament_hero_prize.sql; hero_prize threaded through TABLE_COLUMNS, parser
    mapping, and the Tournament model (computed from finishes[].prize where name == "Hero").
  • overview() gains chips_timeline / dollars_timeline (running cumulative, downsampled to
    <=1500 points); new TimelinePoint model.
  • New CumulativeResult area chart, formatUsd, two dashboard cards.

Verification

  • uv run pytest (36 passed), ruff + mypy clean; frontend typecheck + lint clean.
  • Backfilled the dev user's 10,697 existing tournaments (hero_prize), verified the $ timeline
    resolves to a real net (+$180.84) instead of -sum(buy_in).

@grenkoff
grenkoff merged commit 29eefd2 into main Jun 16, 2026
3 checks passed
@grenkoff
grenkoff deleted the feature/profitability-timeline-charts branch June 16, 2026 23:04
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