---
title: "Isometric Diagrams · Playground · Drew Minns"
description: "A few lines of description in, a small machine out."
url: https://reallygood.work/playground/isometric-diagrams/
---

Playground · 06

# Isometric Diagrams

A few lines of description in, a small machine out.

Interactive diagram: Make, show, listen, adjust. Its definition:

```json
{
  "diagram": "loop",
  "title": "Make, show, listen, adjust",
  "accent": "orange",
  "steps": [
    {
      "id": "make",
      "label": "Make",
      "note": "something real, fast"
    },
    {
      "id": "show",
      "label": "Show",
      "note": "before it feels ready"
    },
    {
      "id": "listen",
      "label": "Listen",
      "note": "don't defend it"
    },
    {
      "id": "adjust",
      "label": "Adjust",
      "note": "one change at a time"
    }
  ]
}
```

Make, show, listen, adjust

Layout

PipelineStackLoopSystem

Steps

4

Accent

BlueOrange

Title

How it works

Four layouts (pipeline, stack, loop and system) built from the same few parts: planes, blocks, wires, a travelling packet, gauges and labels.

State is shown with texture: waiting is an outline, happening now is dither, done is faint halftone. Press play and leave the loop running.

```js
// the whole diagram above is this description
{
  diagram: 'pipeline',
  steps: [
    { id: 'notes',   label: 'Notes',   note: 'messy, on paper' },
    { id: 'draft',   label: 'Draft',   note: 'just get it down' },
    { id: 'edit',    label: 'Edit',    note: 'cut it in half', loop: 'draft' },
    { id: 'publish', label: 'Publish', note: 'ship it, imperfect' },
  ],
  interact: ['send'],
}
```

Make it yourself

A small version of the kit in one file, with no libraries: a list of steps in, isometric blocks and wires out. Save it as an .html file and open it. The settings at the top follow the controls above.

isometric-diagram.html

```html
<!doctype html>
<meta charset="utf-8">
<title>Isometric Diagram</title>
<style>
  body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #f4f1ea; color: #15130f; font-family: ui-monospace, monospace; }
  main { display: grid; gap: 16px; justify-items: center; padding: 24px; }
  h1 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
  svg { width: min(92vw, 760px); height: auto; overflow: visible; }
  .f { stroke: #15130f; stroke-width: 1.1; stroke-linejoin: round; }
  .wire { fill: none; stroke: #15130f; stroke-width: 1.1; }
  .wire.live { stroke: var(--acc); stroke-width: 2.2; }
  .lift { transition: transform 280ms cubic-bezier(.3, 1.4, .5, 1); }
  text { font: 11px ui-monospace, monospace; letter-spacing: .09em; fill: #15130f; }
  .now text { fill: var(--acc); }
  #note { margin: 0; min-height: 1.2em; font: italic 24px Georgia, serif; }
</style>
<main>
  <h1 id="title"></h1>
  <svg id="dg"></svg>
  <p id="note"></p>
</main>
<script>
const settings = {
  layout: 'loop',   // 'pipeline' (a row, left to right) or 'loop' (a ring). This file draws only those two, so 'stack' draws as a pipeline and 'system' as a loop
  accent: 'orange',   // 'blue' or 'orange': the colour of the step that's happening now
  title: 'Make, show, listen, adjust',     // the heading above the diagram
  count: 4,     // how many of the steps below to draw
};

// the steps, in order. Each one becomes a block; the note shows while it's the step happening now
const STEPS = {
  pipeline: [['Notes', 'messy, on paper'], ['Draft', 'just get it down'], ['Edit', 'cut it in half'], ['Publish', 'ship it, imperfect'], ['Share', 'send it to one person'], ['Hear back', 'what did they take from it?']],
  loop: [['Make', 'something real, fast'], ['Show', 'before it feels ready'], ['Listen', "don't defend it"], ['Adjust', 'one change at a time'], ['Write', 'note what changed'], ['Rest', 'step away for a day']],
};
const layout = settings.layout === 'pipeline' || settings.layout === 'stack' ? 'pipeline' : 'loop';
const steps = STEPS[layout].slice(0, settings.count);
const ACC = { blue: '#0044ff', orange: '#e5401a' }[settings.accent] || '#0044ff';
document.getElementById('title').textContent = settings.title;
document.body.style.setProperty('--acc', ACC);

// isometric projection: x runs down-right, y runs down-left, z goes straight up. One unit is 32px
const U = 32, C30 = Math.cos(Math.PI / 6);
const P = (x, y, z = 0) => [(x - y) * C30 * U, (x + y) * 0.5 * U - z * U];
const pts = list => list.map(p => P(...p).map(v => v.toFixed(1)).join(',')).join(' ');
const svg = document.getElementById('dg'), NS = 'http://www.w3.org/2000/svg';
const el = (tag, attrs, parent = svg) => { const e = document.createElementNS(NS, tag); for (const k in attrs) e.setAttribute(k, attrs[k]); parent.appendChild(e); return e; };

// "happening now" is ordered dither in the accent: a 4×4 Bayer matrix decides which 2px cells get ink, so each face gets its own tone
const defs = el('defs', {}), B4 = [[0, 8, 2, 10], [12, 4, 14, 6], [3, 11, 1, 9], [15, 7, 13, 5]];
for (const tone of [30, 50, 85]) {
  const p = el('pattern', { id: `d${tone}`, width: 8, height: 8, patternUnits: 'userSpaceOnUse' }, defs);
  el('rect', { width: 8, height: 8, fill: '#fbf7ee' }, p);
  for (let y = 0; y < 4; y++) for (let x = 0; x < 4; x++) if ((B4[y][x] + 0.5) / 16 < tone / 100) el('rect', { x: x * 2, y: y * 2, width: 2, height: 2, fill: ACC }, p);
}
const REST = ['#fbf7ee', '#ddd4c0', '#efe8d8'], NOW = ['url(#d30)', 'url(#d85)', 'url(#d50)'];   // top, left, right faces

// a box is three faces: the top, and the two sides that face us
function box(g, x, y, w, d, h, z = 0) {
  return [
    el('polygon', { class: 'f', points: pts([[x, y, z + h], [x + w, y, z + h], [x + w, y + d, z + h], [x, y + d, z + h]]) }, g),
    el('polygon', { class: 'f', points: pts([[x, y + d, z + h], [x + w, y + d, z + h], [x + w, y + d, z], [x, y + d, z]]) }, g),
    el('polygon', { class: 'f', points: pts([[x + w, y, z + h], [x + w, y + d, z + h], [x + w, y + d, z], [x + w, y, z]]) }, g),
  ];
}

// lay the steps out: where each block sits, and the wire that leads into it
const n = steps.length, B = layout === 'pipeline' ? 2 : 1.5, H = layout === 'pipeline' ? 1.1 : 0.9, R = 3.7;
const ang = i => -Math.PI * 0.75 + i * 2 * Math.PI / n;
const spot = i => layout === 'pipeline' ? [i * (B + 1.8), 0] : [R * Math.cos(ang(i)) - B / 2, R * Math.sin(ang(i)) - B / 2];
const wireInto = i => layout === 'pipeline'
  ? (i ? [[spot(i - 1)[0] + B, B / 2, 0], [spot(i)[0], B / 2, 0]] : null)
  : Array.from({ length: 17 }, (_, k) => { const a = ang(i - 1) + (2 * Math.PI / n) * k / 16; return [R * Math.cos(a), R * Math.sin(a), 0]; });

const wires = steps.map((_, i) => { const p = wireInto(i); return p && el('polyline', { class: 'wire', points: pts(p) }); });
// blocks further back are drawn first, so nearer ones sit on top
const blocks = steps.map(([label], i) => ({ i, label, at: spot(i) })).sort((a, b) => a.at[0] + a.at[1] - (b.at[0] + b.at[1])).map(b => {
  const g = el('g', {}), lift = el('g', { class: 'lift' }, g), faces = box(lift, b.at[0], b.at[1], B, B, H);
  const [lx, ly] = P(b.at[0] + B / 2, b.at[1] + B / 2, H);
  el('line', { x1: lx, y1: ly - 3, x2: lx, y2: ly - 31, stroke: '#15130f', 'stroke-width': 0.9 }, lift);
  el('text', { x: lx, y: ly - 36, 'text-anchor': 'middle' }, lift).textContent = b.label.toUpperCase();
  return { ...b, g, lift, faces };
});
const packet = el('g', { opacity: 0 }); box(packet, 0, 0, 0.55, 0.55, 0.55).forEach((f, k) => f.setAttribute('fill', NOW[k]));

// fit the drawing to what's in it
const bb = svg.getBBox();
svg.setAttribute('viewBox', `${bb.x - 20} ${bb.y - 20} ${bb.width + 40} ${bb.height + 40}`);

// send the packet along a wire: ease out with a small overshoot, so it lands like a part clicking into place
function send(path) {
  if (!path) return packet.setAttribute('opacity', 0);
  const segs = path.slice(1).map((b, k) => [path[k], b, Math.hypot(b[0] - path[k][0], b[1] - path[k][1])]), L = segs.reduce((s, q) => s + q[2], 0);
  const ease = t => { t -= 1; return t * t * (2.4 * t + 1.4) + 1; }, t0 = performance.now(), dur = Math.min(720, 260 + L * 55);
  packet.setAttribute('opacity', 1);
  (function frame(now) {
    const t = Math.min(1, (now - t0) / dur); let d = ease(t) * L, i = 0;
    while (i < segs.length - 1 && d > segs[i][2]) d -= segs[i++][2];   // find the segment the packet is on
    const [a, b, l] = segs[i], k = l ? d / l : 0, [x, y] = P(a[0] + (b[0] - a[0]) * k - 0.275, a[1] + (b[1] - a[1]) * k - 0.275);
    packet.setAttribute('transform', `translate(${x.toFixed(1)} ${y.toFixed(1)})`);
    if (t < 1) requestAnimationFrame(frame); else setTimeout(() => packet.setAttribute('opacity', 0), 160);
  })(t0);
}

// one step: that block goes to dither and lifts, its wire lights up, the packet travels in
let k = -1;
function step() {
  k = (k + 1) % n;
  for (const b of blocks) {
    const now = b.i === k;
    b.faces.forEach((f, j) => f.setAttribute('fill', (now ? NOW : REST)[j]));
    b.g.setAttribute('class', now ? 'now' : '');
    b.lift.style.transform = `translateY(${now ? -7 : 0}px)`;
  }
  wires.forEach((w, i) => w && w.classList.toggle('live', i === k));
  send(wireInto(k));
  document.getElementById('note').textContent = steps[k][1];
}
step();
setInterval(step, 1400);
</script>
```

-   [Previous piece — Soft Grain](https://reallygood.work/playground/soft-grain/)
-   [Next piece — Type Bands](https://reallygood.work/playground/type-bands/)
