Skip to content
SprecherEast
Issue 641

feat: Money-flow (Sankey) chart: from the tax bill to the bodies to what they fund

Back to our plan
Open
enhancementfrontendvisualizationpriority: mediumshared-component

Problem

In plain words: a neighbor wants to follow a dollar from their bill to the City, the schools, the County and Madison College, and on to what each funds. A flow diagram shows that in one picture. On a phone it must still be readable, and the same flow must be in a table.

Summary of the owner's request (2026-11-02, Claude conversation, text): he wants neighbors to see exactly how property tax money is spent and where it comes from.

Today (checked 2026-11-03):

  • visx has it. @visx/sankey 4.0.0 (MIT) renders as a server component in the local test. It wraps d3-sankey 0.12.3, last published 2019-09-02 (npm registry): a small, stable layout.
  • Depends on sub-issues 1 and 2.

Proposed fix

  • The visx adapter gets flow.
    • Nodes are rects with their label and amount as text, and links are paths with stroke-chart-N classes at reduced opacity, separated by a stroke-background gap.
    • On a phone (compact layout) the diagram runs top to bottom.
    • Beyond 12 links, the chart shows the largest 11 and "Other", and the table keeps all of them.
  • The schema refuses a link to an unknown node, a cycle, and a node whose outflow is more than its inflow (± 0.5).
  • The table shows from → to → amount, plus each node's total.
  • The block shows links when the kind is flow. The Markdown tag is <Chart kind="flow" nodes={[…]} links={[…]} />.
  • The text adapter lists the flow as nested text, so the contract passes.
  • Add @visx/sankey at exact 4.0.0.

Native first, one line per step:

  1. Native: none (no flow diagram in React, Next or Payload).
  2. Official plugins: none.
  3. Open source: @visx/sankey 4.0.0.
  4. Our code: the flow composition in the adapter, the schema rules and the tests.

Acceptance criteria

  • Not done: A flow for the December 2024 bill (4 bodies, from #591's table) renders, and its node totals match the table in a unit test.
  • Not done: The contract suite passes for flow on both adapters. axe passes.
  • Not done: At 320 px it is readable without sideways scrolling, light and dark (screenshots in the PR).

Area

frontend, visualization

Priority

medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab