fastdraw 0.0.0-stage → 0.1.1

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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -2
  3. package/agents/AGENTS-snippet.md +10 -0
  4. package/agents/README.md +11 -0
  5. package/agents/claude-skill/fastdraw/SKILL.md +14 -0
  6. package/dist/cli.js +3694 -0
  7. package/fonts/Geist-Medium.ttf +0 -0
  8. package/fonts/Geist-Regular.ttf +0 -0
  9. package/fonts/Geist-SemiBold.ttf +0 -0
  10. package/fonts/GeistMono-Medium.ttf +0 -0
  11. package/fonts/GeistMono-Regular.ttf +0 -0
  12. package/fonts/InstrumentSerif-Italic.ttf +0 -0
  13. package/fonts/InstrumentSerif-Regular.ttf +0 -0
  14. package/fonts/LibreFranklin-Bold.ttf +0 -0
  15. package/fonts/LibreFranklin-Medium.ttf +0 -0
  16. package/fonts/LibreFranklin-Regular.ttf +0 -0
  17. package/fonts/LibreFranklin-SemiBold.ttf +0 -0
  18. package/fonts/Newsreader-Italic.ttf +0 -0
  19. package/fonts/Newsreader-Medium.ttf +0 -0
  20. package/fonts/Newsreader-Regular.ttf +0 -0
  21. package/fonts/Newsreader-SemiBold.ttf +0 -0
  22. package/fonts/OFL-Geist.txt +93 -0
  23. package/fonts/OFL-InstrumentSerif.txt +93 -0
  24. package/fonts/OFL-LibreFranklin.txt +93 -0
  25. package/fonts/OFL-Newsreader.txt +93 -0
  26. package/fonts/OFL-SketchHand.txt +49 -0
  27. package/fonts/SketchHand-Regular.ttf +0 -0
  28. package/guide/architecture-delta.md +52 -0
  29. package/guide/architecture.md +28 -0
  30. package/guide/axonometric-plan.md +54 -0
  31. package/guide/bar.md +61 -0
  32. package/guide/data-flow.md +42 -0
  33. package/guide/db-schema.md +46 -0
  34. package/guide/dependency.md +38 -0
  35. package/guide/deployment.md +46 -0
  36. package/guide/er.md +49 -0
  37. package/guide/exploded.md +53 -0
  38. package/guide/fishbone.md +44 -0
  39. package/guide/flowchart.md +22 -0
  40. package/guide/gantt.md +48 -0
  41. package/guide/guide.md +278 -0
  42. package/guide/heatmap.md +59 -0
  43. package/guide/high-level.md +38 -0
  44. package/guide/integration.md +33 -0
  45. package/guide/it-state.md +33 -0
  46. package/guide/journey.md +35 -0
  47. package/guide/kanban.md +53 -0
  48. package/guide/layers.md +49 -0
  49. package/guide/line.md +112 -0
  50. package/guide/look.md +174 -0
  51. package/guide/loop.md +45 -0
  52. package/guide/medallion.md +37 -0
  53. package/guide/nested.md +36 -0
  54. package/guide/org-chart.md +48 -0
  55. package/guide/polar.md +57 -0
  56. package/guide/process.md +41 -0
  57. package/guide/pyramid.md +46 -0
  58. package/guide/quadrant.md +44 -0
  59. package/guide/radar.md +60 -0
  60. package/guide/sankey.md +53 -0
  61. package/guide/scatter.md +73 -0
  62. package/guide/security-matrix.md +47 -0
  63. package/guide/sequence.md +39 -0
  64. package/guide/state.md +38 -0
  65. package/guide/story-map.md +29 -0
  66. package/guide/swimlane.md +40 -0
  67. package/guide/timeline.md +49 -0
  68. package/guide/tree.md +33 -0
  69. package/guide/treemap.md +67 -0
  70. package/guide/uml-class.md +59 -0
  71. package/guide/venn.md +48 -0
  72. package/guide/wardley.md +35 -0
  73. package/guide/waterfall.md +47 -0
  74. package/package.json +59 -4
@@ -0,0 +1,44 @@
1
+ # Quadrant diagrams
2
+
3
+ Shows items placed against two measures at once (impact and effort, reach and frequency), so the reader sees which corner each one falls in.
4
+
5
+ FastDraw has no quadrant element. You build one from two lines, small circles and text. Title at `40,52` (`style=h1`); the quadrants start at y=96.
6
+
7
+ ## Building blocks
8
+
9
+ ```
10
+ // tint behind the one quadrant that matters; a zone is drawn behind the axes
11
+ // (stroke=none: no outline)
12
+ zone at 120,96 380x172 fill=accent/0.03 stroke=none radius=0
13
+
14
+ // axes cross in the middle; the arrowhead is at the high end
15
+ xaxis: 120,268 -> 880,268 stroke=ink/0.45 sw=1
16
+ yaxis: 500,440 -> 500,96 stroke=ink/0.45 sw=1
17
+
18
+ // an item: a dot at its position, its name 16px to the right
19
+ p2: ellipse at 316,212 8x8 fill=ink stroke=none
20
+ text "Update changelog" at 332,220 size=11 color=muted
21
+ ```
22
+
23
+ ## Composition
24
+
25
+ - Axes from x=120 to 880 and y=96 to 440 give four quadrants of 380x172, crossing at 500,268. Keep the crossing at the centre of the plot, so the four quadrants are equal.
26
+ - Name each end of each axis with one or two words in `eyebrow` style, beside the tip and never on the line: under the x axis at its two ends (baseline 16px below, `anchor=end` on the right), and 12px to the right of the y axis at its top (baseline 100) and bottom (baseline 440). No arrow characters in the text; the arrowhead already says which way is more. Do not label the middle of an axis.
27
+ - Name each quadrant in its outer corner, 20px in from the axis ends: `eyebrow` with `size=9`, `anchor=end` for the two on the right (baselines 120 above, 428 below).
28
+ - A dot is an `ellipse` 8x8 placed at `x-4, y-4`. Its name starts 16px right of the dot centre with its baseline 4px below the centre.
29
+ - Place a dot by its values, not to look tidy. Work out x and y from the two measures and write the scale in a comment.
30
+ - Keep every dot at least 24px from both axes, and check that no name runs across an axis. If a name would, put it to the left of its dot with `anchor=end`.
31
+ - Twelve items at most. If there are more, merge the ones that sit together or draw two diagrams.
32
+
33
+ ## Focus
34
+
35
+ - One item, the one to act on, is a 12x12 dot in the accent colour with its name in `weight=600 color=ink`. Its quadrant gets the tint and its corner name gets `color=accent weight=600`.
36
+ - Do not fill the four quadrants in four colours. Position carries the meaning.
37
+
38
+ ## Legend
39
+
40
+ The dots are not styles of the look, but `legend` takes dot entries: `legend at 40,472 dot.accent="Start tomorrow" dot.ink="Candidate project"` (32px under the y axis; it draws its own rule, so write no rule line of your own). The axes themselves are written with `->` (head at the high end); any plain rule you add elsewhere is `--`, because `->` grows an arrowhead.
41
+
42
+ ## Variant: four named scenarios
43
+
44
+ When the four cells are futures or options rather than a cloud of items, draw four equal boxes instead of dots: `node` boxes written `280x160` (never `store`: that means data, and many looks draw it as a cylinder) with 24px between a box and each axis, one of them `focal`. Each holds a name (main text) and one line of description (`sub=`). Put heads on both ends of both axes (`<->`) because each axis is then a range between two named poles.
package/guide/radar.md ADDED
@@ -0,0 +1,60 @@
1
+ # Radar charts
2
+
3
+ Compares three to five options on three to five scored criteria. Each option is a polygon; the reader compares shapes: which is large all round, which has a dent.
4
+
5
+ FastDraw has no radar element. Rings and options are `polygon`s, spokes are plain lines.
6
+
7
+ ## Building blocks
8
+
9
+ ```
10
+ // Title y=52. Centre 500,288, radius 160 = score 10, so 16px per point. Five axes, the first straight up, then clockwise.
11
+ // every polygon is written "at 0,0", so its points are absolute coordinates
12
+ title: text "Why we picked MinIO" at 40,52 style=h1
13
+ text "Scores 0 to 10, higher is better · rings every 2" at 40,74 style=caption
14
+ polygon at 0,0 points=500,224;561,268;538,340;462,340;439,268 fill=none stroke=ink/0.1 sw=1 overlap=ok mask=0 // ring at 4
15
+ polygon at 0,0 points=500,128;652,239;594,417;406,417;348,239 fill=none stroke=ink/0.25 sw=1 overlap=ok mask=0 // outer ring, 10
16
+ 500,288 -- 652,239 stroke=ink/0.2 sw=1 // a spoke, written with --
17
+ s3: polygon at 0,0 points=500,192;652,239;585,404;453,353;378,248 fill=link/0.06 stroke=link sw=1.5 overlap=ok mask=0
18
+ minio: polygon at 0,0 points=500,144;622,248;585,404;415,404;363,244 fill=accent/0.14 stroke=accent sw=2 overlap=ok mask=0
19
+ ellipse at 496,140 8x8 fill=accent stroke=none overlap=ok // a dot on each corner of the subject
20
+ text "Small-file handling" at 500,108 anchor=middle size=11 weight=600 color=ink
21
+ legend at 40,476 swatch.accent="MinIO · recommended" swatch.link="Amazon S3"
22
+ ```
23
+
24
+ - Every polygon and dot needs `overlap=ok`, and every polygon `mask=0`, or a later shape hides the earlier ones.
25
+
26
+ ## Working out the points
27
+
28
+ A score `v` on axis `i` is at `centre + v * px per point * direction of axis i`. For N axes the direction of axis `i` (first up, clockwise) is `sin(360° * i / N), -cos(360° * i / N)`. Common ones:
29
+
30
+ | Axes | Directions |
31
+ |---|---|
32
+ | 3 | 0,-1 · 0.866,0.5 · -0.866,0.5 |
33
+ | 4 | 0,-1 · 1,0 · 0,1 · -1,0 |
34
+ | 5 | 0,-1 · 0.951,-0.309 · 0.588,0.809 · -0.588,0.809 · -0.951,-0.309 |
35
+
36
+ Example: score 8 on the second of five axes, 16px per point: `500 + 8*16*0.951, 288 - 8*16*0.309` = `622,248`. Round to whole px.
37
+
38
+ ## Composition
39
+
40
+ - Centre 500,288, radius 160, legend at y=476. The title leaves the top label (baseline 108) clear.
41
+ - Three to five axes and three to five options. With more of either, use a table (`align=center grid=1`). With two options, use grouped bars.
42
+ - All axes share one scale that starts at 0 in the centre (0 to 10, 0 to 5). Convert raw measurements to that scale first. Do not start the rings at a higher value to make differences look bigger.
43
+ - Five rings at equal steps: the inner four `stroke=ink/0.1`, the outer one `ink/0.25`. Spokes `ink/0.2`, written with `--`.
44
+ - Order in the file: rings, spokes, then options from smallest area to largest, the subject last, then its dots.
45
+
46
+ ## Colour
47
+
48
+ - The subject: `stroke=accent sw=2 fill=accent/0.14`, with an 8x8 accent dot on each corner (`at` = corner minus 4).
49
+ - The others: `sw=1.5`, strokes `link`, `muted`, `soft`, each with its own colour at `/0.06` as fill. Keep these fills that faint: several tints on top of each other turn the middle to mud.
50
+ - Dots on the subject only.
51
+
52
+ ## Text
53
+
54
+ - Axis names: one to three words, `size=11 weight=600 color=ink`. Take the point `P` 20px beyond the end of the spoke, along its direction (`end + 20 * direction`). If the direction's x is above 0.3: text starts at `P.x`, baseline `P.y + 4`. Below -0.3: `anchor=end` at `P.x`, baseline `P.y + 4`. Otherwise `anchor=middle` at `P.x`, baseline `P.y` for the top name and `P.y + 10` for a bottom one. For five axes: 500,108 · 671,236 · 606,438 · 394,438 · 329,236.
55
+ - Scale numbers are optional. If written, they go on the first axis only, after the polygons: `small` text, size 8, right-aligned 6px left of the spoke, level with each ring. A polygon edge that runs through a number makes it unreadable (the subject's first corner and its neighbours' edges often do): then leave the numbers out and say the scale in the subtitle ("rings every 2").
56
+ - No values on the corners; the rings carry the scale.
57
+
58
+ ## Legend
59
+
60
+ `legend at 40,476 swatch.accent="MinIO · recommended" swatch.link="..." swatch.muted="..." swatch.soft="..."`: the subject first, with the reason it is the subject.
@@ -0,0 +1,53 @@
1
+ # Sankey diagrams
2
+
3
+ Shows where an amount goes as it splits and merges across three stages: a budget into uses, uses into outcomes. The width of every band is the amount. If the reader does not need to compare amounts, draw a process diagram; if nothing splits or merges, draw a funnel (see `pyramid`).
4
+
5
+ FastDraw has no Sankey element. Bars are thin rects and each band is a `rect` with its own outline: `shape=path path="..."`.
6
+
7
+ ## Building blocks
8
+
9
+ ```
10
+ // title at y=52. Scale: 0.02px per minute (12,000 min = 240px) · bars 12 wide at x = 120, 500, 880
11
+ title: text "Where the CI minutes go" at 40,52 style=h1
12
+ text "TEST STAGE" at 506,108 style=eyebrow anchor=middle
13
+
14
+ // a band from y 332..412 on the left to y 312..392 on the right
15
+ rect at 132,312 368x100 shape=path path="M0,0.2 C0.5,0.2 0.5,0 1,0 L1,0.8 C0.5,0.8 0.5,1 0,1 Z" fill=muted/0.18 stroke=none overlap=ok mask=0
16
+
17
+ e2e: rect at 500,312 12x80 fill=ink stroke=none radius=0
18
+ rect "E2E" sub="4,000 min" at 448,272 116x36 fill=paper stroke=none radius=0 overlap=ok title.weight=600 // label on a paper patch, 4px above the bar
19
+ legend at 40,552 swatch.muted/0.18="Flow" swatch.accent/0.28="The story" swatch.ink="Bar · stage total"
20
+ ```
21
+
22
+ ## Composition
23
+
24
+ - Exactly three columns of bars, left to right, at most eight bars and twelve bands. For a fourth stage, draw a second diagram.
25
+ - Choose one scale for the whole diagram (px per unit) and write it in a comment. Every bar height and band width is `amount * scale`. Choose it so heights land on multiples of 4, and round nothing by more than 4px: a bar that disagrees with the number beside it destroys the diagram's one claim.
26
+ - Bars: `rect ... 12xH fill=ink stroke=none radius=0`, at x=120, 500 and 880. The middle column has the most bars, so lay it out first: first bar top at y=168, 40px between bars (the label patch goes there; 8px in the last column). Then centre the other columns on the same line: `top = middle top + (middle stack height - stack height) / 2`. A single total bar in column 1 is the simple case: its stack is just its height. The legend goes 24px under the middle stack.
27
+ - Every column adds up to the same total. If not, the data has a leak; fix the data, not the picture.
28
+ - A bar's bands leave it stacked top to bottom with no gaps, in the order of the bars they go to; they arrive stacked in the order of the bars they come from. Work out each band's top and bottom y at both ends before writing anything (a short script is the safe way).
29
+ - Order the bars in each column so bands cross as little as possible. A band thinner than 4px cannot be seen: merge it into an "other" band.
30
+
31
+ ## Bands
32
+
33
+ A band runs from the right edge of one bar (x0, from y a to b) to the left edge of the next (x1, from y c to d). Its box is `at x0,top` with size `(x1 - x0) x (bottom - top)`, where top is the smaller of a and c and bottom the larger of b and d. The outline is written in fractions of that box. With `A = (a - top)/height`, and B, C, D likewise:
34
+
35
+ ```
36
+ path="M0,A C0.5,A 0.5,C 1,C L1,D C0.5,D 0.5,B 0,B Z"
37
+ ```
38
+
39
+ - Keep both control points at 0.5. That makes the band leave and arrive level, so it plugs squarely into the bars. Three decimals are enough.
40
+ - Every band needs `stroke=none overlap=ok mask=0`: bands overlap each other's boxes and must show through where they cross.
41
+ - Plain bands are `fill=muted/0.18`. The one path the diagram is about is `fill=accent/0.28`; it may be several bands if they are one story. No other colours. Write the accent bands after the plain ones and the bars after all bands.
42
+ - No arrowheads. Left to right is the direction.
43
+
44
+ ## Text
45
+
46
+ - Column headings in `eyebrow`, typed in capitals, centred over each column, baseline at y=108.
47
+ - Each bar has a name (`weight=600 color=ink`) and its amount 16px below in `small`. First column: to the left of the bar, `anchor=end`, 16px clear, name baseline 4px above the bar's middle. Last column: to the right, 16px clear, the same. Bars under 20px tall still fit this.
48
+ - Middle column: bands pass through the gap above every bar except the first, so a label written there lies on them. The clear way is a paper patch: `rect "Name" sub="amount" at 448,BARTOP-40 116x36 fill=paper stroke=none radius=0 overlap=ok title.weight=600`, centred on the bar, drawn after the bands. It hides the bands for about 56px either side of the bar and nothing else; each band's width is still read at the bars. Without the patch, ink on a pale band is readable but busy.
49
+ - Do not write amounts on the bands.
50
+
51
+ ## Legend
52
+
53
+ One `legend` statement, 24px under the lowest bar: `swatch.muted/0.18="Flow" swatch.accent/0.28="The story" swatch.ink="Bar · stage total"`. Its `title=` may state the point of the accent path in one sentence.
@@ -0,0 +1,73 @@
1
+ # Scatter plots
2
+
3
+ Shows how two measured numbers relate across a set of things: one dot per thing. The reader looks for a trend, clusters and outliers. Two variants: bubble (a third number as dot size) and beeswarm (one number, every item shown).
4
+
5
+ ## Building blocks
6
+
7
+ ```
8
+ // title at y=52, plot 96,96 to 960,412: 43.2px per x unit, 13.17px per y unit
9
+ title: text "Teams that deploy often wait least" at 40,52 style=h1
10
+ dora: chart at 96,96 864x316 x=0..20 xstep=4 y=0..24 step=6 grid=both key=0 xtitle="Deploys per week" ytitle="Lead time (days)"
11
+ | line 1,20 20,1 stroke=ink/0.3 sw=1 dash=4,3 // trend, written first so dots cover it
12
+ | dots "Other teams" 2,20 4,18 4,16 6,14 8,12 fill=muted r=5 opacity=0.55
13
+ | dots "Platform team" 18,3 fill=accent r=6 // the subject, written last
14
+ text "Platform" at 874,394 anchor=middle size=11 weight=600 color=accent
15
+ legend at 40,480 dot.accent="Platform team · ships most often" dot.muted/0.55="Other teams" line.soft="Trend"
16
+ ```
17
+
18
+ - A numeric x axis (`x=lo..hi`) makes every point an `x,y` pair. `grid=both` draws grid lines both ways.
19
+ - The plot ends at y=412. Under it come the tick labels (28px) and `xtitle=` (16px more), so the legend goes at y=480.
20
+ - The legend dot for the plain dots takes the same opacity as the plotted ones: `dot.muted/0.55=`.
21
+
22
+ ## Composition
23
+
24
+ - Five to thirty dots. With fewer, write a sentence instead. With more, use the beeswarm variant or group them.
25
+ - All dots but the subject are one series: `fill=muted r=5 opacity=0.55`. The see-through fill shows where two dots overlap.
26
+ - The subject is a series of its own with one point, `fill=accent r=6`. One accent dot, two at most.
27
+ - Four to six ticks on each axis (`xstep=`, `step=`). Both axes carry a title with the unit.
28
+ - Start an axis at 0 when the size of the number matters. When all values sit far from 0 in a narrow band, start near the smallest value and let the tick labels say so.
29
+ - A trend line is a two-point `line` series, dashed and faint. Add it only when the dots visibly line up; it must pass through the cloud, not along its edge.
30
+ - To split the plot into four fields, add two more dashed two-point lines at the medians and name each field with `eyebrow` text in its outer corner.
31
+
32
+ ## Text
33
+
34
+ - Name the subject and at most two outliers. Not every dot.
35
+ - A value `(vx, vy)` is at `x = plot x + (vx - xmin) / (xmax - xmin) * plot width`, `y = plot bottom - (vy - ymin) / (ymax - ymin) * plot height`. Put the baseline 12px above the dot or 22px below it, `anchor=middle`, on the side where no line and no other dot is.
36
+
37
+ ## Bubble
38
+
39
+ Three numbers per thing: position twice, and size. Use it only when the third number matters to the reading ("bad and big").
40
+
41
+ ```
42
+ bb: chart at 96,96 864x316 x=0..600 xstep=100 xunit=" ms" y=0..5 step=1 unit="%" grid=both key=0 xtitle="p95 latency" ytitle="Error rate"
43
+ | dots 180,1.2 r=42 fill=ink opacity=0.14 // one series per bubble, largest first
44
+ | dots 240,3.8 r=38 fill=accent opacity=0.85
45
+ | dots 420,0.8 r=24 fill=ink opacity=0.25
46
+ | dots 520,2.1 r=11 fill=ink opacity=0.45
47
+ ```
48
+
49
+ - With a numeric x axis the radius belongs to the series (`r=`), so each bubble is its own `dots` row.
50
+ - The area carries the value, not the radius: `r = K * sqrt(value)` with one K for the whole chart, chosen so the largest bubble is about 40px. State the size scale in the legend heading (`title="Area = requests per second"`).
51
+ - Five to fifteen bubbles. Write the largest first so that small ones are drawn on top and stay visible.
52
+ - One accent bubble. The others are `fill=ink`, fainter the larger they are (0.14 for the largest up to 0.45 for the smallest), so that a big bubble does not drown the rest.
53
+ - Name the subject and two or three others, in the middle of the bubble if it is wider than the text, otherwise beside it.
54
+
55
+ ## Beeswarm
56
+
57
+ One number per item and many items (20 to 300): every item is a dot at its true value on one horizontal axis, pushed up or down just far enough not to touch its neighbours. The thickness of the swarm shows where values crowd.
58
+
59
+ ```
60
+ // r=4, so dots need 10px: the plot is 300px high and y runs 0..30, one unit per slot; the middle slot is 15
61
+ bee: chart at 96,96 864x300 x=0..800 xstep=200 xunit=" ms" y=0..30 step=100 yaxis=0 grid=both key=0 xtitle="Request latency"
62
+ | dots 61,15 66,16 86,15 91,16 93,14 95,17 fill=ink r=4 opacity=0.55
63
+ | dots 579,15 fill=accent r=4
64
+ ```
65
+
66
+ - Place the dots in order of value. Each takes the slot nearest the middle (15, 16, 14, 17, 13 ...) in which it stays at least 10px away from every dot already placed. For more than about 40 dots, work the slots out with a short script and paste the pairs.
67
+ - Never move a dot along the value axis to make it fit, and never drop one.
68
+ - `step=100 yaxis=0` hides the vertical scale, which means nothing here. Say so in the legend heading (`title="One dot per request · height has no meaning"`).
69
+ - All dots have the same size and the same fill; one may take the accent. Name it and up to five outliers with `small` text and a thin line to the dot.
70
+
71
+ ## Legend
72
+
73
+ `legend at 40,480` (464 under the beeswarm, whose plot is 16px shorter) with `dot.COLOUR=` entries (the opacity of the plotted dots after a slash: `dot.muted/0.55=`) for the subject and for the rest, and a `line.soft=` entry for a trend line.
@@ -0,0 +1,47 @@
1
+ # Security matrix
2
+
3
+ Shows who may do what: one row per component, one column per role or group, and in each cell the level of access. Use it to audit permissions. It has no arrows; who talks to whom belongs in an integration diagram, and how access is granted in a process diagram.
4
+
5
+ ## Building blocks
6
+
7
+ Title at 40,52 (`style=h1`); the header row starts at y=96. A `table`/`matrix` with `fill.N=` per cell is the short way to a plain matrix, but its cells cannot be bold, carry a second line or have a shaded header band, and its grid is flat: the picture is weaker. Where the level and the one special cell are the message, build the matrix from `rect`s on a fixed grid:
8
+
9
+ ```
10
+ // columns: labels at x=40 (200 wide), then one per role: x = 248 + 144*j, 136 wide
11
+ // rows: header at y=96 (52 high), then y = 160 + 40*k, 36 high
12
+ corner: rect "Component" sub="vs. AD group" at 40,96 200x52 radius=6 fill=card stroke=ink/0.12 title.size=11
13
+ r1: rect "Data Engineer" sub="GRP-DATA-ENG" at 248,96 136x52 radius=6 fill=ink/0.07 stroke=none title.weight=700 sub.color=muted title.size=11
14
+
15
+ c1: rect "Object storage" at 40,160 200x36 radius=4 fill=card stroke=ink/0.12 title.size=11 title.align=left
16
+ text "S3" at 228,181 style=small anchor=end
17
+ c11: rect "Write" at 248,160 136x36 radius=4 title.size=10 title.weight=400 stroke=ink/0.12 fill=card
18
+ ```
19
+
20
+ Four levels, and only four. The cell text is free ("SELECT", "Login", "R/W"); the look of the cell comes from the level it belongs to:
21
+
22
+ | Level | Add to the cell |
23
+ |---|---|
24
+ | Full / admin | `fill=ink/0.12 title.weight=600` |
25
+ | Read and write | `fill=card title.weight=400` |
26
+ | Read only | `fill=muted/0.08 title.color=muted title.weight=400` |
27
+ | No access | `fill=none title.color=soft title.weight=400` |
28
+
29
+ All of them also take `radius=4 title.size=10 stroke=ink/0.12`.
30
+
31
+ ## Composition
32
+
33
+ - Two to six roles, two to fourteen components. More roles: split (people and service accounts). More components: split by area.
34
+ - The grid above fits five roles in 720px (x=248 to 968). For another count keep the 8px gap and share the width: role width = `(720 - 8*(n-1)) / n`, rounded down to a multiple of 4, role j at `x = 248 + (w+8)*j`. Six roles need a wider grid or a 168px label column. Rows start at y=160, 40 apart; the legend rule goes 24px under the last.
35
+ - Order roles from most to least trusted, or the way the organisation lists them; order components the way data moves through them. Rows that read alike should be neighbours.
36
+ - A role header is its name with the group id as `sub=`. A component may carry a short hint (protocol, product) as `small` text right-aligned 12px inside its label cell, baseline 21px below the row top.
37
+ - Fill every cell. A cell with no access says "None"; an empty cell reads as unknown.
38
+ - Name the ids by position (`c23` = row 2, role 3), so a later edit finds the cell.
39
+
40
+ ## Focus
41
+
42
+ - One cell at most is the rule the reader must remember: `fill=accent/0.08 stroke=accent sw=1.4 title.color=accent title.weight=600`, with a second line `sub="shared dashboards" sub.color=accent sub.size=8` that says what is special.
43
+ - Do not tint a whole row or column, and do not add other colours to more than two cells.
44
+
45
+ ## Legend
46
+
47
+ The cells are not styles of the look, so draw the legend by hand, 24px under the last row: a `rule` line across written with `--` (`40,Y -- 960,Y style=rule`), "Legend" in `eyebrow` 20px below it, then for each level you used a `rect` of 16x12 at Y+32 with the level's fill and a `caption` 8px to its right (baseline 10px below the rect's top), each next rect at the last caption's x plus `6 * its characters + 24` ("Read and write" needs 108 in all). Last, the focal swatch with a caption that states the rule in words.
@@ -0,0 +1,39 @@
1
+ # Sequence diagrams
2
+
3
+ Shows messages between participants over time. Time runs downward.
4
+
5
+ FastDraw has no special sequence elements. You build one from boxes, lines and arrows, attached to each other so they stay together when a person drags them in the editor.
6
+
7
+ ## Building blocks
8
+
9
+ ```
10
+ // participants: one row of boxes across the top, same y, same height (56)
11
+ user: external "User" sub="Mobile app" tag="EXT" at 56,72 144x56
12
+ api: node "Orders API" sub="REST" tag="API" at 280,72 144x56
13
+
14
+ // lifelines: a line hanging from each box, all the same length
15
+ user_l: user.bottom -- +0,360 style=lifeline
16
+ api_l: api.bottom -- +0,360 style=lifeline
17
+
18
+ // activation bar: a narrow box centred on a lifeline (lifeline x minus 4), covering
19
+ // the time that participant is busy
20
+ api_bar: bar at 348,180 8x232
21
+
22
+ // messages: horizontal arrows between points at the same y
23
+ user_l@176 -> api_l@176 "POST /orders" style=link
24
+ api_bar.left@408 -> user_l@408 "201 created" style=primary
25
+ ```
26
+
27
+ - A message end is `lifeline@y` (a point on the lifeline) or `bar.left@y` / `bar.right@y` (the edge of an activation bar, when that participant has a bar at that moment). Both ends of a message use the same y.
28
+ - A bar should start a few px after the message that activates it arrives and end a few px after its last message leaves, so attach the first arriving message to the lifeline (`api_l@176`) and later ones to the bar's sides.
29
+ - A message to self: `x_bar.right@284 -> x_bar.right@316 "render"`. Its label is drawn to the right of the loop.
30
+
31
+ ## Composition
32
+
33
+ - Space participants evenly; 224px between lifelines gives labels room. The lifeline x is the centre of its box.
34
+ - Leave 48px between the bottom of the boxes and the first message, then 56px between messages. Self-messages take 32px of height.
35
+ - Order messages strictly top to bottom in the file as in time.
36
+ - Requests are solid. Responses and async messages use the dashed return style. One message, the outcome that matters, uses the primary style. A request arriving from outside uses the link style if the look has one.
37
+ - Labels sit above their arrow. A long arrow that crosses other lifelines should have its label on a stretch between two lifelines where nothing else is: place it with `lpos=x,y` (x is the label centre, y is 10px above the arrow).
38
+ - One participant, the one the diagram is about, gets the accent box style.
39
+ - Lifelines end 24px after the last message. A `legend at x,Y` statement goes 24px below that.
package/guide/state.md ADDED
@@ -0,0 +1,38 @@
1
+ # State machines
2
+
3
+ Shows the states one thing can be in and the events that move it from one to the next.
4
+
5
+ ## Composition
6
+
7
+ - Title at `40,52` (`style=h1`). The main row's top edge is y=200: the arc over the row needs 90px of free space above it, below the title.
8
+ - Every state is a box of the same size, written `160x80` with `radius=8` so it reads as a state and not a component. Main text is the state's name; `sub=` says what is true while in it (small sans).
9
+ - Lay the main sequence out on one row, left to right, all with the same top edge. The gap between states carries a label: 64px holds a label of up to 8 characters, 96px up to 14. Pick one gap for the whole row. State k (from 0) has `x = 120 + k * (160 + gap)`.
10
+ - When the row is full, or a state is a side track or a resting place, put it on a second row: top edge y=344 (64px under the first row), under the state it hangs from.
11
+ - The start is a filled dot and the end a ringed dot. Neither is in the look, so build them from `ellipse`:
12
+
13
+ ```
14
+ start: ellipse at 40,232 16x16 fill=ink stroke=none // 64px left of the first state, centred on its centre y (240)
15
+ end: ellipse at 960,472 16x16 fill=none stroke=ink // 48px under the state it follows, centred on it
16
+ end_dot: ellipse at 963,475 10x10 fill=ink stroke=none overlap=ok // 3px inside the ring
17
+ ```
18
+
19
+ - One state gets `focal`: the one the reader should notice, usually the successful outcome or the error state. A state where the thing merely rests (archived, closed) may use `cloud`. All others use `node`. Do not use `store` for a state: in the built-in look it is a cylinder.
20
+ - Keep the drawing balanced: the second row and the end dot stay within the width of the main row.
21
+
22
+ ## Transitions
23
+
24
+ - Label every transition with the event that causes it. Write `event`, or `event [guard]` when a condition applies; keep it to the 8 or 14 characters the gap holds. A longer label belongs on an arc or a vertical arrow, which have room.
25
+ - Forward transitions are plain arrows and are straight, because the states line up. The transition on the successful path into the focal state uses `style=primary`.
26
+ - A transition back to an earlier state on the row is dashed and arcs over it: `review.top -> draft.top "reject" style=return route=curve`. A second one arcs under the row, `.bottom` to `.bottom`.
27
+ - A transition from a lower row back up to the main row leaves the side or top of the lower state and enters the bottom of the target: `lost.top -> paid.bottom "fixed"` when it sits directly under, or `packed.bottom -> lost.right "bad address"` for a state that is under another column. Two arrows into one side are spread automatically.
28
+ - A transition from a state to itself: `x.top@0.3 -> x.top@0.7 "retry" loop=28`.
29
+ - Rearrange the states before you let two transitions cross.
30
+
31
+ ## Traps
32
+
33
+ - More transitions than twice the number of states: you are drawing two machines. Split them.
34
+ - Something that can happen in any state (a timeout, a cancel) is not drawn from every state. Write it once as text: `text "any state → Failed on timeout" at x,y style=small`.
35
+
36
+ ## Legend
37
+
38
+ One `legend at 40,Y` statement, 24px under the lowest element (the end dot included), with an entry for each box style and arrow style used.
@@ -0,0 +1,29 @@
1
+ # Story maps
2
+
3
+ Shows a whole product story and where the first release stops. Columns are activities in the order the user meets them; rows are releases, most urgent on top. The line under the first release is the point of the diagram: without it you have drawn a backlog. If the columns are states (to do, doing, done), draw a board instead; if you want to show how a person feels along the way, draw a journey.
4
+
5
+ ## Composition
6
+
7
+ - Title: `text "..." at 40,52 style=h1`. The backbone starts at y=96.
8
+ - Columns: 200px wide, 24px apart. Leave an 88px margin on the left for the release names, so the first column starts at x=128 and the next ones at 352, 576, 800 (128 + 224 * i).
9
+ - Row 1, the backbone: one `node` box per activity, `200x64 fill=ink/0.08`, with the activity name as text and `sub="ACTIVITY 1"`. Write them in story order, never by priority. Not `store`: that means data, and many looks draw it as a cylinder.
10
+ - Row 2, the steps: under each activity, one or two `node` boxes 176x32 with `title.weight=400` (lighter than the stories), 12px in from the column edge, y=176 and 216. Keep room for two even where an activity has one, so the bands start level.
11
+ - Rows 3 to 5, the releases: one band per release, 80px high, the full width from x=40 to the last column's right edge, the first at y=272 (24px under the steps), the next at 352, 432. Tint the first, third, ... band: `zone at 40,272 960x80 radius=0 stroke=none` with no text; leave the others empty. Name each band with `text "MVP" at 56,<band middle + 4> style=eyebrow`.
12
+ - Stories: `node` boxes 176x48 with `sub="RPT-101 · 3pt"` (ticket, size), 16px under the top of their band, in the column of their activity. A story with no card in a band leaves the cell empty.
13
+ - When any cell is empty, draw a faint dashed line down each gutter (`x,y -- x,y style=rule dash=4,4`, 12px left of each column, from under the backbone to the bottom of the last band). They tie cards to their column.
14
+ - The release cut: `cut: 40,352 -- 1000,352 "Release cut" style=primary lpos=76,368`, on the border under the first band, across the full width. The label always goes in the left margin, centre x=76, baseline 16px under the line: the cells are full on a full map, and the margin is the one place nothing else sits. It must clear the first gutter line (x=116); `check` warns when it does not.
15
+
16
+ ## Emphasis
17
+
18
+ The accent is used twice: the cut line, and the one story most likely to go wrong. Draw that story as `focal` with `dash=4,3`, and put a small chip on its top edge: `rect "RISK" at x,y 44x12 radius=2 fill=paper stroke=accent sw=0.8 overlap=ok title.font=mono title.size=8 title.weight=400 title.color=accent`, x = card right - 56, y = card top - 6. Do not use `tag=` here: on a 48px card it lands on the title.
19
+
20
+ ## Limits
21
+
22
+ - Five activities, three releases, twelve stories, four stories per band. More than that: one map per activity, or one card that says "6 more".
23
+ - Name releases by scope (MVP, Release 2, Later), not by date.
24
+ - A story is something the user can see ("Public link"), not an engineering task.
25
+ - One kind of user per map. No arrows: position says everything.
26
+
27
+ ## Legend
28
+
29
+ `legend at 40,Y node="Step or story" swatch.ink/0.08="Activity" focal="Riskiest story" line.accent="Release cut"`, 24px under the last band. Use `line.accent=` for the cut: a `primary` entry would show an arrowhead the line does not have.
@@ -0,0 +1,40 @@
1
+ # Swimlane diagrams
2
+
3
+ Shows a process that passes between people or teams: who does each step, and where the work changes hands.
4
+
5
+ ## Lanes
6
+
7
+ One horizontal lane per actor, in the order they first act. The look has no lane style; draw lanes with plain lines (`--`) and text. Title at `40,52` (`style=h1`); the first lane line is y=96. Lanes are 112px tall: lane k (from 0) has its top line at `y = 96 + 112k`. (Tall lanes leave a 64px vertical handoff, long enough for a head and a label.)
8
+
9
+ ```
10
+ 40,96 -- 960,96 stroke=ink/0.22 // top of the first lane
11
+ 40,208 -- 960,208 style=rule // between lanes: one every 112px
12
+ 40,544 -- 960,544 stroke=ink/0.22 // bottom of the last lane (96 + 112 * lanes)
13
+ 160,96 -- 160,544 stroke=ink/0.22 // closes the column that holds the lane names
14
+ text "Reviewer" at 60,268 style=eyebrow // baseline 60px under the lane's top line
15
+ ```
16
+
17
+ - All lanes have the same height. The name column is 120px wide (x 40 to 160). Every lane has a name; keep it to about 14 characters.
18
+ - Three to five lanes. With more, merge actors that never act separately. The lines run as far right as the steps need (x=960 above), all to the same x.
19
+
20
+ ## Steps
21
+
22
+ - A step is a `node` written `120x48` (the default 144x64 does not fit the lane), placed 32px under its lane's top line, so it is centred in the lane. Widths 120 to 136; 80 for a one-word step. Main text is the action; `sub=` (small sans) is the tool or detail.
23
+ - A step belongs to one lane. Never stretch a step across two.
24
+ - Time runs left to right. The first step starts 24px right of the name column (x=184). Leave 40px between steps in the same lane.
25
+ - When work moves to another lane, put the next step straight below (or above) the step that hands over, with the same centre x, so the handoff is a vertical arrow 64px long. If the lanes are not neighbours, or the step would collide, put it one column to the right instead and let the arrow turn once: `pr.right -> review.top`.
26
+ - Give each step at most one arrow in at its top. When a second arrow has to arrive, take it to the left side (`x.left`) or the bottom. Two arrows that leave the same side of one step also run on top of each other for a stretch: send one from the bottom.
27
+ - Lanes need not have the same number of steps. A lane with one step is fine.
28
+ - The step the process exists to reach gets `focal`.
29
+
30
+ ## Arrows
31
+
32
+ - Arrows inside a lane are plain, straight and unlabelled.
33
+ - Arrows that cross a lane line are the handoffs, the point of the diagram. Label them. The handoff that costs most (waiting, coupling, an approval) uses `style=primary`.
34
+ - A step that sends work back for revision uses `style=return`.
35
+ - A label on a segment that crosses a lane line lands on that line, and `check` reports it. Move it into the gap above the line with `lpos=x,y`: x is the segment's x plus 12 plus half the label's width (a label is about 5px wide per character), y is the lane line minus 6. This holds for a vertical handoff and for the vertical leg of an elbow alike. A label on a horizontal leg sits 10px above that leg and needs no `lpos`.
36
+ - If the flow snakes back to the left, reorder the steps or the lanes until it runs mostly left to right and downward.
37
+
38
+ ## Legend
39
+
40
+ One `legend at 40,Y` statement, 32px under the last lane line, with entries for the step, the focal step and each arrow style used.
@@ -0,0 +1,49 @@
1
+ # Timelines
2
+
3
+ Shows events in the order they happened, on one axis, with the distance between them equal to the time between them.
4
+
5
+ FastDraw has no timeline element. You build one from a line, small circles and text. Plain lines (axis, ticks, stems) are written with `--`.
6
+
7
+ ## Building blocks
8
+
9
+ Title at `40,52` (`style=h1`); a one-line `caption` at `40,74` says "Spacing follows real elapsed time." The axis is at `Y = 232` (below). Below, `Y` stands for the axis y.
10
+
11
+ ```
12
+ // the axis, with a short cap at each end and a tick at each boundary that matters
13
+ axis: 80,232 -- 920,232 stroke=muted/0.45 sw=1
14
+ 80,224 -- 80,240 stroke=ink/0.2 sw=1
15
+ text "JAN '26" at 680,254 style=eyebrow anchor=middle color=soft
16
+
17
+ // an event: a stem, a dot centred on the axis, a date, a name, an optional detail
18
+ 240,176 -- 240,232 stroke=ink/0.3 sw=1
19
+ e2: ellipse at 236,228 8x8 fill=ink stroke=none
20
+ text "APR 2025" at 240,148 style=eyebrow anchor=middle
21
+ text "Design v1" at 240,164 anchor=middle weight=600 color=ink
22
+ ```
23
+
24
+ ## Composition
25
+
26
+ - Work out the scale first and write it in a comment: the x of the first date and the px per day, month or year. Every event's x comes from that sum. Never space events evenly because it looks tidier; if two are close in time they are close on the axis.
27
+ - The axis is one horizontal line from x=80 to 920. That length holds five to seven events.
28
+ - A dot is an `ellipse` 8x8 placed at `x-4, Y-4`. A major milestone is 12x12 at `x-6, Y-6` in the accent colour. At most two are major.
29
+ - Labels alternate: one event below the axis, the next above. This is what stops neighbours from colliding. If two events are still closer than their labels are wide (about 110px), give one of them a longer stem (+40px) so its label sits on a second level.
30
+ - Every label is centred on the event's x with `anchor=middle`, three lines on a 16px pitch:
31
+ - **Below**: stem from `Y` to `Y+56`; date baseline `Y+72`, name `Y+88`, detail `Y+104`.
32
+ - **Above, no detail**: stem from `Y-56` to `Y`; name baseline `Y-68`, date `Y-84`.
33
+ - **Above, with detail**: stem from `Y-72` to `Y`; detail baseline `Y-80`, name `Y-96`, date `Y-112`.
34
+ - Put a tick and a small label wherever the unit changes (a new year, a new quarter): tick `Y-8` to `Y+8`, label baseline `Y+22` under it. If an event stem below the axis is within 36px of that x, put the label above instead (baseline `Y-14`). A reader must be able to tell what the unit is without reading every date.
35
+ - A faint large year helps when the timeline spans two or three years: `font=mono size=56 weight=600 color=ink/0.06` with baseline `Y+156`, centred on the middle of that year's stretch. That is under the lowest label (`Y+104`) and above the legend, where it overlaps nothing; `check` reports text that overlaps other text.
36
+
37
+ ## Text
38
+
39
+ - The date is the `eyebrow` style (it does not upper-case: type the capitals), the name is plain text with `weight=600 color=ink`, the detail is `small`. Keep names to two or three words.
40
+ - A major milestone's stem and date take `stroke=accent` and `color=accent`; its name stays ink and may be `size=14`.
41
+
42
+ ## Legend
43
+
44
+ The dots are not styles of the look, but `legend` takes dot entries: `legend at 40,408 dot.ink="Event" dot.accent="Major milestone"` (rule at `Y+176`).
45
+
46
+ ## Traps
47
+
48
+ - If one stretch of the axis is empty for a long time, do not shrink it silently. Either keep it, or cut the axis there: end the line, leave a 16px gap with two short slanted strokes, and start again.
49
+ - A stem must stop short of the label it points at; start it 12px from the nearest text (the positions above do).
package/guide/tree.md ADDED
@@ -0,0 +1,33 @@
1
+ # Tree diagrams
2
+
3
+ Shows a hierarchy of things: a taxonomy, a dependency tree, a breakdown of one idea into parts. For people, teams and who owns what, use the org-chart guide instead.
4
+
5
+ ## Composition
6
+
7
+ - Title at `40,52` (`style=h1`). The root's top edge is y=96. Write `WxH` on every box (the default 144x64 is wrong here).
8
+ - The root sits at the top, centred. Each level is one row; all boxes in a row share a top edge and a height of 48. Rows are 120px apart (48px box, 72px gap): y = 96, 216, 336, 456.
9
+ - Plan from the bottom. Place the leaves first: 144 wide, 24px apart. A row of n leaves is `168n - 24` wide; start it at x=40. Then centre each parent over its own children (its centre x is the mean of its first and last child's centre x), and the root over the centre of the leaf row.
10
+ - Use two box widths at most: 160 for the root and branches, 144 for leaves.
11
+ - When the order of branches means nothing, order them so the tree is symmetrical (for children counts 2, 1, 2 rather than 2, 2, 1).
12
+ - Limits: four levels including the root, and five children under one parent. A bigger tree is split into an overview and one diagram per branch.
13
+ - Never skip a level: a box connects only to the row directly above it.
14
+ - Styles: `focal` for one box, either the root or the one leaf the diagram is about, never both. `node` for branches. `cloud` for leaves, so the bottom row reads as quieter. (Not `store`: that means data, and many looks draw it as a cylinder.)
15
+ - Main text is the name; `sub=` (small sans) is two or three words of detail. Leave `tag=` out: a 48px box has no room for it. Leave icons out too: a tree of text needs none.
16
+
17
+ ## Connectors
18
+
19
+ Connectors are plain lines with square corners: no arrowheads, no diagonals, no labels. Write them with `--` and `style=relation` (a plain `--` is a straight slanted line). Lines that start at the same point share a trunk, so give every child the same start point on the parent and the bus appears by itself, half-way between the rows:
20
+
21
+ ```
22
+ root.bottom@0.5 -- design.top style=relation
23
+ root.bottom@0.5 -- research.top style=relation
24
+ root.bottom@0.5 -- eng.top style=relation
25
+ ```
26
+
27
+ - Do not write `root.bottom -- x.top` without `@0.5`: the lines are then spread along the parent's edge and `check` reports them.
28
+ - A parent with one child: `research.bottom -- investigate.top style=relation`. Keep the two centred on each other so the line is straight.
29
+ - Nothing needs updating by hand when a box moves.
30
+
31
+ ## Legend
32
+
33
+ One `legend at 40,Y` statement, 32px under the leaf row, with an entry for each box style used.
@@ -0,0 +1,67 @@
1
+ # Treemaps
2
+
3
+ Shows how one total divides into parts: each part is a rectangle whose area is its share. The reader sees what dominates and by how much. The marimekko variant splits the total two ways at once.
4
+
5
+ FastDraw has no treemap element. Each cell is a plain `rect` at coordinates you work out, with its labels as free text on top.
6
+
7
+ ## Building blocks
8
+
9
+ ```
10
+ // title at y=52. Whole = 916x380 at 40,96. Asia: 59% of the area = the full height and 59% of the width, less the gap
11
+ title: text "Asia holds 59% of the world's people" at 40,52 style=h1
12
+ asia: rect at 40,96 532x380 radius=2 fill=accent/0.16 stroke=accent sw=1.5
13
+ text "Asia" at 56,124 size=14 weight=600 color=ink // 16px in from the left, baseline 28px down
14
+ text "4.78B · 59% of world" at 56,144 style=small color=muted // 20px below the name
15
+
16
+ africa: rect at 576,96 252x252 radius=2 fill=ink/0.16 stroke=ink/0.3
17
+ text "Africa" at 592,124 size=13 weight=600 color=ink
18
+ text "1.48B · 18%" at 592,144 style=small color=muted
19
+
20
+ legend at 40,500 swatch.accent/0.16="Asia · more than the rest together" swatch.ink/0.16="Other continents" title="Area = population · 8.09B in total"
21
+ ```
22
+
23
+ ## Composition
24
+
25
+ - The whole is a rectangle of 916x380 at 40,96; the legend goes at y=500.
26
+ - Four to eight cells. Merge a long tail into one cell called "Other" and say in the legend what is in it. Never drop a part: the picture claims to be the whole.
27
+ - Layout, largest first, in strips. The free rectangle starts as the whole. Lay each strip along the shorter side of the free rectangle: a column at its left edge when it is wider than tall, a row at its top otherwise. Put the next part in the strip, and keep adding parts while the cells get closer to square (usually one to three per strip).
28
+ - Strip thickness = (strip's share / share of everything still free) x the free rectangle's length across the strip.
29
+ - A cell's length along the strip = (its share / strip's share) x the strip's length.
30
+ - Then the strip leaves the free rectangle; repeat in what is left until the last part fills it.
31
+ - Gap: take 4px off the right and bottom of every cell, never off the outer edge of the whole. The next strip starts at the previous cell's edge plus 4.
32
+ - Cells will not land on multiples of 4. `check` hints at this; leave those hints: areas must follow the data.
33
+ - Check the arithmetic after placing: each cell's `width x height` divided by the sum of all cell areas must be within a few percent of its share. The smallest cell is the one that goes wrong; check it first.
34
+ - Long thin stripes cannot be compared by eye. Never enlarge a cell to make its label fit.
35
+
36
+ ## Colour
37
+
38
+ - One cell, the one the diagram is about, is `fill=accent/0.16 stroke=accent sw=1.5`. It need not be the largest.
39
+ - All others are `stroke=ink/0.3` with `fill=ink/OPACITY` stepping down by rank from 0.16 (largest) to 0.04 (smallest). Not above 0.16: the value text is `muted` and gets hard to read on a darker cell. No colour per cell.
40
+
41
+ ## Text
42
+
43
+ - Labels sit in the top-left corner of the cell. Name: `size=14 weight=600 color=ink` (13 or 12 in smaller cells). Under it, in `small`: the amount and the share.
44
+ - Cells at least 120px wide and 60px high carry name and value. A smaller cell that still fits a short word carries the name only. A sliver (under about 40px either way) gets no text: put a small dot in it (`ellipse 8x8 fill=ink stroke=none`) and explain the dot in the legend with the part's name and value (`dot.ink="Oceania · 0.05B, 0.6%"`).
45
+ - Work out the width of every name (about 8px per character at size 13) and make sure it ends at least 12px before the cell's right edge.
46
+
47
+ ## Marimekko
48
+
49
+ Two splits at once: column width is one share (pipeline), the segments inside a column are the other (runner type).
50
+
51
+ ```
52
+ // column "web": 31% of the total, so 31% of the width less the 4px gap; segments = share within the column of 380px
53
+ w1: rect at 40,96 280x258 radius=2 fill=ink/0.16 stroke=ink/0.3 // Linux, 68% of 380
54
+ w2: rect at 40,354 280x46 radius=2 fill=ink/0.10 stroke=ink/0.3 // macOS, 12%
55
+ w3: rect at 40,400 280x76 radius=2 fill=ink/0.05 stroke=ink/0.3 // Windows, 20%
56
+ text "web · 31%" at 180,492 style=small color=muted anchor=middle // under the column: name and share of the whole
57
+ ```
58
+
59
+ - Three to eight columns, two to five segments. Every column has the full height. Columns are 4px apart; segments in a column touch.
60
+ - The segment order is the same in every column, largest overall on top, and each kind of segment has one fill everywhere (`ink/0.16`, `0.10`, `0.05`), so the legend needs one entry per kind. One segment takes the accent.
61
+ - A kind that does not occur in a column is left out there, not drawn with zero height.
62
+ - Each segment at least 56px high carries its name and `amount · share of column`; from 32px, the same on a tighter pitch (baselines 20 and 34px down); below that, nothing or a dot.
63
+ - Segment heights follow the data and will not be multiples of 4. `check` hints at this; leave those hints.
64
+
65
+ ## Legend
66
+
67
+ One `legend` statement, 24px under the lowest element: `legend at 40,500 swatch.accent/0.16="Asia · more people than the rest together" swatch.ink/0.16="Other continents · a stronger tint is a larger share" dot.ink="Oceania · 0.05B, too small to label" title="Area = population · 8.09B in total"`. The heading says what area means and the total. For the marimekko the column names sit lower: legend at y=512. The tint after the slash is the fill of the cells.