Skip to content

Position History: outcome donut with click-to-filter#44

Merged
heyitsStylez merged 3 commits intomainfrom
history-outcome-donut
May 6, 2026
Merged

Position History: outcome donut with click-to-filter#44
heyitsStylez merged 3 commits intomainfrom
history-outcome-donut

Conversation

@heyitsStylez
Copy link
Copy Markdown
Owner

Closes #37.

Summary

  • New pure helper outcomeDistribution(trades, assetFilter) in src/js/05c-outcome-distribution.js (dual-exported, EXPIRED/ASSIGNED/CALLED/CLOSED order, CLOSED nets closeCost)
  • New renderer rHistDonut() in src/js/06a-render-donut.js — at ≥10 settled trades the donut replaces the outcome pills; each slice toggles setHistOutcome (clicking the active slice clears the filter)
  • Donut respects the active asset-filter chips, ignores the From/To date pickers, uses CSS variables only

Test plan

  • npm test — 8 new unit tests + 5 new integration tests (72 total, all green)
  • python3 build.py --check passes
  • Visual mock pre-approved by maintainer before implementation
  • Smoke-test in browser: load >10 settled trades, click slice, click again to clear, switch asset chip, drop below threshold to confirm pills return

🤖 Generated with Claude Code

Replaces the outcome pills with an SVG donut chart at >= 10 settled
trades. Each slice toggles the existing setHistOutcome filter.

- New pure helper outcomeDistribution(trades, assetFilter) with
  EXPIRED/ASSIGNED/CALLED/CLOSED ordering and CLOSED closeCost netting
- Donut respects asset-filter chips, ignores From/To date pickers
- CSS-variable colours only (EXPIRED/ASSIGNED/CALLED/CLOSED)
- Clicking the active slice clears the filter (idempotent toggle)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperwheel Ready Ready Preview, Comment May 6, 2026 11:26pm

The donut felt too small and left-anchored on a wide row. The treemap
fills the full width, sizes cells by trade count, and shows outcome,
count, and premium inline without a tooltip. Click-to-filter behaviour
unchanged.

- Renamed module to 06a-render-outcome-chart.js (rOutcomeChart)
- Renamed wrapper id #hist-donut → #hist-outchart, classes follow suit
- Replaced donut CSS with treemap cell styles
- Updated integration tests to assert on .outchart-cell

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@heyitsStylez heyitsStylez merged commit 70691e8 into main May 6, 2026
2 checks passed
@heyitsStylez heyitsStylez deleted the history-outcome-donut branch May 6, 2026 23:30
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.

Position History: outcome donut with click-to-filter

1 participant