chompyy 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +252 -2
- package/THIRD_PARTY_NOTICES.md +59 -0
- package/dist/appstate.js +116 -0
- package/dist/away.js +314 -0
- package/dist/blueprint.js +91 -0
- package/dist/board.js +186 -0
- package/dist/claudesettings.js +23 -0
- package/dist/cli.js +861 -0
- package/dist/coldstart.js +207 -0
- package/dist/config.js +89 -0
- package/dist/costs.js +162 -0
- package/dist/duration.js +36 -0
- package/dist/gate.js +69 -0
- package/dist/history.js +308 -0
- package/dist/home.js +34 -0
- package/dist/livequota.js +92 -0
- package/dist/macapp.js +57 -0
- package/dist/pacing.js +189 -0
- package/dist/picture.js +117 -0
- package/dist/projects.js +114 -0
- package/dist/quota.js +153 -0
- package/dist/report.js +136 -0
- package/dist/review.js +173 -0
- package/dist/runner.js +357 -0
- package/dist/taste.js +507 -0
- package/dist/triggers.js +182 -0
- package/dist/vendor/codeburn/claude.js +255 -0
- package/dist/vendor/codeburn/security.js +260 -0
- package/dist/vendor/codeburn/types.js +1 -0
- package/dist/verify.js +131 -0
- package/dist/workspace.js +80 -0
- package/package.json +48 -4
- package/skills/away/SKILL.md +26 -0
- package/skills/eat-tokens/SKILL.md +18 -0
- package/skills/later/SKILL.md +20 -0
- package/skills/taste/SKILL.md +19 -0
- package/vendor/diagram-design/LICENSE +21 -0
- package/vendor/diagram-design/SKILL.md +399 -0
- package/vendor/diagram-design/UPSTREAM.md +18 -0
- package/vendor/diagram-design/assets/example-arc-diagram.html +111 -0
- package/vendor/diagram-design/assets/example-architecture-containment.html +205 -0
- package/vendor/diagram-design/assets/example-architecture-delta.html +193 -0
- package/vendor/diagram-design/assets/example-architecture.html +183 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-campus.html +108 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-coffee-shop.html +121 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-warehouse.html +127 -0
- package/vendor/diagram-design/assets/example-axonometric-plan.html +114 -0
- package/vendor/diagram-design/assets/example-bar.html +129 -0
- package/vendor/diagram-design/assets/example-beeswarm.html +384 -0
- package/vendor/diagram-design/assets/example-box-plot.html +127 -0
- package/vendor/diagram-design/assets/example-bubble.html +147 -0
- package/vendor/diagram-design/assets/example-bump.html +142 -0
- package/vendor/diagram-design/assets/example-data-flow.html +143 -0
- package/vendor/diagram-design/assets/example-datalake.html +269 -0
- package/vendor/diagram-design/assets/example-db-schema.html +302 -0
- package/vendor/diagram-design/assets/example-dependency.html +224 -0
- package/vendor/diagram-design/assets/example-deployment.html +190 -0
- package/vendor/diagram-design/assets/example-dp-integration.html +81 -0
- package/vendor/diagram-design/assets/example-dp-security-matrix.html +88 -0
- package/vendor/diagram-design/assets/example-er.html +202 -0
- package/vendor/diagram-design/assets/example-event-modeling.html +64 -0
- package/vendor/diagram-design/assets/example-exploded-ai-stack.html +85 -0
- package/vendor/diagram-design/assets/example-exploded-keyboard.html +84 -0
- package/vendor/diagram-design/assets/example-exploded-phone.html +83 -0
- package/vendor/diagram-design/assets/example-exploded-unboxing.html +84 -0
- package/vendor/diagram-design/assets/example-exploded.html +83 -0
- package/vendor/diagram-design/assets/example-fishbone.html +152 -0
- package/vendor/diagram-design/assets/example-flowchart.html +163 -0
- package/vendor/diagram-design/assets/example-gantt.html +137 -0
- package/vendor/diagram-design/assets/example-heatmap.html +224 -0
- package/vendor/diagram-design/assets/example-high-level-vertical.html +325 -0
- package/vendor/diagram-design/assets/example-high-level.html +301 -0
- package/vendor/diagram-design/assets/example-import-drawio.html +185 -0
- package/vendor/diagram-design/assets/example-import-excalidraw.html +70 -0
- package/vendor/diagram-design/assets/example-import-mermaid.html +70 -0
- package/vendor/diagram-design/assets/example-import-plantuml.html +107 -0
- package/vendor/diagram-design/assets/example-it-state.html +128 -0
- package/vendor/diagram-design/assets/example-journey.html +148 -0
- package/vendor/diagram-design/assets/example-kanban.html +174 -0
- package/vendor/diagram-design/assets/example-layers.html +123 -0
- package/vendor/diagram-design/assets/example-line.html +111 -0
- package/vendor/diagram-design/assets/example-loop.html +100 -0
- package/vendor/diagram-design/assets/example-marimekko.html +148 -0
- package/vendor/diagram-design/assets/example-medallion.html +159 -0
- package/vendor/diagram-design/assets/example-nested.html +136 -0
- package/vendor/diagram-design/assets/example-org-chart.html +45 -0
- package/vendor/diagram-design/assets/example-polar.html +116 -0
- package/vendor/diagram-design/assets/example-process.html +64 -0
- package/vendor/diagram-design/assets/example-pyramid.html +119 -0
- package/vendor/diagram-design/assets/example-quadrant-consultant.html +166 -0
- package/vendor/diagram-design/assets/example-quadrant.html +135 -0
- package/vendor/diagram-design/assets/example-radar.html +139 -0
- package/vendor/diagram-design/assets/example-requirement-traceability.html +122 -0
- package/vendor/diagram-design/assets/example-ridgeline.html +104 -0
- package/vendor/diagram-design/assets/example-sankey.html +150 -0
- package/vendor/diagram-design/assets/example-sbgn.html +213 -0
- package/vendor/diagram-design/assets/example-scatter.html +141 -0
- package/vendor/diagram-design/assets/example-sequence-oauth.html +227 -0
- package/vendor/diagram-design/assets/example-sequence.html +222 -0
- package/vendor/diagram-design/assets/example-service-blueprint.html +185 -0
- package/vendor/diagram-design/assets/example-slopegraph.html +119 -0
- package/vendor/diagram-design/assets/example-state-lifecycle.html +92 -0
- package/vendor/diagram-design/assets/example-state.html +147 -0
- package/vendor/diagram-design/assets/example-steps.html +78 -0
- package/vendor/diagram-design/assets/example-story-map.html +184 -0
- package/vendor/diagram-design/assets/example-streamgraph.html +99 -0
- package/vendor/diagram-design/assets/example-swimlane.html +172 -0
- package/vendor/diagram-design/assets/example-timeline.html +135 -0
- package/vendor/diagram-design/assets/example-tree-block-decomposition.html +151 -0
- package/vendor/diagram-design/assets/example-tree.html +173 -0
- package/vendor/diagram-design/assets/example-treemap.html +107 -0
- package/vendor/diagram-design/assets/example-uml-class.html +188 -0
- package/vendor/diagram-design/assets/example-unit-grid.html +141 -0
- package/vendor/diagram-design/assets/example-venn.html +110 -0
- package/vendor/diagram-design/assets/example-wardley.html +153 -0
- package/vendor/diagram-design/assets/example-waterfall.html +129 -0
- package/vendor/diagram-design/assets/template-dark.html +99 -0
- package/vendor/diagram-design/assets/template.html +100 -0
- package/vendor/diagram-design/references/layout-budget.md +103 -0
- package/vendor/diagram-design/references/output-spec.md +277 -0
- package/vendor/diagram-design/references/primitive-annotation.md +36 -0
- package/vendor/diagram-design/references/primitive-sketchy.md +43 -0
- package/vendor/diagram-design/references/primitives-core.md +146 -0
- package/vendor/diagram-design/references/semantic-patterns.md +154 -0
- package/vendor/diagram-design/references/style-guide.md +234 -0
- package/vendor/diagram-design/references/type-architecture-delta.md +143 -0
- package/vendor/diagram-design/references/type-architecture.md +117 -0
- package/vendor/diagram-design/references/type-axonometric-plan.md +83 -0
- package/vendor/diagram-design/references/type-bar.md +108 -0
- package/vendor/diagram-design/references/type-data-flow.md +371 -0
- package/vendor/diagram-design/references/type-db-schema.md +48 -0
- package/vendor/diagram-design/references/type-dependency.md +113 -0
- package/vendor/diagram-design/references/type-deployment.md +45 -0
- package/vendor/diagram-design/references/type-dp-integration.md +407 -0
- package/vendor/diagram-design/references/type-dp-security-matrix.md +379 -0
- package/vendor/diagram-design/references/type-er.md +25 -0
- package/vendor/diagram-design/references/type-event-modeling.md +36 -0
- package/vendor/diagram-design/references/type-exploded.md +115 -0
- package/vendor/diagram-design/references/type-fishbone.md +75 -0
- package/vendor/diagram-design/references/type-flowchart.md +23 -0
- package/vendor/diagram-design/references/type-gantt.md +45 -0
- package/vendor/diagram-design/references/type-heatmap.md +80 -0
- package/vendor/diagram-design/references/type-high-level.md +470 -0
- package/vendor/diagram-design/references/type-it-state.md +468 -0
- package/vendor/diagram-design/references/type-journey.md +55 -0
- package/vendor/diagram-design/references/type-kanban.md +49 -0
- package/vendor/diagram-design/references/type-layers.md +26 -0
- package/vendor/diagram-design/references/type-line.md +337 -0
- package/vendor/diagram-design/references/type-loop.md +223 -0
- package/vendor/diagram-design/references/type-medallion.md +356 -0
- package/vendor/diagram-design/references/type-nested.md +22 -0
- package/vendor/diagram-design/references/type-org-chart.md +44 -0
- package/vendor/diagram-design/references/type-polar.md +136 -0
- package/vendor/diagram-design/references/type-process.md +490 -0
- package/vendor/diagram-design/references/type-pyramid.md +33 -0
- package/vendor/diagram-design/references/type-quadrant.md +81 -0
- package/vendor/diagram-design/references/type-radar.md +82 -0
- package/vendor/diagram-design/references/type-requirement-traceability.md +45 -0
- package/vendor/diagram-design/references/type-sankey.md +75 -0
- package/vendor/diagram-design/references/type-sbgn.md +80 -0
- package/vendor/diagram-design/references/type-scatter.md +276 -0
- package/vendor/diagram-design/references/type-sequence.md +130 -0
- package/vendor/diagram-design/references/type-service-blueprint.md +103 -0
- package/vendor/diagram-design/references/type-state.md +30 -0
- package/vendor/diagram-design/references/type-steps.md +180 -0
- package/vendor/diagram-design/references/type-story-map.md +46 -0
- package/vendor/diagram-design/references/type-swimlane.md +22 -0
- package/vendor/diagram-design/references/type-timeline.md +20 -0
- package/vendor/diagram-design/references/type-tree.md +24 -0
- package/vendor/diagram-design/references/type-treemap.md +137 -0
- package/vendor/diagram-design/references/type-uml-class.md +65 -0
- package/vendor/diagram-design/references/type-unit-grid.md +63 -0
- package/vendor/diagram-design/references/type-venn.md +26 -0
- package/vendor/diagram-design/references/type-wardley.md +39 -0
- package/vendor/diagram-design/references/type-waterfall.md +75 -0
- package/vendor/diagram-design/scripts/self_check.py +1177 -0
- package/vendor/diagram-design/scripts/verify_geometry.py +696 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Treemap
|
|
2
|
+
|
|
3
|
+
**Best for:** part-of-whole where the *relative sizes are the story* — disk and bundle usage, budget or spend breakdowns, market share, population, time allocation. Use when a single total decomposes into parts and the reader's question is "what dominates, and by how much?"
|
|
4
|
+
|
|
5
|
+
Not for: ranked lists where exact values matter more than proportion (use a **bar chart**), containment or scope relationships with no quantity (use **nested**), or a hierarchy you need to trace parent-to-child (use a **tree**).
|
|
6
|
+
|
|
7
|
+
## Layout conventions
|
|
8
|
+
|
|
9
|
+
- **Plot area:** `x` 40 → 956, `y` 40 → 420 inside a `0 0 1000 500` viewBox — the same vertical rhythm as bar, line and scatter, so the legend block sits where a reader of those types already expects it (rule at `y=462`, `LEGEND` at `478`, keys at `488`).
|
|
10
|
+
- **Squarified layout** (Bruls et al., 2000): sort descending, lay each row against the *shorter* side of the remaining rectangle. Aspect ratios stay near 1, which is what makes two areas comparable by eye. Never lay cells out in simple stripes — long thin cells cannot be compared.
|
|
11
|
+
- **Cell count:** 4–8. Past 8, the tail becomes unlabelable slivers — group the tail into a single explicit "Other" cell and name what it contains in the source line.
|
|
12
|
+
- **4px grid:** cell edges snap to the grid like everything else, with a 4px gutter between cells. Snapping and gutters both move area, so check the result — and check it as **relative** error (`(drawn − true) ÷ true`), not percentage points. A 0.1pp slip is nothing on a 59% cell and a quarter of a 0.5% cell; absolute error hides exactly the mistake you need to catch. Keep every cell within a few percent of its true share — the shipped example is within 2.7%, its worst case being the sliver, where the grid cannot do better — and state the encoding in the source line (`AREA = POPULATION`). `scripts/verify-treemap.py` gates this.
|
|
13
|
+
- **Fill:** a rank-ordered `ink` opacity ramp (e.g. `0.16 → 0.04`), so the non-focal order survives greyscale printing and colour-blind readers. One accent cell only — the editorially focal one, not automatically the largest. Note what this does *not* buy you: the focal cell is painted off-ramp, so in greyscale it lands wherever its tint happens to fall, not at its rank. Identify it by the accent stroke, and never let tone carry meaning the area doesn't already carry. `ink` is a role, not a colour: it resolves near-black on light paper and near-white on dark, so one ramp of opacities composites *darker* as it strengthens in the light skin and *lighter* in the dark one. The opacities are identical in both; only their lightness flips.
|
|
14
|
+
- **Stroke:** 1px `ink @ 0.30` hairline on every cell; the focal cell takes a 1.5px `accent` stroke.
|
|
15
|
+
- **Labels sit inside the cell**, top-left, 16px in from the edge: name in the `node-name` role 12–14px 600, value in the `sublabel` role 9px on the next line. Three tiers by cell size:
|
|
16
|
+
- large — name + value + share (`4.78B · 59% of world`)
|
|
17
|
+
- medium — name + value
|
|
18
|
+
- small — a 3-letter mono abbreviation, if one reads honestly
|
|
19
|
+
- sliver — **no text.** When the cell is at least 12×12px, use a filled `ink` disc, `r=5`, centred in the cell, carrying a paper-coloured `i`, with the cell's name and share spelled out in the legend. Below 12px on either axis, omit the in-cell mark and identify the sliver by position in the legend; a fixed-size disc must never cross the cell boundary. `scripts/verify-treemap.py` checks marker containment. Resist rotating a label to make it fit: a single sideways word among five upright ones reads as a mistake before it reads as data, and its centring is a trap — `text-anchor="middle"` centres along the *baseline*, which a quarter-turn maps to the cell's long axis, leaving nothing centring the cap-height band across the narrow one.
|
|
20
|
+
- Never shrink a cell to fit its label. The cell size is the data; the label is commentary.
|
|
21
|
+
- **Contrast:** compute the ceiling against the token you actually ship. The 9px value line is `muted`, not `ink`, and `muted` needs a lighter cell than `ink` does: measured against the composited fill, the top of the ramp can go to **0.16 on light paper and 0.14 on dark** before it drops under 4.5:1. (`ink` would tolerate 0.20 — which is exactly the number you will write down if you check the wrong token.) A mid-tone fill — solid accent, or 50% ink — fails against both light and dark text; use the tint-plus-stroke pattern instead. The source line takes `muted` too: `soft` measures 3.48:1 on paper and never reaches AA anywhere on this ramp.
|
|
22
|
+
- **Legend:** the house block (rule, `LEGEND`, keys), naming the focal cell, the direction of the ink ramp, and any cell carrying an info mark. **Name that direction by contrast against the paper — `stronger contrast is larger` — never by lightness.** `darker is larger` is true only on light paper; ship it in the dark variant and the legend states the opposite of what the reader sees, because the ramp's lightness inverts with the skin while its opacity does not. Named by contrast, one sentence serves all three variants and cannot rot apart. `scripts/verify-skin-polarity.py` gates this, checking every directional tone claim against the ramp composited on that file's own paper. HTML comments are not visible legend copy, including comments between text fragments; contradictory or unverifiable visible wording still fails. Explicit `fill-opacity` and `opacity` presentation attributes multiply the fill color's alpha before that comparison; CSS rules and inherited/group opacity are not resolved by this source checker. Ranked cells with zero effective opacity remain in the comparison at paper contrast. The source line rides the same row as `LEGEND`, right-aligned in mono 8px, stating what area encodes plus the dataset and its date. Archived closing tags inside an inline comment cannot truncate the surrounding visible claim.
|
|
23
|
+
|
|
24
|
+
Commented-out SVG geometry does not contribute to verified cell area or annotation containment.
|
|
25
|
+
|
|
26
|
+
Both matching SVG attribute quote delimiters are supported by the geometry verifier.
|
|
27
|
+
|
|
28
|
+
Parseable numeric label positions and font sizes must be finite, and font sizes must be positive, so invalid annotations cannot bypass containment comparisons. Unsupported SVG length formats retain the existing conservative skip; they are not certified by this source checker.
|
|
29
|
+
|
|
30
|
+
### Declaring the share
|
|
31
|
+
|
|
32
|
+
Printed percentages are read as complete signed numbers, including leading decimals and scientific notation; `5.9e1%` means 59%, while `-59%` contradicts a positive share. Non-finite percentage claims are findings.
|
|
33
|
+
|
|
34
|
+
**Every cell carries `data-share` — including cells too small to label.** It is the cell's percentage of the whole, and it is what makes the area checkable:
|
|
35
|
+
|
|
36
|
+
```svg
|
|
37
|
+
<rect x="X" y="Y" width="W" height="H" rx="2" data-share="18.29" fill="…" stroke="…"/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Without it, a verifier has to infer the intended share from the text inside the cell, which quietly exempts the one cell that has no text — and that is the sliver, the cell the 4px grid distorts most. A shipped treemap once had its smallest cell drawn 50% oversized with every gate green for exactly this reason. `scripts/verify-treemap.py` now fails closed on any cell without it, and cross-checks `data-share` against the percentage the label prints, because a label and the metadata are two statements of one fact.
|
|
41
|
+
|
|
42
|
+
### Cell element pattern
|
|
43
|
+
|
|
44
|
+
```svg
|
|
45
|
+
<!-- Opaque paper mask prevents the dot pattern showing through the tint -->
|
|
46
|
+
<rect x="X" y="Y" width="W" height="H" rx="2" fill="{paper}"/>
|
|
47
|
+
<!-- Cell body -->
|
|
48
|
+
<rect x="X" y="Y" width="W" height="H" rx="2" data-share="18.29" fill="{ink @ 0.16}" stroke="{ink @ 0.30}" stroke-width="1"/>
|
|
49
|
+
<text x="X+16" y="Y+28" fill="{ink}" font-size="13" font-weight="600" font-family="{node-name}">NAME</text>
|
|
50
|
+
<text x="X+16" y="Y+46" fill="{muted}" font-size="9" font-family="{sublabel}">VALUE · SHARE</text>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Focal cell: replace the fill with `accent @ 0.16` and the stroke with `accent` at 1.5px.
|
|
54
|
+
|
|
55
|
+
## Honest-data rule
|
|
56
|
+
|
|
57
|
+
**Area is the only encoding.** Never clip, floor, or log-scale a cell to make it visible, and never drop a cell because it is small — a treemap claims to show a whole, so an omitted part makes the picture a lie. A part too small to label gets a legend entry and, only when the cell can contain it, an info mark; parts too small to draw get merged into one honest, named "Other". If several cells are invisible at the target size, the data wants a bar chart.
|
|
58
|
+
|
|
59
|
+
Watch the smallest cell hardest: it is the one that grid snapping and gutters distort most, and the one nobody checks. Beware, too, the rounding you *display*: six values each rounded up can sum past the total you printed underneath them. Either carry enough precision that the parts reconcile, or say plainly in the source line that they don't (`PARTS ROUNDED, MAY NOT SUM`).
|
|
60
|
+
|
|
61
|
+
## Anti-patterns
|
|
62
|
+
|
|
63
|
+
- More than 8 cells without an "Other" bucket (unlabelable slivers).
|
|
64
|
+
- A stated total the cells contradict by more than display rounding — or rounding that is never disclosed. Rounded parts that miss the total by a hair are honest once the source line says so; silently printing figures that don't reconcile is not.
|
|
65
|
+
- Stripe layout instead of squarified — defeats area comparison.
|
|
66
|
+
- Rainbow fills: one hue per cell destroys the rank reading and the one-accent rule.
|
|
67
|
+
- Nesting more than two levels deep in a static diagram; a second level needs a heavier border and its own label tier, and a third is unreadable without interaction.
|
|
68
|
+
- 3-D or shadowed cells — area is already the message.
|
|
69
|
+
|
|
70
|
+
## Variants
|
|
71
|
+
|
|
72
|
+
- **Marimekko:** the same area encoding on a grid — column width is the category's share, segment height is the series' share within it, so area is the joint share. Full spec below.
|
|
73
|
+
|
|
74
|
+
### Marimekko
|
|
75
|
+
|
|
76
|
+
**Best for:** a **two-way part-of-whole** where both splits matter and the reader's question is "which cell of the cross-tab dominates?" — CI minutes by pipeline × runner OS, bundle bytes by package × chunk, spend by team × vendor, incidents by service × severity. The treemap above answers one question (what dominates the whole); a marimekko answers three at once: read across for the category mix, down for the series mix within a category, and by area for the joint share. A stacked bar with equal-width bars shows the within-category mix and throws the category sizes away; a treemap shows the joint sizes and throws the grid away.
|
|
77
|
+
|
|
78
|
+
Not for: a one-way split (that is the parent treemap, and a marimekko with one series is a bar chart); more than ~5 series or ~8 categories, past which the small cells become unlabelable slivers in *both* directions; series measured in different units, which cannot share one column; or a comparison of the series' totals across categories, which the height encoding deliberately hides — if that is the reading, the data wants a grouped bar.
|
|
79
|
+
|
|
80
|
+
#### Layout conventions
|
|
81
|
+
|
|
82
|
+
- **Plot area:** the treemap's — `x` 40 → 956, `y` 40 → 420 inside a `0 0 1000 500` viewBox, legend block at `y=462`/`478`/`488`. Column captions sit under the plot at `y=438`, `sublabel` role 9px, centred on their column. The shipped example spends 900px of column width across five columns with four 4px gutters.
|
|
83
|
+
- **Column width is category share** of the whole, over the sum of column widths. Column edges snap to the 4px grid, so the gutters do; keep the gutter constant — a widened gap reads as a narrower column.
|
|
84
|
+
- **Every column is the full plot height**, and its segments tile it top to bottom with no gaps and no gutters, separated by the hairline stroke alone. **Segment height is the series' share within its column**, so the same height means the same within-category share whatever the column's width. Segment boundaries are data and land on whole pixels, exempt from the 4px grid as the waterfall's bar tops are.
|
|
85
|
+
- **One series order, top to bottom, in every column** — the order of the series' overall totals, largest at the top. A series absent from a category is omitted from that column, never drawn at zero height; the rows do not align across columns and are not meant to, which is why every segment prints its own share.
|
|
86
|
+
- **Column and series budgets:** 3–8 columns, 2–5 series. Widths under ~24px cannot hold a label in either direction and take the treemap's information mark instead.
|
|
87
|
+
- **Labels sit inside the segment**, top-left, 16px in, in the treemap's tiers by height: 56px and above takes the name in the `node-name` role 12px 600 with the amount and within-column share in the `sublabel` role 9px on the next line (`2,140 min · 68%`); 32–55px takes the same pair at 11px/9px on a tighter pitch; below that, the mark or nothing. The focal segment may add what its share is *of* (`83% of mobile`) because that is the one number a reader is most likely to misread as a share of the whole. Never shrink or widen a segment to fit a label.
|
|
88
|
+
- **Column captions** print the column's name and its share of the whole (`web · 31%`), so the width can be read as a number without a ruler.
|
|
89
|
+
- **Hold the 760px canvas on narrow screens.** The SVG keeps `min-width: 760px` so its 9px labels stay readable, and sits inside a local `overflow-x: auto` wrapper (`.diagram-container`) so a phone scrolls the chart, not the page. `scripts/lint-render.py --all` renders every marimekko at 390px and fails on page-level overflow, a shrunken canvas, or a missing local scroller.
|
|
90
|
+
|
|
91
|
+
#### Colour
|
|
92
|
+
|
|
93
|
+
The treemap's colour section holds here with one change: the ramp runs **per series, not per cell**. Every segment of one series takes one `ink` opacity — strongest on the series with the largest overall total (`0.16 → 0.10 → 0.05` on light paper, `0.14 → 0.09 → 0.04` on dark) — so a row reads as one thing across the figure and the legend needs one key per series, not a direction word. One accent segment, marked by its `accent` stroke at 1.5px and the accent tint, on the editorially focal cell. Labels stay `ink` (names) and `muted` (amounts) everywhere, and the top of the ramp stays at the treemap's contrast ceiling for the same reason.
|
|
94
|
+
|
|
95
|
+
#### Honest-data rule
|
|
96
|
+
|
|
97
|
+
**Width, height and area are three statements of one table, and every one of them is checked.** A column widened to fit its label lies about the category; a segment padded for headroom lies about the series; either lies about the joint share, which is the reading the type exists to give. `scripts/verify-marimekko.py` recomputes all three from the amount every segment declares, as relative error, so the narrow column and the thin segment are held to the same standard as the giants.
|
|
98
|
+
|
|
99
|
+
- **Never drop a category or a series to tidy the grid.** A marimekko claims to show a whole; a missing column makes every other width a lie, and a missing segment makes every other height in its column one. Merge the tail into a named "Other" column or series instead.
|
|
100
|
+
- **A series absent from a category is omitted, not drawn at zero.** A zero-height rect is a cell that claims to exist; an omitted one is a gap the legend can explain.
|
|
101
|
+
- **Say what the amounts are** in the source line — the unit, the period, the total — and say when they are illustrative. The checker verifies internal consistency only; a figure wrong by the same factor everywhere is self-consistent.
|
|
102
|
+
|
|
103
|
+
#### Declaring the values
|
|
104
|
+
|
|
105
|
+
Every segment is one `<rect>` (over its paper mask, as in the parent) carrying the category, the series and the amount. Every visible string is bound to what it describes.
|
|
106
|
+
|
|
107
|
+
```svg
|
|
108
|
+
<rect x="580" y="106" width="216" height="314" rx="2" data-column="mobile" data-segment="macOS" data-amount="1980" fill="{accent @ 0.16}" stroke="{accent}" stroke-width="1.5"/>
|
|
109
|
+
<text data-column="mobile" data-segment="macOS" data-role="label" x="596" y="152" fill="{muted}" font-size="9" font-family="{sublabel}">1,980 min · 83% of mobile</text>
|
|
110
|
+
<text data-column="mobile" data-role="caption" x="688" y="438" fill="{muted}" font-size="9" font-family="{sublabel}" text-anchor="middle">mobile · 24%</text>
|
|
111
|
+
<!-- Key: the node-name family at regular weight; swap in the active skin's sans stack -->
|
|
112
|
+
<text data-segment="macOS" data-role="key" x="344" y="497" fill="{muted}" font-size="8.5" font-family="'Geist', sans-serif">macOS</text>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`data-amount` is the basis of every geometric check, and `data-segment` on a `<rect>` is this contract's scope key: the parent binds `data-share` on a `<rect>` and reads only files named for it, slopegraph binds `data-series` on a `<line>`, bump `data-ranks` and ridgeline `data-bins` on a `<path>`, bubble `data-size` and beeswarm `data-value` on a `<circle>`. No two gates read one attribute, so no two gates claim one file. A label prints the segment's amount and its within-column share and nothing else numeric; a caption prints its column's name and share of the whole; a key names its series. `scripts/verify-marimekko.py` covers the shared plot, the constant gutter, the width, height and area shares, the tiling, the series order, the accent count, every binding and the marker fit; `scripts/test-verify-marimekko.py` proves each check in both polarities and pins the scope treaty with the parent and the sibling gates.
|
|
116
|
+
|
|
117
|
+
**No `transform` on any of it**, by any carrier — the `transform` attribute, an inline `style`, or a `<style>` rule — on a segment, a bound label, or an ancestor `<g>`. The checker reads raw coordinates, and a transform moves the rendered mark away from the number that was verified.
|
|
118
|
+
|
|
119
|
+
#### Anti-patterns
|
|
120
|
+
|
|
121
|
+
- Equal-width columns — that is a 100% stacked bar, and the category sizes are gone.
|
|
122
|
+
- Columns of different heights, or a gutter between segments — height stops being a share of anything.
|
|
123
|
+
- A series in a different order in one column, or one drawn at zero height where it is absent.
|
|
124
|
+
- One hue per series instead of the ink ramp plus a single accent; a legend that names the ramp by tone instead of by series.
|
|
125
|
+
- A column widened, or a segment padded, to fit its label.
|
|
126
|
+
- A category or series silently dropped from the grid.
|
|
127
|
+
- More than 5 series or 8 categories without an "Other".
|
|
128
|
+
- A stated total the segments contradict by more than display rounding.
|
|
129
|
+
|
|
130
|
+
## Examples
|
|
131
|
+
|
|
132
|
+
- `assets/example-treemap.html` — minimal light
|
|
133
|
+
- `assets/example-treemap-dark.html` — minimal dark
|
|
134
|
+
- `assets/example-treemap-full.html` — full editorial
|
|
135
|
+
- `assets/example-marimekko.html` — marimekko, minimal light
|
|
136
|
+
- `assets/example-marimekko-dark.html` — marimekko, minimal dark
|
|
137
|
+
- `assets/example-marimekko-full.html` — marimekko, full editorial
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# UML Class Diagram
|
|
2
|
+
|
|
3
|
+
**Best for:** the static structure of an object model — classes, what they own, what they inherit, and what they merely depend on. The distinguishing content is the **operations compartment** and the **typed relationship vocabulary** (the arrowheads carry meaning). ER cannot express either — use this type only when operations or the inheritance/composition vocabulary are the point of the diagram, and `type-er.md` when the story is entities and cardinality.
|
|
4
|
+
|
|
5
|
+
**Other UML diagrams — route elsewhere.** UML is a family; only the class diagram gets its own grammar here:
|
|
6
|
+
|
|
7
|
+
| UML diagram | Use instead |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Sequence | [type-sequence.md](type-sequence.md) |
|
|
10
|
+
| State machine | [type-state.md](type-state.md) |
|
|
11
|
+
| Component | [type-architecture.md](type-architecture.md) |
|
|
12
|
+
| Deployment | [type-architecture.md](type-architecture.md) |
|
|
13
|
+
| Activity | [type-swimlane.md](type-swimlane.md) or [type-flowchart.md](type-flowchart.md) |
|
|
14
|
+
| Conceptual / domain ER | [type-er.md](type-er.md) |
|
|
15
|
+
|
|
16
|
+
## Layout conventions
|
|
17
|
+
|
|
18
|
+
- Each class is a **single box** (`rx=6`), divided by full-width hairlines into up to three compartments. Compartment heights follow content — never pad to a uniform height.
|
|
19
|
+
1. **Name** — class name in the `node-name` role, 12px, weight 600, **centered**. An interface carries an `eyebrow`-role 8px `«interface»` stereotype line above the name. An abstract class sets the name in *italic*.
|
|
20
|
+
2. **Attributes** — one line each, `sublabel` role 9px, left-aligned: `+ name: Type`. Visibility markers: `+` public, `-` private, `#` protected.
|
|
21
|
+
3. **Operations** — one line each, `sublabel` role 9px, left-aligned: `+ method(arg): Return`.
|
|
22
|
+
Omit a compartment entirely when a class has no members in it (an interface with no attributes skips that compartment).
|
|
23
|
+
- Attribute/operation lines are a single combined string, not the two-column field/type layout ER uses — that visual distinction keeps the two types from reading the same.
|
|
24
|
+
- Coral (accent) is reserved for the class being implemented or extended (the focal type) — accent-tint fill, accent stroke. Its inbound inheritance/realization edges count as **one** additional accent element (treated as a group), for 2 accent elements total per diagram.
|
|
25
|
+
|
|
26
|
+
## Relationship vocabulary
|
|
27
|
+
|
|
28
|
+
Define every marker used in `<defs>` and show all six in the legend, even the ones not used in the diagram body — the legend is this type's complete grammar reference.
|
|
29
|
+
|
|
30
|
+
| Relationship | Line | Ending (at the target/owner end) |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Inheritance (`extends`) | solid | large **hollow triangle** — `paper` fill, `ink` stroke |
|
|
33
|
+
| Realization (`implements`) | dashed `5,4` | same hollow triangle |
|
|
34
|
+
| Composition (owns, cascades) | solid | **filled diamond** at the OWNER end, `ink` fill |
|
|
35
|
+
| Aggregation (has, independent) | solid | **hollow diamond** at the OWNER end |
|
|
36
|
+
| Association | solid | plain open arrowhead, multiplicity at BOTH ends |
|
|
37
|
+
| Dependency (uses) | dashed `4,3` | plain open arrowhead |
|
|
38
|
+
|
|
39
|
+
Multiplicities (`1`, `0..*`, `1..*`) sit in the `arrow-label` role at 8px, 10–12px off the box edge, on an opaque mask over the line — same convention as ER cardinality labels.
|
|
40
|
+
|
|
41
|
+
## Connector rules
|
|
42
|
+
|
|
43
|
+
All six SKILL.md §6 connector rules apply in full — orthogonal rounded elbows (`r=8`), no diagonals, bridge/hop for unavoidable crossings, fanned attach points ≥12px apart when several relationships share an edge, masked labels with the 6–10px gap, connectors drawn before boxes. Prefer laying classes out so relationships resolve to straight lines or single-elbow routes; a class diagram with every edge bridging is over budget — split by package instead.
|
|
44
|
+
|
|
45
|
+
## Complexity budget
|
|
46
|
+
|
|
47
|
+
Max 7 classes, max 8 relationships, max 5 members per compartment (overflow becomes a `sublabel`-role `…` line), max 2 accent elements. Over budget → split by package.
|
|
48
|
+
|
|
49
|
+
Seven is the ceiling rather than the target. Three compartments per box makes a class diagram dense fast, so treat 4–5 classes as the normal size; the shipped example uses all seven only because it doubles as the legend for the full relationship vocabulary.
|
|
50
|
+
|
|
51
|
+
## Anti-patterns
|
|
52
|
+
|
|
53
|
+
- Getters and setters listed as operations — they're noise; show behavior that matters.
|
|
54
|
+
- Every attribute and method dumped in — a class diagram is an argument, not a header file.
|
|
55
|
+
- Composition and aggregation used interchangeably — the filled diamond means the part dies with the whole. Say so, or use the hollow diamond.
|
|
56
|
+
- Association arrows with no multiplicity.
|
|
57
|
+
- Drawing a class diagram when there's no inheritance and no operations — that's ER.
|
|
58
|
+
- Stereotype guillemets on everything, not just the interfaces/abstracts that need them.
|
|
59
|
+
- Boxes padded to equal height.
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
- `assets/example-uml-class.html` — minimal light
|
|
64
|
+
- `assets/example-uml-class-dark.html` — minimal dark
|
|
65
|
+
- `assets/example-uml-class-full.html` — full editorial
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Unit Grid
|
|
2
|
+
|
|
3
|
+
**Best for:** one bounded whole expressed as equal, discrete units: completion, capacity, survey responses, inventory, or a checklist. Use the canonical waffle form when the reader needs to see an exact count out of 100.
|
|
4
|
+
|
|
5
|
+
Not for: category-by-category comparison (use a **bar chart**), a part-of-whole with unequal pieces (use a **treemap**), continuous change (use a **line chart**), or a matrix where row and column positions carry meaning (the future punch-card variant).
|
|
6
|
+
|
|
7
|
+
## Input contract
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
title: "Release readiness"
|
|
11
|
+
total: 100
|
|
12
|
+
filled: 64
|
|
13
|
+
unit_label: "release check"
|
|
14
|
+
focal_index: 63
|
|
15
|
+
source_note: "Illustrative checklist"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Validation rules:
|
|
19
|
+
|
|
20
|
+
1. Version 1 is a 10 by 10 grid with exactly 100 cells.
|
|
21
|
+
2. `total` is exactly `100`; `filled` is an integer from `0` through `100`.
|
|
22
|
+
3. Every cell represents one unit. Do not use fractional cells, scaled cells, or merged cells.
|
|
23
|
+
4. At most one completed cell is focal. Accent is editorial emphasis, never a larger unit.
|
|
24
|
+
5. Cells fill in reading order, left to right and top to bottom. A different order needs an explicit future variant.
|
|
25
|
+
6. Rows and columns carry no category meaning in the canonical waffle form.
|
|
26
|
+
|
|
27
|
+
## Layout conventions
|
|
28
|
+
|
|
29
|
+
- Use a 10 by 10 grid of equal 20px cells with a 4px gutter. The shipped examples begin at `(382, 86)`, making the grid 236px square inside a `1000 × 390` viewBox.
|
|
30
|
+
- Every chart root carries `data-unit-grid="true"`, `data-unit-total="100"`, `data-unit-filled`, `data-unit-rows="10"`, and `data-unit-columns="10"`.
|
|
31
|
+
- Every cell is a `<rect>` with `data-unit-cell="filled"` or `data-unit-cell="empty"` and a unique `data-unit-index` from 0 through 99. `scripts/verify-unit-grid.py` checks count, geometry, indices, the declared filled value, and printed labels.
|
|
32
|
+
- Use one ink fill for completed cells, a quieter paper-relative fill for remaining cells, and no more than one accent completed cell. The count, not color, carries the value. Set each cell's literal fill on the `<rect>` (or a parent `<g>`): completed cells must match the page's `:root` `--ink` or `--accent`, and remaining cells share one other fill well away from both. Cells sit directly in the chart `<svg>` or in plain `<g>`/`<a>` groups with no `style`, `transform` or conditional attributes; cell strokes stay at or under 2px and corner radii at or under a quarter of the cell. The verifier rejects opacity, visibility, display, filter, mask, clip-path, paint-order and mix-blend-mode on cells or their ancestors, paint, stroke or hiding rules in `<style>` (after decoding escapes), `@import`, any linked stylesheet but Google Fonts, SMIL animation, and any element drawn after the first cell whose box touches the grid or cannot be computed from plain numeric attributes. It does not see HTML wrappers around the SVG or scripts.
|
|
33
|
+
- Mark the percentage text with `data-unit-percent="true"` and the count text with `data-unit-count="true"`. They must read `64%` and `64 complete · 36 remaining` for `filled: 64`; both are checked against `data-unit-filled`. Each label is plain visible `<text>` inside the chart SVG (no child elements, no hiding or `style` attributes), painted `--ink` or `--muted`, at least 8px, and inside the viewBox.
|
|
34
|
+
- Do not apply transforms to cells or their SVG/group ancestors, or move geometry through CSS. Bake movement into the coordinates so the verifier checks the rendered positions.
|
|
35
|
+
- Put the exact count in text near the grid and state the unit in the source line. The grid must remain understandable in grayscale.
|
|
36
|
+
- Keep the legend block below the grid. Label the focal cell as editorial emphasis, so it cannot be mistaken for a special unit.
|
|
37
|
+
|
|
38
|
+
## Honest-data rule
|
|
39
|
+
|
|
40
|
+
A unit grid claims that one mark equals one unit. Never round a 63.4% result to 64 filled cells without saying that the display is rounded. Never use a partial fill, larger focal cell, gradient, or area-sized mark to recover precision. If the denominator is not naturally bounded to 100, choose a number of whole cells that makes the unit honest or choose a different chart.
|
|
41
|
+
|
|
42
|
+
## Complexity budget
|
|
43
|
+
|
|
44
|
+
- Exactly 100 cells in a 10 by 10 grid.
|
|
45
|
+
- One count and one optional focal completed cell.
|
|
46
|
+
- One legend and one source note.
|
|
47
|
+
- Static output only.
|
|
48
|
+
- No categorical row or column axes in version 1.
|
|
49
|
+
|
|
50
|
+
## Anti-patterns
|
|
51
|
+
|
|
52
|
+
- Partial, merged, oversized, or differently shaped cells.
|
|
53
|
+
- Rainbow status fills or multiple accent cells.
|
|
54
|
+
- Using the grid for a denominator other than 100 without an explicit future variant.
|
|
55
|
+
- Treating rows and columns as categories. That is the later punch-card variant, not this canonical waffle form.
|
|
56
|
+
- Gradients, heatmap ramps, 3-D treatments, or shadows.
|
|
57
|
+
- Filling in a non-reading order without explaining that order.
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
- `assets/example-unit-grid.html` - minimal light.
|
|
62
|
+
- `assets/example-unit-grid-dark.html` - minimal dark with the same dataset and geometry.
|
|
63
|
+
- `assets/example-unit-grid-full.html` - full editorial with unchanged grid geometry.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Venn / Set Overlap
|
|
2
|
+
|
|
3
|
+
**Best for:** intersection of concepts/domains, shared attributes between categories, "where A meets B", ikigai-style frames (desirable × feasible × viable).
|
|
4
|
+
|
|
5
|
+
## Layout conventions
|
|
6
|
+
- **Prefer 2 or 3 circles.** Avoid 4+ (unreadable — use a matrix instead).
|
|
7
|
+
- Circle stroke: 1px hairline, color per-set (ink, muted, soft).
|
|
8
|
+
- Circle fill: very low-opacity tint — `ink @ 0.04` for the ink set, `muted @ 0.05` for the muted one. Tints compound naturally in overlap regions.
|
|
9
|
+
- Radii: equal when sets are comparable in size; proportional when sets are meaningfully different. Don't fake equal sizes for aesthetics.
|
|
10
|
+
- **Set labels** placed outside the circle, NEVER crossing the stroke. `node-name` role 12–14px 600 for the set name, optional `sublabel` role 9px.
|
|
11
|
+
- **Intersection labels** placed inside the overlap region, `node-name` role 12px 600, centered. For small overlaps, use a leader line to a label in clear space.
|
|
12
|
+
- **Coral accent** on the ONE focal intersection — the "sweet spot". Either an `accent` label stroke OR a clipPath-bounded `accent @ 0.10` fill tint.
|
|
13
|
+
- Circle centers and radii divisible by 4.
|
|
14
|
+
|
|
15
|
+
## Anti-patterns
|
|
16
|
+
- Unlabeled regions — reader can't tell which set is which.
|
|
17
|
+
- Circles that don't overlap when overlap is the point.
|
|
18
|
+
- Equal-sized circles when sets are obviously different (dishonest).
|
|
19
|
+
- Coral on multiple overlap regions (focal signal dies).
|
|
20
|
+
- Labels sitting on top of circle strokes (illegible).
|
|
21
|
+
- 4+ circles where 2–3 would do.
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
- `assets/example-venn.html` — minimal light
|
|
25
|
+
- `assets/example-venn-dark.html` — minimal dark
|
|
26
|
+
- `assets/example-venn-full.html` — full editorial
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Wardley Map
|
|
2
|
+
|
|
3
|
+
**Best for:** positioning the components of a value chain against how evolved (commoditised) each one is, so a reader can see what to build, what to buy, and what is about to move. A strategy artefact, not an architecture diagram — it says nothing about how components connect at runtime, only where each one sits on the genesis-to-commodity curve.
|
|
4
|
+
|
|
5
|
+
## Layout conventions
|
|
6
|
+
|
|
7
|
+
- **Y axis — value chain.** `Visible to the user` at the top, down to `Invisible` at the bottom. Label the axis as stacked separate `<text>` lines flanking the axis endpoints — **never `writing-mode`** to rotate a label vertically. Axis line `rule-solid` at `0.20` opacity.
|
|
8
|
+
- **X axis — evolution.** Four bands separated by three vertical hairlines: `Genesis | Custom-built | Product | Commodity`. Band separators are `rule` at `0.10` opacity, dashed `4,4`. Band labels sit along the bottom axis: `eyebrow` role 8px, uppercase, tracked, `muted`. Axis line `rule-solid` at `0.20` opacity.
|
|
9
|
+
- **Components** are a small circle `r=6`, filled `paper` with an `ink` 1px stroke. Label in the `node-name` role, 12px, weight 600, placed 12px above the dot, `text-anchor="middle"`. An optional `sublabel`-role 9px `muted` sublabel can sit under the dot for a technical qualifier — use sparingly.
|
|
10
|
+
- **Dependency links** are thin `muted` 0.8px straight lines from a component down to the component it depends on. **These are the one documented exemption from §6 rule 1 (mandatory orthogonal elbows) — dependency links only.** A component's y/x position on this map *is* the data; forcing it onto an axis to make an elbow route work would misplace it. No arrowhead — the line itself states the dependency.
|
|
11
|
+
- **Movement** — a component that is evolving carries a short right-pointing arrow: `accent`, dashed `5,4`, `marker-end="url(#arrow-accent)"`, running from the dot's edge toward the next band. The arrow needs no on-arrow text label: the legend's "Evolving" swatch (accent dot + dashed accent arrow) already names what accent + dashes mean, and since arrows on this map can only ever point right (see Anti-patterns — a left-pointing movement arrow is a contradiction, not a design choice), the direction itself already says "toward commodity." A bare word like `COMMODITISING` restates what shape and color already signal — apply §1's remove test: can I remove this label, does color or shape already carry it? Here it does, so the label is the thing that goes, not its position.
|
|
12
|
+
An on-arrow label is legitimate only when it qualifies something the arrow *can't* express on its own — a timeframe (`BY Q3`), a driver (`VENDOR LOCK-IN`) — never a restatement of direction. If you add one, mask it, `arrow-label` role 8px, 6–10px clear of the stroke, same masking rule as any arrow label (§6 rule 2), and confirm there's runway for the mask first: the space directly around a component's dot is usually the most congested spot on the map, because that's also where its own dependency links fan out. Worked example — the moving component in `example-wardley.html` sits at `(420,156)` with links fanning to `(620,220)` and `(680,252)`; at the mandatory 6–10px gap band below the arrow (`y=164–176`), those two lines cross at `x=441.7–482.5` and `x=445–482.5` respectively — almost the full width of the arrow's own span (`x=428–504`), leaving no clear pocket wide enough for a label. Above the dot is no better: the component's own name label already occupies that band per the 12px-above-dot convention. Check both bands for interference before adding a movement label; if neither is clear, don't add one — the legend already covers it.
|
|
13
|
+
- **Focal rule:** the 2 accent elements on this type are the moving component's dot (`accent-tint` fill, `accent` stroke) and its movement arrow — or two moving components sharing those 2 accent slots with no other accent anywhere else on the map.
|
|
14
|
+
- **Legend:** horizontal strip at the bottom, hairline separator above it, viewBox extended ~60px — same as every other type.
|
|
15
|
+
|
|
16
|
+
## Complexity budget
|
|
17
|
+
|
|
18
|
+
| Limit | Rule |
|
|
19
|
+
|---|---|
|
|
20
|
+
| Max components | 9 |
|
|
21
|
+
| Max dependency links | 12 |
|
|
22
|
+
| Max movement arrows | 2 |
|
|
23
|
+
| Max accent elements | 2 |
|
|
24
|
+
|
|
25
|
+
## Anti-patterns
|
|
26
|
+
|
|
27
|
+
- **Treating the x axis as a maturity score.** Evolution is four qualitative bands (genesis / custom-built / product / commodity), not a 0–10 slider. Don't plot a component at "6.5" — place it in a band.
|
|
28
|
+
- **A component with no dependency link.** If nothing in the value chain depends on it and it depends on nothing, it isn't part of the chain — delete it or wire it in.
|
|
29
|
+
- **Arrows drawn right-to-left.** Evolution only moves toward commodity. A left-pointing movement arrow is a contradiction, not a design choice.
|
|
30
|
+
- **Using the map as an architecture diagram.** No request/response direction, no protocols, no runtime topology — that's the architecture type. This type answers "what's worth building vs. buying," not "how does traffic flow."
|
|
31
|
+
- **Numbering the y axis.** Value-chain visibility is ordinal (more visible to the user, less visible), not a quantity. Numeric ticks imply a measurement that doesn't exist.
|
|
32
|
+
- **More than 2 movement arrows.** Beyond that the map stops making a single point and turns into a forecast nobody can act on.
|
|
33
|
+
- **`writing-mode` vertical axis text.** Stack the words as separate horizontal `<text>` lines instead — see Layout conventions above.
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
- `assets/example-wardley.html` — minimal light. AI assistant product, agent orchestration commoditising toward Product.
|
|
38
|
+
- `assets/example-wardley-dark.html` — minimal dark, same map.
|
|
39
|
+
- `assets/example-wardley-full.html` — full editorial: framed container + 3 varied-width cards (the moving component, a genesis-stage build, and the commodity base).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Waterfall Chart
|
|
2
|
+
|
|
3
|
+
**Best for:** showing how a start total becomes an end total through signed contributions — a budget bridge (FY25 baseline → FY26 plan), headcount deltas (starting roster ± hires ± attrition), conversion leak/gain, P&L walk. Use when the running total is the story: every bar either anchors the total or bridges one running level to the next, and the reader traces the path from start to end.
|
|
4
|
+
|
|
5
|
+
**Not this type:**
|
|
6
|
+
|
|
7
|
+
- Two endpoints where only the *gap* matters → **dumbbell** (a Bar variant, `type-bar.md`). A dumbbell states two values and their distance; a waterfall states a path of signed steps that must reconcile. The types look adjacent but make opposite claims: the dumbbell hides what happened in between, the waterfall *is* what happened in between.
|
|
8
|
+
- Independent category comparisons → **bar** (`type-bar.md`).
|
|
9
|
+
- One quantity splitting and merging across stages → **Sankey** (`type-sankey.md`). A waterfall is strictly sequential and one-dimensional; the bars never branch.
|
|
10
|
+
- Ordered drop-off through stages of one funnel → **pyramid / funnel** (`type-pyramid.md`).
|
|
11
|
+
|
|
12
|
+
## Layout conventions
|
|
13
|
+
|
|
14
|
+
- **Orientation:** vertical columns only, left → right in narrative order: start total, then each signed bridge, optional subtotal, end total. A horizontal waterfall reads as a Gantt.
|
|
15
|
+
- **Plot area:** left 80px (y-axis labels), bottom 60px (category labels), top 40px, right 40px — inside a `0 0 1000 500` viewBox, same frame as the bar chart. Plot band x 80→960, y 40→420.
|
|
16
|
+
- **Bar count:** 3–8 bars total, including both totals and at most one subtotal. More contributions than that → merge the tail into one named "Other" bridge (disclose what it contains) or split the walk into two charts.
|
|
17
|
+
- **Bar width / pitch:** equal-width bars on an even pitch, bar ≥ 50% of the pitch. Six bars fit as width=96 on a 144px pitch starting at x=112.
|
|
18
|
+
- **Totals anchor, bridges float.** The start total, any subtotal, and the end total are drawn from the domain floor (the x-axis baseline) up to their value. Bridge bars span exactly the running total before and after their contribution — an increase rises from the previous level, a decrease falls from it.
|
|
19
|
+
- **Carry rules (the bridge grammar).** A horizontal connector line carries the running total across each gap between adjacent bars, drawn at the shared level: from the right edge of one bar to the left edge of the next, `ink @ 0.55` at 1px on light paper (`ink @ 0.40` on dark) — the dumbbell's connector weight, because the carry is load-bearing and must clear 3:1, not the 0.25 axis hairline. Each carry declares the running total it transports in `data-carry`.
|
|
20
|
+
- **Machine-readable data contract.** Every bar rect declares `data-role` (`total`, `delta`, or `subtotal`), `data-value` (totals unsigned, deltas explicitly signed `+`/`-`), and `data-name`. `scripts/verify-waterfall.py` reads these and fails the build when the drawing and the declaration disagree — see the honesty rules below.
|
|
21
|
+
- **Sign is encoded by fill weight, not hue.** Increases take the bar family's default tint (`muted @ 0.15` fill, `muted` stroke). Decreases are hollow — paper fill, same `muted` stroke — so the two directions survive greyscale and colour-vision deficiency without leaning on the accent. The geometry (which end of the bar meets the carry) and the signed printed value are the second and third encodings of the same fact.
|
|
22
|
+
- **Totals are the heaviest marks:** `ink @ 0.08` fill with a 1px `ink` stroke. The reader's eye should land on the two anchors first, then walk the bridges.
|
|
23
|
+
- **Focal bridge (≤1, optional):** the one contribution the chart exists to show gets the bar family's focal treatment — `accent @ 0.12` fill, `accent` stroke, accent value label. It replaces that bar's sign fill; the signed label and geometry still carry the direction.
|
|
24
|
+
- **Value labels:** `arrow-label` role 8px. Totals and increases print above the bar top (baseline `top − 8`); decreases print below the bar bottom (baseline `bottom + 12`), because the space above a decrease is where its carry arrives. Deltas print with an explicit sign (`+64`, `−38`); totals print unsigned.
|
|
25
|
+
- **Gridlines / axes:** identical to the bar chart — 4–6 faint horizontal gridlines `ink @ 0.08` 0.8px, y-axis line and x-axis baseline `ink @ 0.25` 1px, tick labels `arrow-label` role 8px `muted` right-aligned at x=72, rotated y-axis title `eyebrow` role 7px tracked.
|
|
26
|
+
- **Category labels:** centered under each bar at y=440, `node-name` role 11px 600 `ink`; the focal bar's label may take accent.
|
|
27
|
+
- **Legend:** horizontal bottom strip after a hairline rule, one key per treatment used: total, increase, decrease, focal.
|
|
28
|
+
|
|
29
|
+
### Waterfall element pattern
|
|
30
|
+
|
|
31
|
+
```svg
|
|
32
|
+
<!-- Start total: anchored at the baseline (y=420), value 240 on a 0–400 domain, k=0.95 px/unit -->
|
|
33
|
+
<rect x="112" y="192" width="96" height="228" fill="{paper}"/>
|
|
34
|
+
<rect x="112" y="192" width="96" height="228" fill="{ink @ 0.08}" stroke="{ink}" stroke-width="1"
|
|
35
|
+
data-role="total" data-value="240" data-name="FY25 base"/>
|
|
36
|
+
<text x="160" y="184" fill="{muted}" font-size="8" font-family="{arrow-label}" text-anchor="middle">240</text>
|
|
37
|
+
|
|
38
|
+
<!-- Carry: the running total (240) crosses the gap at its own level -->
|
|
39
|
+
<line x1="208" y1="192" x2="256" y2="192" stroke="{ink @ 0.55}" stroke-width="1" data-carry="240"/>
|
|
40
|
+
|
|
41
|
+
<!-- Increase bridge: +64 rises from 240 to 304 -->
|
|
42
|
+
<rect x="256" y="131" width="96" height="61" fill="{paper}"/>
|
|
43
|
+
<rect x="256" y="131" width="96" height="61" fill="{muted @ 0.15}" stroke="{muted}" stroke-width="1"
|
|
44
|
+
data-role="delta" data-value="+64" data-name="Headcount"/>
|
|
45
|
+
<text x="304" y="123" fill="{muted}" font-size="8" font-family="{arrow-label}" text-anchor="middle">+64</text>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Endpoint positions round to the nearest integer pixel and never snap to the 4px grid — data coordinates are exempt, exactly as in the dumbbell. Bar x-positions and widths are layout, so they stay on the grid.
|
|
49
|
+
|
|
50
|
+
## Anti-patterns
|
|
51
|
+
|
|
52
|
+
- **A floating bar with no carry.** The connector is the claim that the total is conserved across the gap; without it the chart is bars at odd heights.
|
|
53
|
+
- **Sign by hue alone** (green up / red down, or accent on every decrease). Hue is the one channel that does not survive greyscale or CVD; fill weight and geometry carry the sign here, and the accent stays editorial.
|
|
54
|
+
- **A truncated value axis.** The domain follows the data's range, never its observed extremes — the same rule, cases, and all-zero fallback as the dumbbell (`type-bar.md` § Dumbbell honesty rules). A waterfall on a clipped domain inflates every bridge.
|
|
55
|
+
- **More than one subtotal.** A walk that needs several resting points is two walks; split it.
|
|
56
|
+
- **Mixing units mid-walk.** Every bar is in the start total's unit or the reconciliation is fiction.
|
|
57
|
+
- **3-D, shadows, rounded bridge bars** — same editorial rules as every chart here.
|
|
58
|
+
|
|
59
|
+
## Waterfall honesty rules
|
|
60
|
+
|
|
61
|
+
- **Decimal declarations conserve exactly.** Fractional budgets use exact decimal arithmetic for totals, carries, and printed-value identity; geometry retains its pixel-rounding allowance. A binary floating point accumulation error must not reject a reconciled dollar-and-cent walk, and an actual decimal discrepancy is still a failure.
|
|
62
|
+
- **The running total must conserve.** Start + every signed bridge = each subtotal and the end total, exactly — the declared `data-value`s must reconcile before geometry is even considered. A waterfall that doesn't add up is not approximately right, it is wrong.
|
|
63
|
+
- **Bridges span exactly their two running levels.** Each bar's drawn top and bottom must sit where the shared scale puts the running totals before and after it (±0.75px for integer rounding). Stretching one bridge "for legibility" moves money that doesn't exist.
|
|
64
|
+
- **Every carry sits at the level it transports,** spanning its full gap, and declares that value. A carry drawn at the wrong height reconnects the walk to a different total.
|
|
65
|
+
- **Every bar prints its value, deltas with an explicit sign.** An unsigned bridge asks the reader to infer direction from geometry alone; print `+`/`−`.
|
|
66
|
+
- **Zero bridges are dropped, never drawn.** A zero-height bar is invisible ink that still occupies a column; state it in prose or the source line instead.
|
|
67
|
+
- **A degenerate start (zero or negative total) is a named failure,** not a silently rescaled chart — the scale is derived from the start anchor.
|
|
68
|
+
|
|
69
|
+
These rules are executable: `scripts/verify-waterfall.py` reads each bar's declaration, recomputes the running totals, refits the shared scale from the start anchor, and fails on any conservation, geometry, carry, label, or sign-treatment drift. `scripts/test-verify-waterfall.py` proves both polarities — the shipped examples pass, and each mutation class above fails with a named finding.
|
|
70
|
+
|
|
71
|
+
## Examples
|
|
72
|
+
|
|
73
|
+
- `assets/example-waterfall.html` — minimal light
|
|
74
|
+
- `assets/example-waterfall-dark.html` — minimal dark
|
|
75
|
+
- `assets/example-waterfall-full.html` — full editorial
|