Skip to content
SprecherEast
Issue 642

feat: Stacked columns: a project's cost by year and by funding source

Back to our plan
Open
enhancementfrontendvisualizationpriority: mediumshared-component

Problem

In plain words: a project like the Door Creek Park pavilion is paid for over several years from several sources (borrowing, impact fees, grants). One stacked column per year shows both the total and where it came from. Projects (#596) and posts both need it.

Summary of the owner's request (2026-11-02, Claude conversation, text): tie it to real construction, events and planning.

Today (checked 2026-11-03):

  • visx has the stacking. @visx/shape 4.0.0 has BarStack and BarStackHorizontal, and BarStackHorizontal rendered as a server component in the local test.
  • No data yet. The pavilion's funding mix isn't in an official document yet (#589, "Not found"), so fixtures use made-up numbers, marked as such.
  • Depends on sub-issues 1 and 2.

Proposed fix

  • The visx adapter gets stacked.
    • One column per year, and a segment per series in a fixed series order, with a stroke-background gap.
    • The total above each column. Segment values inside when they fit, otherwise in the legend row for that year.
    • A text legend, with patterns beyond 3 series.
  • The schema refuses a series whose values length differs from x, and a negative value.
  • The table: years as rows, sources as columns, plus a total column.
  • #596's project module builds the ChartSpec in its domain, from its stored money rows. platform/ never imports it.

Native first, one line per step:

  1. Native: none.
  2. Official plugins: none.
  3. Open source: @visx/shape BarStack, already added in sub-issue 1.
  4. Our code: the composition and the tests.

Acceptance criteria

  • Not done: A fixture of 3 years × 3 sources renders. The totals and the table match the input in a test.
  • Not done: The contract suite passes for stacked on both adapters. axe passes. Colour is never the only cue (labels and patterns).
  • Not done: At the six widths, light and dark, no overflow (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