Make donations and mint-flow charts readable #11

Closed
ye0man wants to merge 0 commits from feat/analytics-chart-clarity into fix/analytics-plotly-layout
Owner

Depends on #10 (stacked on fix/analytics-plotly-layout); review that first.

Problem

  • Donations over time only plotted the days that happened to receive a donation, so a single gift stretched into one full-width rectangle with no trend signal.
  • Sats flow between mints rendered both directions of every corridor (a -> b and b -> a). The resulting cycles made the Sankey a jumbled pile of crossing links and overlapping labels.

Fix

  • Donations: rebuild the full bucket axis for the selected range (mirroring the backend day/hour/week rule), render zero-filled bars, and overlay a cumulative sats line on a right-hand axis. Add a total/count meta line.
  • Flow: net a-b against b-a, keep the top 12 corridors by net value, order nodes by throughput, colour senders vs receivers, and report the sats folded into smaller corridors.

Verification

  • Headless browser against the live API: 30d shows 31 daily buckets and a cumulative line; 90d shows 91 buckets with the running total matching the Donations KPI; a single donation renders as a narrow bar. Flow drops from 27 raw links to 12 net corridors (8 nodes) with zero reversed duplicates.
  • 24h, 90d, 30d and reset all re-render correctly.
  • Frontend-only change; cargo fmt --check is clean.
Depends on #10 (stacked on `fix/analytics-plotly-layout`); review that first. ## Problem - **Donations over time** only plotted the days that happened to receive a donation, so a single gift stretched into one full-width rectangle with no trend signal. - **Sats flow between mints** rendered both directions of every corridor (`a -> b` and `b -> a`). The resulting cycles made the Sankey a jumbled pile of crossing links and overlapping labels. ## Fix - Donations: rebuild the full bucket axis for the selected range (mirroring the backend day/hour/week rule), render zero-filled bars, and overlay a cumulative sats line on a right-hand axis. Add a total/count meta line. - Flow: net `a-b` against `b-a`, keep the top 12 corridors by net value, order nodes by throughput, colour senders vs receivers, and report the sats folded into smaller corridors. ## Verification - Headless browser against the live API: 30d shows 31 daily buckets and a cumulative line; 90d shows 91 buckets with the running total matching the Donations KPI; a single donation renders as a narrow bar. Flow drops from 27 raw links to 12 net corridors (8 nodes) with zero reversed duplicates. - 24h, 90d, 30d and reset all re-render correctly. - Frontend-only change; `cargo fmt --check` is clean.
Make donations and mint-flow charts readable
All checks were successful
Validate auditor / check (pull_request) Successful in 10m2s
5abf4f0f89
Donations over time only plotted the days that had donations, so a single gift stretched into one full-width bar. Rebuild the selected range's bucket axis (mirroring the backend day/hour/week rule), render zero-filled bars, and add a cumulative sats line with a right-hand axis plus a total/count meta.

Sats flow rendered both directions of every corridor, and the resulting cycles made the Sankey a jumbled pile. Net a-b against b-a, keep the top 12 corridors by net value (reporting the sats folded into smaller corridors), order nodes by throughput, and colour senders vs receivers.
asmo closed this pull request 2026-09-14 06:10:47 +00:00
All checks were successful
Validate auditor / check (pull_request) Successful in 10m2s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/auditor!11
No description provided.