Spread — samples knot into a histogram
Variant: Knot histogram
Twenty-four response times arriving one at a time as knots on hanging cords, one cord per latency bin — the quipu reading of a histogram, where a bin is a thread and a sample is a knot tied on it. Each knot falls only as far as the knot it lands on, on a squared curve — slow off the top, fastest at contact — and in a time that scales with the square root of the drop, 270ms to the floor and 175ms onto the tallest stack, because that is how a weight drops. The timeout cord hangs apart from the main cord on a dashed thread: it is not the next bin along, it is everything that never came back. The shape is the point, so it is built in arrival order rather than drawn bin by bin: two timeouts land on their own cord early, long before the bulk of the distribution has shown where the middle is, which is exactly when an average would have hidden them. One registered number drives the whole stagger and a second one clears every knot at once at the end of the loop, instead of in the order they arrived — a per-knot delay longer than the dark window would leave last cycle’s knots on screen. Reach for it to explain sampling, or anywhere a single latency number is about to be shown without its shape.
The source
A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Spread — samples knot into a histogram</title>
<style>
/* One registered number drives all 24 knots. Each knot reads its own
progress off it, so arrivals are staggered without per-knot delays —
a delay longer than the loop's dark window would leave last cycle's
knots on screen while the next ones fall. */
@property --_p {
syntax: '<number>';
inherits: true;
initial-value: -1;
}
@property --_v {
syntax: '<number>';
inherits: true;
initial-value: 1;
}
:root {
/* Neutrals — fixed, never remixed. */
--ivory: #faf9f5;
--paper: #ffffff;
--oat: #e3dacc;
--slate: #141413;
/* Knobs — the remix API. A knob exists iff declared here and used below. */
--hue: 38.8;
--lift: 0;
--chroma: 1;
--round: 1;
--speed: 1;
/* Accents — derived from the knobs with the family's offsets baked in,
so one hue roll moves them together. Defaults reproduce the original hex. */
--clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
--clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
--olive: oklch(
calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
);
--rust: oklch(
calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
);
/* Clock — 7.2s: 360ms empty, ~4s of arrivals at one every 152ms, a
2s hold on the finished shape, then the knots clear together. */
--cycle: 7.2s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--_muted: color-mix(in srgb, var(--slate) 50%, transparent);
--_thread: color-mix(in srgb, var(--slate) 16%, transparent);
--_late: color-mix(in srgb, var(--rust) 45%, transparent);
--_main: color-mix(in srgb, var(--slate) 38%, transparent);
--_plot: 104px;
--_knot: 10px;
--_step: 11px;
/* Progress units a knot takes to fall from the top of the cord. */
--_fall: 1.8;
/* How fast a knot fades in, per progress unit. */
--_fade: 4;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
color: var(--slate);
}
.card {
width: min(280px, 86vw);
padding: 14px 16px 12px;
background: var(--paper);
border: 1px solid var(--oat);
border-radius: calc(10px * var(--round));
display: grid;
gap: 10px;
}
.head {
display: flex;
justify-content: space-between;
align-items: baseline;
font-size: 12px;
}
.head b {
font-weight: 600;
}
.head span {
color: var(--_muted);
}
/* The primary cord the pendants hang from — the quipu reading of a
histogram, where a bin is a thread and a sample is a knot on it. */
.plot {
position: relative;
height: var(--_plot);
display: flex;
border-bottom: 1px solid var(--_thread);
animation:
arrive var(--t) linear infinite,
clear var(--t) infinite;
}
.cord {
position: relative;
flex: 1;
border-top: 2px solid var(--_main);
}
/* The timeout cord hangs apart from the main cord: it is not the next
bin along, it is everything that never came back. */
.brk {
flex: 1;
}
.cord::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 50%;
width: 1px;
background: var(--_thread);
}
/* Progress is linear in the shared clock and squared here, so every
knot falls the way a weight does: slow off the top, fastest at the
moment it lands. It falls only as far as the knot it lands on, and
the time scales with the square root of that distance — 270ms off
the bottom of the stack, 175ms onto the top of the tallest one. */
.cord i {
--_f: calc(var(--_fall) - var(--_l) * 0.13);
--_x: clamp(0, calc((var(--_p) - var(--_i)) / var(--_f)), 1);
--_drop: calc(var(--_plot) - var(--_knot) - var(--_l) * var(--_step));
position: absolute;
left: 50%;
bottom: calc(1px + var(--_l) * var(--_step));
width: var(--_knot);
height: var(--_knot);
margin-left: calc(var(--_knot) / -2);
border-radius: 50%;
background: var(--clay);
box-shadow: inset 0 0 0 1.5px var(--clay-d);
opacity: calc(clamp(0, calc((var(--_p) - var(--_i)) * var(--_fade)), 1) * var(--_v));
transform: translateY(calc((var(--_x) * var(--_x) - 1) * var(--_drop)));
}
.tail i {
background: var(--rust);
box-shadow: none;
}
.tail {
border-top-style: dashed;
border-top-color: var(--_late);
}
.tail::before {
background: var(--_late);
}
.axis {
display: grid;
grid-template-columns: repeat(9, 1fr);
text-align: center;
white-space: nowrap;
font-size: 11px;
color: var(--_muted);
font-variant-numeric: tabular-nums;
}
.axis span:nth-child(1) {
grid-column: 1;
}
.axis span:nth-child(2) {
grid-column: 7;
}
.axis .late {
grid-column: 9;
color: var(--rust);
}
@keyframes arrive {
0%,
5% {
--_p: -1;
}
60%,
100% {
--_p: 25;
}
}
/* All knots leave at once, whatever order they came in: the shape was
the reading, so it goes as one. */
@keyframes clear {
0%,
88% {
--_v: 1;
animation-timing-function: var(--ease-out);
}
94%,
100% {
--_v: 0;
}
}
@media (prefers-reduced-motion: reduce) {
/* No fall: knots fade in where they rest, in the same order, on a
loop twice as long. The histogram still assembles one sample at a
time — that is the information — it just stops dropping. */
.cord i {
--_drop: 0px;
--_fade: 1;
}
.plot {
animation-duration: calc(var(--t) * 2);
}
}
</style>
</head>
<body>
<div
class="card"
role="img"
aria-label="A histogram of response times built as knots on hanging cords. Twenty-four samples fall one at a time onto the cord for their latency bin and stack up; most gather in the middle bins, and two land on a separate cord at the far right marked timeout"
>
<div class="head"><b>Response time</b><span>last 24 requests</span></div>
<div class="plot">
<span class="cord"><i style="--_l: 0; --_i: 13"></i></span>
<span class="cord"
><i style="--_l: 0; --_i: 16"></i><i style="--_l: 1; --_i: 18"></i
><i style="--_l: 2; --_i: 19"></i
></span>
<span class="cord"
><i style="--_l: 0; --_i: 0"></i><i style="--_l: 1; --_i: 4"></i
><i style="--_l: 2; --_i: 8"></i><i style="--_l: 3; --_i: 12"></i
><i style="--_l: 4; --_i: 22"></i
></span>
<span class="cord"
><i style="--_l: 0; --_i: 5"></i><i style="--_l: 1; --_i: 10"></i
><i style="--_l: 2; --_i: 14"></i><i style="--_l: 3; --_i: 15"></i
><i style="--_l: 4; --_i: 21"></i><i style="--_l: 5; --_i: 23"></i
></span>
<span class="cord"
><i style="--_l: 0; --_i: 1"></i><i style="--_l: 1; --_i: 3"></i
><i style="--_l: 2; --_i: 11"></i><i style="--_l: 3; --_i: 17"></i
></span>
<span class="cord"><i style="--_l: 0; --_i: 9"></i><i style="--_l: 1; --_i: 20"></i></span>
<span class="cord"><i style="--_l: 0; --_i: 7"></i></span>
<span class="brk"></span>
<span class="cord tail"
><i style="--_l: 0; --_i: 2"></i><i style="--_l: 1; --_i: 6"></i
></span>
</div>
<div class="axis"><span>30ms</span><span>180ms</span><span class="late">timeout</span></div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.