Legible — the line names itself
Variant: Direct labels
Two weeks of deploys with no legend: each series is named, with its last value, at the end of its own line, and the name lands only when the pen gets there — a label for a line that does not exist yet points at nothing. Last week draws first, because "up on last week" means nothing until last week is on the page. The two series differ in more than hue — 2.6px solid with a filled end dot against 1.6px dashed with a hollow one — so the chart still reads in greyscale, on a washed-out projector, or to a reader who cannot tell clay from slate. Each line is revealed by its own clip edge over 840ms, linear because x is time; the label follows in 210ms on ease-out with a 4px slide that says which line it came off. Under reduced motion the pen goes but the order stays: each series cuts in whole with its name already on it, reference first, on a clock 1.6× slower. Reach for it on any multi-series chart where the reader would otherwise bounce between the plot and a key to decode it.
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>Legible — the line names itself</title>
<style>
: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;
--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)
);
/* Text that has to be read stays near full ink; only the scaffolding
(ticks, grid) is allowed to recede. */
--_muted: color-mix(in srgb, var(--slate) 62%, transparent);
--_ref: color-mix(in srgb, var(--slate) 55%, transparent);
--_grid: color-mix(in srgb, var(--oat) 80%, transparent);
--_axis: color-mix(in srgb, var(--slate) 28%, transparent);
/* Clock — 6s: a frame, the reference series, then the current one,
then a long hold where the chart is simply read. */
--cycle: 6s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* {
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);
}
.chart {
width: min(300px, 88vw);
display: grid;
gap: 6px;
animation: frame var(--t) infinite;
}
.label {
font-size: clamp(11px, 3.4vw, 12px);
font-weight: 600;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--_muted);
}
svg {
width: 100%;
height: auto;
display: block;
overflow: visible;
}
.grid {
stroke: var(--_grid);
stroke-width: 1;
}
.axis {
stroke: var(--_axis);
stroke-width: 1;
transform-origin: 0 0;
animation: rule var(--t) infinite;
}
/* Two series that differ in more than hue: weight, dash and end marker
each say "this one" vs "the one before", so the chart survives
greyscale, a projector, and a colour-blind reader alike. */
.now {
fill: none;
stroke: var(--clay);
stroke-width: 2.6;
stroke-linecap: round;
stroke-linejoin: round;
}
.then {
fill: none;
stroke: var(--_ref);
stroke-width: 1.6;
stroke-dasharray: 4 4;
stroke-linejoin: round;
}
.dot-now {
fill: var(--clay-d);
}
.dot-then {
fill: var(--ivory);
stroke: var(--_ref);
stroke-width: 1.6;
}
/* One clip edge per series, linear because x is time. */
.wipe {
transform-origin: 0 0;
animation: var(--t) linear infinite;
}
.wipe-then {
animation-name: wipe-then;
}
.wipe-now {
animation-name: wipe-now;
}
/* The legend, moved to where the eye already is. Name and last value
land the moment the pen reaches the end of the line — not before,
because a label for a line that does not exist yet points at nothing. */
.name {
font-size: 13.5px;
font-weight: 600;
fill: var(--slate);
}
.val {
font-size: 13px;
fill: var(--_muted);
font-variant-numeric: tabular-nums;
}
.tag {
opacity: 0;
animation: var(--t) infinite;
}
.tag-then {
animation-name: tag-then;
}
.tag-now {
animation-name: tag-now;
}
.tick {
fill: var(--_muted);
font-size: 13px;
}
@keyframes frame {
0% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
4%,
90% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
94%,
100% {
opacity: 0;
}
}
@keyframes rule {
0% {
transform: scaleX(0);
animation-timing-function: var(--ease-out);
}
6%,
100% {
transform: scaleX(1);
}
}
/* The reference draws first: "up on last week" means nothing until
last week is on the page to be up on. */
@keyframes wipe-then {
0%,
6% {
transform: scaleX(0.03);
}
20%,
95% {
transform: scaleX(1);
}
96%,
100% {
transform: scaleX(0.03);
}
}
@keyframes wipe-now {
0%,
24% {
transform: scaleX(0.03);
}
38%,
95% {
transform: scaleX(1);
}
96%,
100% {
transform: scaleX(0.03);
}
}
@keyframes tag-then {
0%,
20% {
opacity: 0;
transform: translateX(-4px);
animation-timing-function: var(--ease-out);
}
23.5%,
95% {
opacity: 1;
transform: translateX(0);
}
96%,
100% {
opacity: 0;
transform: translateX(-4px);
}
}
@keyframes tag-now {
0%,
38% {
opacity: 0;
transform: translateX(-4px);
animation-timing-function: var(--ease-out);
}
41.5%,
95% {
opacity: 1;
transform: translateX(0);
}
96%,
100% {
opacity: 0;
transform: translateX(-4px);
}
}
@media (prefers-reduced-motion: reduce) {
/* No pen: each series cuts in whole with its name already on it,
reference first, on a clock 1.6x slower. The order is kept because
it carries the comparison; the travel is dropped. */
.chart {
animation-duration: calc(var(--t) * 1.6);
}
.axis,
.wipe {
animation: none;
}
.g-then,
.g-now,
.tag {
animation-duration: calc(var(--t) * 1.6);
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.g-then,
.tag-then {
animation-name: rm-then;
}
.g-now,
.tag-now {
animation-name: rm-now;
}
@keyframes rm-then {
0% {
opacity: 0;
transform: none;
}
6% {
opacity: 1;
transform: none;
}
96%,
100% {
opacity: 0;
transform: none;
}
}
@keyframes rm-now {
0% {
opacity: 0;
transform: none;
}
24% {
opacity: 1;
transform: none;
}
96%,
100% {
opacity: 0;
transform: none;
}
}
}
</style>
</head>
<body>
<div
class="chart"
role="img"
aria-label="Deploys per day, this week against last week. Last week, dashed, ends Sunday at 23. This week, solid, ends Sunday at 38. Each line is labelled at its own end instead of in a legend."
>
<span class="label">Deploys per day</span>
<svg viewBox="0 0 300 168" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<defs>
<clipPath id="clip-then">
<rect class="wipe wipe-then" x="0" y="0" width="222" height="146" />
</clipPath>
<clipPath id="clip-now">
<rect class="wipe wipe-now" x="0" y="0" width="222" height="146" />
</clipPath>
</defs>
<line class="grid" x1="8" y1="30" x2="292" y2="30" />
<line class="grid" x1="8" y1="70" x2="292" y2="70" />
<line class="grid" x1="8" y1="110" x2="292" y2="110" />
<line class="axis" x1="0" y1="140" x2="300" y2="140" />
<g class="g-then" clip-path="url(#clip-then)">
<path class="then" d="M8 112 L42 106 L76 98 L110 102 L144 90 L178 94 L212 82" />
<circle class="dot-then" cx="212" cy="82" r="3.6" />
</g>
<g class="g-now" clip-path="url(#clip-now)">
<path class="now" d="M8 106 L42 92 L76 98 L110 72 L144 78 L178 58 L212 44" />
<circle class="dot-now" cx="212" cy="44" r="4" />
</g>
<g class="tag tag-now">
<text class="name" x="224" y="44">This week</text>
<text class="val" x="224" y="59">38 / day</text>
</g>
<g class="tag tag-then">
<text class="name" x="224" y="84">Last week</text>
<text class="val" x="224" y="99">23 / day</text>
</g>
<text class="tick" x="8" y="160" text-anchor="start">Mon</text>
<text class="tick" x="110" y="160" text-anchor="middle">Thu</text>
<text class="tick" x="212" y="160" text-anchor="middle">Sun</text>
</svg>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.