The d3 pack

27 macros, counted from the pack's code when this page was built. Each takes a few parameters and returns an SVG drawing, a text alternative and a data table, inside a Card of Basic Catalog components.

Six examples

Each one was drawn from the pack's own demo parameters and saved as a file when this page was built; this page does not call a server.

How the sizes were measured (15 Nov 2026): the call is the compact JSON {"macro", "params"}; the message is the compact JSON of the first A2UI message the client receives (createSurface, with its data model holding the SVG as a data: URL). Both are UTF-8 bytes.

Treemap treemap

Treemap: Cloud spend. Total 158 k USD in 8 items and 4 categories; the largest item is VMs (40, 25%) and the largest category is Compute (41%).

The macro call is 465 bytes; the A2UI message it expands to is 6,921 bytes, of which the SVG is 3,941 bytes. Components in that message: Button, Card, Column, Image, Row, Text.

The macro call
{
 "macro": "treemap",
 "params": {
  "items": [
   {
    "category": "Compute",
    "name": "VMs",
    "value": 40
   },
   {
    "category": "Compute",
    "name": "Batch",
    "value": 25
   },
   {
    "category": "Storage",
    "name": "Archive",
    "value": 30
   },
   {
    "category": "Storage",
    "name": "Hot",
    "value": 10
   },
   {
    "category": "Network",
    "name": "Egress",
    "value": 22
   },
   {
    "category": "Data",
    "name": "Warehouse",
    "value": 18
   },
   {
    "category": "Data",
    "name": "Streams",
    "value": 9
   },
   {
    "category": "Data",
    "name": "Catalog",
    "value": 4
   }
  ],
  "unit": "k USD",
  "title": "Cloud spend"
 }
}

Sankey flow sankey_flow

Sankey flow: Budget flow. 7 nodes in 3 columns, 6 flows; the largest flow is Revenue to Costs (70).

The macro call is 566 bytes; the A2UI message it expands to is 5,829 bytes, of which the SVG is 3,432 bytes. Components in that message: Card, Column, Image, Text.

The macro call
{
 "macro": "sankey_flow",
 "params": {
  "title": "Budget flow",
  "nodes": [
   {
    "id": "rev",
    "label": "Revenue"
   },
   {
    "id": "cost",
    "label": "Costs"
   },
   {
    "id": "profit",
    "label": "Profit"
   },
   {
    "id": "staff",
    "label": "Staff"
   },
   {
    "id": "cloud",
    "label": "Cloud"
   },
   {
    "id": "tax",
    "label": "Tax"
   },
   {
    "id": "keep",
    "label": "Retained"
   }
  ],
  "links": [
   {
    "source": "rev",
    "target": "cost",
    "value": 70
   },
   {
    "source": "rev",
    "target": "profit",
    "value": 30
   },
   {
    "source": "cost",
    "target": "staff",
    "value": 45
   },
   {
    "source": "cost",
    "target": "cloud",
    "value": 25
   },
   {
    "source": "profit",
    "target": "tax",
    "value": 9
   },
   {
    "source": "profit",
    "target": "keep",
    "value": 21
   }
  ]
 }
}

Ridgeline ridgeline

Ridgeline: Task time by team. 3 series, 182 values in 10 bins from 0 to 100 min; the highest ridge is Team B at 60 to 70 (27 of its 60 values).

The macro call is 1,074 bytes; the A2UI message it expands to is 5,846 bytes, of which the SVG is 3,084 bytes. Components in that message: Card, Column, Image, Text.

The macro call
{
 "macro": "ridgeline",
 "params": {
  "groups": [
   {
    "name": "Team A",
    "values": [
     47.4,
     55.1,
     47.7,
     46.8,
     40.7,
     47.9,
     61.1,
     54.2,
     60.4,
     52.5,
     53.9,
     51.9,
     33.3,
     58.6,
     55.1,
     55.0,
     33.1,
     32.6,
     41.1,
     45.3,
     53.1,
     49.5,
     55.2,
     43.6,
     53.1,
     53.9,
     43.4,
     67.2,
     55.6,
     62.0,
     43.8,
     42.6,
     46.6,
     48.9,
     56.3,
     52.5,
     45.5,
     40.4,
     44.8,
     62.2,
     41.9,
     52.4,
     54.3,
     35.1,
     50.5,
     63.1,
     29.9,
     46.8,
     48.9,
     41.8,
     55.0,
     49.4,
     35.4,
     58.3,
     56.7,
     59.5,
     64.4,
     53.6,
     51.2,
     37.0
    ]
   },
   {
    "name": "Team B",
    "values": [
     66.3,
     57.7,
     58.8,
     53.1,
     55.2,
     58.3,
     71.0,
     47.8,
     51.8,
     63.7,
     72.1,
     66.0,
     48.7,
     44.4,
     64.5,
     56.8,
     54.2,
     68.8,
     69.7,
     63.1,
     63.7,
     65.0,
     73.2,
     66.3,
     65.6,
     65.8,
     51.0,
     71.0,
     68.7,
     65.7,
     48.2,
     57.6,
     67.9,
     49.3,
     60.7,
     69.1,
     52.8,
     73.3,
     65.9,
     60.9,
     64.3,
     66.5,
     62.8,
     70.0,
     57.4,
     59.1,
     69.3,
     62.2,
     55.8,
     68.6,
     72.3,
     58.9,
     52.3,
     61.1,
     61.0,
     59.9,
     71.8,
     54.8,
     70.8,
     53.1
    ]
   },
   {
    "name": "Team C",
    "values": [
     29.0,
     48.8,
     55.8,
     52.0,
     44.8,
     42.0,
     42.1,
     48.1,
     37.5,
     43.9,
     48.0,
     40.0,
     50.7,
     47.9,
     68.1,
     44.5,
     34.0,
     34.8,
     39.8,
     52.9,
     35.3,
     45.4,
     65.7,
     4.1,
     24.3,
     43.4,
     45.6,
     43.3,
     34.0,
     49.2,
     43.9,
     32.7,
     74.0,
     45.0,
     32.2,
     38.6,
     36.8,
     39.1,
     1.8,
     33.2,
     54.1,
     23.6,
     39.1,
     53.3,
     52.0,
     60.9,
     16.2,
     35.1,
     35.2,
     48.7,
     55.3,
     2.4,
     55.2,
     19.7,
     49.6,
     19.1,
     42.5,
     56.7,
     37.9,
     42.7,
     95,
     99
    ]
   }
  ],
  "unit": "min",
  "title": "Task time by team"
 }
}

Connect Four connect_four

Connect four: Connect Four, mid-game. Connect Four board, 6 rows by 7 columns. Red 5 discs, Yellow 4 discs. Newest disc: Red in column 3.

The macro call is 168 bytes; the A2UI message it expands to is 33,741 bytes, of which the SVG is 4,589 bytes. Components in that message: Button, Card, Column, Image, Row, Text.

The macro call
{
 "macro": "connect_four",
 "params": {
  "title": "Connect Four, mid-game",
  "cells": [
   ".......",
   ".......",
   "...Y...",
   "..RY...",
   "..RR...",
   ".YRYR.."
  ],
  "last": [
   3,
   2
  ],
  "view": "oblique"
 }
}

Brick build brick_build

Brick build: A small house. 16 bricks in 4 layers, 3 different parts. Build check: no overlaps, every upper brick has support, everything is connected to the plate.

The macro call is 825 bytes; the A2UI message it expands to is 28,282 bytes, of which the SVG is 19,670 bytes. Components in that message: Button, Card, Column, Image, Row, Text.

The macro call
{
 "macro": "brick_build",
 "params": {
  "title": "A small house",
  "bricks": [
   {
    "x": 0,
    "y": 0,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 0,
    "y": 1,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 0,
    "y": 2,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 2
   },
   {
    "x": 0,
    "y": 0,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 0,
    "y": 1,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 0,
    "y": 2,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 2
   },
   {
    "x": 2,
    "y": 0,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 2,
    "y": 1,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 2,
    "y": 2,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 2
   },
   {
    "x": 4,
    "y": 0,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 4,
    "y": 1,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 4,
    "y": 2,
    "z": 0,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 2
   },
   {
    "x": 4,
    "y": 0,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 4,
    "y": 1,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 0
   },
   {
    "x": 4,
    "y": 2,
    "z": 2,
    "w": 2,
    "d": 2,
    "h": 1,
    "c": 2
   },
   {
    "x": 0,
    "y": 3,
    "z": 0,
    "w": 6,
    "d": 4,
    "h": 1,
    "c": 3
   }
  ],
  "palette": [
   "#c2182b",
   "#2f6fd8",
   "#f5c518",
   "#3b3f4a"
  ]
 }
}

Latency ledger latency_ledger

Latency ledger: Booking week, one picture. express-macro · first render · payload 11 KB (4.1 KB gzip). 63 ms of a 100 ms budget: server 8.8 of 20, network 14 of 30, client 40 of 50. Every owner is inside its own cap.

The macro call is 874 bytes; the A2UI message it expands to is 13,171 bytes, of which the SVG is 8,396 bytes. Components in that message: Button, Card, Column, Image, Row, Text.

The macro call
{
 "macro": "latency_ledger",
 "params": {
  "spans": [
   {
    "stage": "route",
    "owner": "server",
    "ms": 0.3,
    "phase": "route",
    "source": "agent"
   },
   {
    "stage": "draw macro",
    "owner": "server",
    "ms": 6.5,
    "phase": "build",
    "source": "agent"
   },
   {
    "stage": "verify svg",
    "owner": "server",
    "ms": 1.2,
    "phase": "build",
    "source": "agent"
   },
   {
    "stage": "serialise",
    "owner": "server",
    "ms": 0.8,
    "phase": "wrap",
    "source": "agent"
   },
   {
    "stage": "network",
    "owner": "network",
    "ms": 14.0,
    "phase": "transmit",
    "source": "harness"
   },
   {
    "stage": "process",
    "owner": "client",
    "ms": 1.0,
    "phase": "process",
    "source": "page"
   },
   {
    "stage": "commit",
    "owner": "client",
    "ms": 1.0,
    "category": "media",
    "phase": "render",
    "source": "page"
   },
   {
    "stage": "decode + paint",
    "owner": "client",
    "ms": 38.0,
    "category": "media",
    "phase": "paint",
    "source": "page"
   }
  ],
  "title": "Booking week, one picture",
  "delivery": "express-macro",
  "kind": "first",
  "update": "none",
  "payload": {
   "bytes": 11264,
   "gzip_bytes": 4198
  }
 }
}

← All Macro Packs