Back to the library

Unit chart — waffle filled by report

Variant: Waffle by report

A hundred-cell waffle that fills the way data actually arrives: in three reports of 24, 27 and 12 — runs of 448, 448 and 320ms, each followed by dead stillness, never a creep. The empty grid holds for 448ms before anything lands, because a share means nothing until its hundred is on screen, and the grid fills bottom-up in rows of ten so the tens digit can be read off the row count without reading the number at all. Every cell takes its place in the cascade from one registered number, four units wide, settling from 0.92 scale, so a run has a front of half-landed cells instead of a flicker — and because the number decelerates, the front slows as the report settles. The count is animated in the same keyframes on the same curve, so the numeral cannot drift from the grid. The newest report stays clay, with a matching "+27 new" beside the total, until the next one starts landing; then it settles into a muted grey-brown, quieter than the news, because old data is still data but stops asking to be looked at. Reach for it on goal trackers, quota shares and survey tallies where "how much of the whole" and "how much just now" are both the question.

datachartcounterstaggerentranceloop

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>Unit chart — waffle by report</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;
        --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)
        );

        --_muted: color-mix(in srgb, var(--slate) 52%, transparent);
        --_settled: color-mix(in oklab, var(--slate) 55%, var(--oat));

        /* Clock — 6.4s, so 1% is 64ms. Reports land at 7/33/59%; each run is
           448ms except the last, which carries half the cells and takes 320ms. */
        --cycle: 6.4s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
      }

      /* One registered number drives every cell; --_n is the count, animated
         in the same keyframes on the same curve so the numeral cannot drift
         from the grid. */
      @property --_p {
        syntax: '<number>';
        inherits: true;
        initial-value: 0;
      }

      @property --_n {
        syntax: '<integer>';
        inherits: true;
        initial-value: 0;
      }

      @property --_d {
        syntax: '<integer>';
        inherits: true;
        initial-value: 0;
      }

      * {
        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);
      }

      .scene {
        --_w: min(184px, 54vw, 58vh);
        width: var(--_w);
        display: grid;
        gap: clamp(8px, 2.4vh, 12px);
        animation:
          fill var(--t) infinite,
          scene-reset var(--t) infinite;
      }

      .head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        font-variant-numeric: tabular-nums;
      }

      .count {
        font-size: clamp(18px, 6.4vh, 24px);
        font-weight: 600;
        letter-spacing: -0.01em;
        counter-reset: n var(--_n);
      }

      .count::before {
        content: counter(n);
      }

      .count span {
        font-size: 12px;
        font-weight: 500;
        color: var(--_muted);
        margin-left: 3px;
      }

      /* Names the newest cells in their own ink, so the label is the legend. */
      .delta {
        font-size: 12px;
        font-weight: 600;
        color: var(--clay-d);
        counter-reset: d var(--_d);
        animation: delta var(--t) infinite;
      }

      .delta::before {
        content: '+' counter(d) ' new';
      }

      .grid {
        width: 100%;
        height: auto;
        display: block;
      }

      .slot {
        fill: var(--oat);
        rx: calc(2px * var(--round));
      }

      /* Each cell reads its own place in the cascade out of the shared number.
         The four-unit window means a run of 24 cells has about four of them
         mid-arrival at any frame — a front, not a flicker — and because the
         number itself decelerates, the front slows as the report lands. */
      .cell {
        --_k: clamp(0, (var(--_p) - var(--_v)) / 4, 1);
        rx: calc(2px * var(--round));
        fill: currentColor;
        opacity: var(--_k);
        transform: scale(calc(0.92 + 0.08 * var(--_k)));
        transform-box: fill-box;
        transform-origin: center;
      }

      .batch {
        color: var(--clay);
      }

      .b1 {
        animation: ink-b1 var(--t) infinite;
      }

      .b2 {
        animation: ink-b2 var(--t) infinite;
      }

      /* Holds sit at a cell's full value plus a four-unit gap per batch (the
         --_v offsets), so a waiting report is never pre-lit by the last one. */
      @keyframes fill {
        0%,
        7% {
          --_p: 0;
          --_n: 0;
          animation-timing-function: var(--ease-out);
        }
        14%,
        33% {
          --_p: 27;
          --_n: 24;
          animation-timing-function: var(--ease-out);
        }
        40%,
        59% {
          --_p: 58;
          --_n: 51;
          animation-timing-function: var(--ease-out);
        }
        64%,
        93% {
          --_p: 74;
          --_n: 63;
          animation-timing-function: steps(1, end);
        }
        94%,
        100% {
          --_p: 0;
          --_n: 0;
        }
      }

      /* A report is clay while it is the newest thing on the grid and settles
         into a quieter ink as the next one starts landing — old data is still
         data, it just stops asking to be looked at. */
      @keyframes ink-b1 {
        0%,
        33% {
          color: var(--clay);
          animation-timing-function: var(--ease-out);
        }
        40%,
        93% {
          color: var(--_settled);
          animation-timing-function: steps(1, end);
        }
        94%,
        100% {
          color: var(--clay);
        }
      }

      @keyframes ink-b2 {
        0%,
        59% {
          color: var(--clay);
          animation-timing-function: var(--ease-out);
        }
        64%,
        93% {
          color: var(--_settled);
          animation-timing-function: steps(1, end);
        }
        94%,
        100% {
          color: var(--clay);
        }
      }

      /* The delta cuts to the new value on the frame its report starts, then
         fades up over 128ms beside the cells it describes. */
      @keyframes delta {
        0%,
        7% {
          --_d: 24;
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        9%,
        32.9% {
          --_d: 24;
          opacity: 1;
          animation-timing-function: steps(1, end);
        }
        33% {
          --_d: 27;
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        35%,
        58.9% {
          --_d: 27;
          opacity: 1;
          animation-timing-function: steps(1, end);
        }
        59% {
          --_d: 12;
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        61%,
        93% {
          --_d: 12;
          opacity: 1;
          animation-timing-function: steps(1, end);
        }
        94%,
        100% {
          --_d: 24;
          opacity: 0;
        }
      }

      /* Count and grid rewind inside this dark window, so the loop reads as
         the next period opening rather than this one being erased. */
      @keyframes scene-reset {
        0%,
        88% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        93%,
        97% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        100% {
          opacity: 1;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Cells fade in place without the scale, at double length; every
           clock stretches together so count, ink and delta stay in step. */
        .cell {
          transform: none;
        }

        .scene,
        .b1,
        .b2,
        .delta {
          animation-duration: calc(var(--t) * 2);
        }
      }
    </style>
  </head>
  <body>
    <div class="scene">
      <div class="head" aria-hidden="true">
        <div class="count"><span>/ 100</span></div>
        <div class="delta"></div>
      </div>
      <svg
        class="grid"
        viewBox="0 0 160 160"
        role="img"
        aria-label="A ten-by-ten grid of empty squares fills from the bottom row up in three reports of 24, 27 and 12; the newest report's squares are tinted until the next one lands, and a count above rises to 63 of 100"
      >
        <defs>
          <pattern id="slots" width="16" height="16" patternUnits="userSpaceOnUse">
            <rect class="slot" x="1.5" y="1.5" width="13" height="13" />
          </pattern>
        </defs>
        <rect width="160" height="160" fill="url(#slots)" />
        <g class="batch b1">
          <rect class="cell" x="1.5" y="145.5" width="13" height="13" style="--_v: 0" />
          <rect class="cell" x="17.5" y="145.5" width="13" height="13" style="--_v: 1" />
          <rect class="cell" x="33.5" y="145.5" width="13" height="13" style="--_v: 2" />
          <rect class="cell" x="49.5" y="145.5" width="13" height="13" style="--_v: 3" />
          <rect class="cell" x="65.5" y="145.5" width="13" height="13" style="--_v: 4" />
          <rect class="cell" x="81.5" y="145.5" width="13" height="13" style="--_v: 5" />
          <rect class="cell" x="97.5" y="145.5" width="13" height="13" style="--_v: 6" />
          <rect class="cell" x="113.5" y="145.5" width="13" height="13" style="--_v: 7" />
          <rect class="cell" x="129.5" y="145.5" width="13" height="13" style="--_v: 8" />
          <rect class="cell" x="145.5" y="145.5" width="13" height="13" style="--_v: 9" />
          <rect class="cell" x="1.5" y="129.5" width="13" height="13" style="--_v: 10" />
          <rect class="cell" x="17.5" y="129.5" width="13" height="13" style="--_v: 11" />
          <rect class="cell" x="33.5" y="129.5" width="13" height="13" style="--_v: 12" />
          <rect class="cell" x="49.5" y="129.5" width="13" height="13" style="--_v: 13" />
          <rect class="cell" x="65.5" y="129.5" width="13" height="13" style="--_v: 14" />
          <rect class="cell" x="81.5" y="129.5" width="13" height="13" style="--_v: 15" />
          <rect class="cell" x="97.5" y="129.5" width="13" height="13" style="--_v: 16" />
          <rect class="cell" x="113.5" y="129.5" width="13" height="13" style="--_v: 17" />
          <rect class="cell" x="129.5" y="129.5" width="13" height="13" style="--_v: 18" />
          <rect class="cell" x="145.5" y="129.5" width="13" height="13" style="--_v: 19" />
          <rect class="cell" x="1.5" y="113.5" width="13" height="13" style="--_v: 20" />
          <rect class="cell" x="17.5" y="113.5" width="13" height="13" style="--_v: 21" />
          <rect class="cell" x="33.5" y="113.5" width="13" height="13" style="--_v: 22" />
          <rect class="cell" x="49.5" y="113.5" width="13" height="13" style="--_v: 23" />
        </g>
        <g class="batch b2">
          <rect class="cell" x="65.5" y="113.5" width="13" height="13" style="--_v: 28" />
          <rect class="cell" x="81.5" y="113.5" width="13" height="13" style="--_v: 29" />
          <rect class="cell" x="97.5" y="113.5" width="13" height="13" style="--_v: 30" />
          <rect class="cell" x="113.5" y="113.5" width="13" height="13" style="--_v: 31" />
          <rect class="cell" x="129.5" y="113.5" width="13" height="13" style="--_v: 32" />
          <rect class="cell" x="145.5" y="113.5" width="13" height="13" style="--_v: 33" />
          <rect class="cell" x="1.5" y="97.5" width="13" height="13" style="--_v: 34" />
          <rect class="cell" x="17.5" y="97.5" width="13" height="13" style="--_v: 35" />
          <rect class="cell" x="33.5" y="97.5" width="13" height="13" style="--_v: 36" />
          <rect class="cell" x="49.5" y="97.5" width="13" height="13" style="--_v: 37" />
          <rect class="cell" x="65.5" y="97.5" width="13" height="13" style="--_v: 38" />
          <rect class="cell" x="81.5" y="97.5" width="13" height="13" style="--_v: 39" />
          <rect class="cell" x="97.5" y="97.5" width="13" height="13" style="--_v: 40" />
          <rect class="cell" x="113.5" y="97.5" width="13" height="13" style="--_v: 41" />
          <rect class="cell" x="129.5" y="97.5" width="13" height="13" style="--_v: 42" />
          <rect class="cell" x="145.5" y="97.5" width="13" height="13" style="--_v: 43" />
          <rect class="cell" x="1.5" y="81.5" width="13" height="13" style="--_v: 44" />
          <rect class="cell" x="17.5" y="81.5" width="13" height="13" style="--_v: 45" />
          <rect class="cell" x="33.5" y="81.5" width="13" height="13" style="--_v: 46" />
          <rect class="cell" x="49.5" y="81.5" width="13" height="13" style="--_v: 47" />
          <rect class="cell" x="65.5" y="81.5" width="13" height="13" style="--_v: 48" />
          <rect class="cell" x="81.5" y="81.5" width="13" height="13" style="--_v: 49" />
          <rect class="cell" x="97.5" y="81.5" width="13" height="13" style="--_v: 50" />
          <rect class="cell" x="113.5" y="81.5" width="13" height="13" style="--_v: 51" />
          <rect class="cell" x="129.5" y="81.5" width="13" height="13" style="--_v: 52" />
          <rect class="cell" x="145.5" y="81.5" width="13" height="13" style="--_v: 53" />
          <rect class="cell" x="1.5" y="65.5" width="13" height="13" style="--_v: 54" />
        </g>
        <g class="batch b3">
          <rect class="cell" x="17.5" y="65.5" width="13" height="13" style="--_v: 59" />
          <rect class="cell" x="33.5" y="65.5" width="13" height="13" style="--_v: 60" />
          <rect class="cell" x="49.5" y="65.5" width="13" height="13" style="--_v: 61" />
          <rect class="cell" x="65.5" y="65.5" width="13" height="13" style="--_v: 62" />
          <rect class="cell" x="81.5" y="65.5" width="13" height="13" style="--_v: 63" />
          <rect class="cell" x="97.5" y="65.5" width="13" height="13" style="--_v: 64" />
          <rect class="cell" x="113.5" y="65.5" width="13" height="13" style="--_v: 65" />
          <rect class="cell" x="129.5" y="65.5" width="13" height="13" style="--_v: 66" />
          <rect class="cell" x="145.5" y="65.5" width="13" height="13" style="--_v: 67" />
          <rect class="cell" x="1.5" y="49.5" width="13" height="13" style="--_v: 68" />
          <rect class="cell" x="17.5" y="49.5" width="13" height="13" style="--_v: 69" />
          <rect class="cell" x="33.5" y="49.5" width="13" height="13" style="--_v: 70" />
        </g>
      </svg>
    </div>
  </body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.