Back to the library

Provenance — estimate narrowing

Variant: Estimated

An estimate that shows its uncertainty instead of hiding it. The figure wears an approximation sign, the dashed rule and a footnote marker that stays muted, and under it a 90% interval sits on a fixed 28–48% axis. Two sample batches land: the n count turns over first, the band narrows on a 385ms ease-in-out — it is already on screen and changing size, so it morphs rather than enters — and the interval label confirms what the band now shows only once it has settled, so the order on screen is the order of cause. The point estimate never moves; if the centre wandered while the band closed, a reader could not tell a better estimate from a different one. And it never earns the solid rule, however many samples arrive: more data buys a narrower band, not a different kind of claim. Use it for canaries, A/B readouts, forecasts and anything still sampling.

statusdatadistributionindicatorloop

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>Provenance — estimate narrowing</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);
        --_dash: color-mix(in srgb, var(--slate) 34%, transparent);
        --_band: color-mix(in srgb, var(--clay) 30%, var(--paper));
        --_oat-wash: color-mix(in srgb, var(--oat) 55%, var(--paper));

        /* Clock — 7s: 1% is 70ms. Two sample batches land, at 30% and 58%. */
        --cycle: 7s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 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);
      }

      .card {
        width: min(300px, calc(100vw - 32px));
        padding: 14px 16px 13px;
        display: grid;
        gap: 10px;
        border-radius: calc(12px * var(--round));
        background: var(--paper);
        border: 1px solid var(--oat);
        animation: card var(--t) linear infinite;
      }

      /* The reset hides in a dark window at the wrap. */
      @keyframes card {
        0% {
          opacity: 0;
        }
        2.5% {
          opacity: 1;
        }
        95.5% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        100% {
          opacity: 0;
        }
      }

      .k {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--_muted);
      }

      .claim {
        font-size: clamp(16px, 4.6vw, 19px);
        font-weight: 600;
        line-height: 1.35;
        letter-spacing: -0.01em;
        text-wrap: balance;
      }

      /* An estimate never earns the solid rule, however many samples arrive —
         more data buys a narrower band, not a different kind of claim. */
      .fig {
        position: relative;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
      }

      .fig::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        border-bottom: 1.5px dashed var(--_dash);
      }

      /* Same marker as its siblings, but it stays muted: nothing has vouched. */
      .ref {
        font-size: 11px;
        font-weight: 700;
        vertical-align: super;
        line-height: 0;
        margin-left: 2px;
        color: var(--_muted);
      }

      .rows {
        border-top: 1px solid var(--oat);
        padding-top: 9px;
        display: grid;
        gap: 8px;
        font-size: 12px;
        color: var(--_muted);
      }

      .row {
        display: flex;
        align-items: center;
        gap: 7px;
      }

      .n {
        font-size: 11px;
        font-weight: 700;
      }

      .t {
        flex: 1;
        white-space: nowrap;
      }

      .pill {
        flex: none;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 600;
        background: var(--_oat-wash);
      }

      /* The axis spans 28–48%, so the point estimate sits dead centre and
         31–45 is 70% of the track. */
      .ci {
        position: relative;
        height: 12px;
      }

      .ci::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 5px;
        height: 2px;
        border-radius: 999px;
        background: var(--oat);
      }

      .band {
        position: absolute;
        top: 2px;
        left: 15%;
        width: 70%;
        height: 8px;
        border-radius: calc(2px * var(--round));
        background: var(--_band);
        animation: band var(--t) linear infinite;
      }

      /* The band is already on screen and changing size, so it morphs on the
         in-out curve. 1 → 6/14 → 2/14 of its width: 31–45, 35–41, 37–39. */
      @keyframes band {
        0%,
        30.5% {
          transform: scaleX(1);
          animation-timing-function: var(--ease-in-out);
        }
        36%,
        58.5% {
          transform: scaleX(0.4286);
          animation-timing-function: var(--ease-in-out);
        }
        64%,
        100% {
          transform: scaleX(0.1429);
        }
      }

      /* The point never moves. If the centre wandered as the band closed, the
         reader could not tell a better estimate from a different one. */
      .pt {
        position: absolute;
        left: calc(50% - 1px);
        top: 0;
        width: 2px;
        height: 12px;
        border-radius: 999px;
        background: var(--clay-d);
      }

      .read {
        display: flex;
        justify-content: space-between;
        font-variant-numeric: tabular-nums;
      }

      .read b {
        color: var(--slate);
        font-weight: 600;
      }

      .sw {
        display: inline-grid;
      }

      .sw > * {
        grid-area: 1 / 1;
        text-align: right;
      }

      /* Order is causality: n turns over first (data arrived), the band
         narrows, and the interval label confirms what the band now shows. */
      .n1 {
        animation: s1 var(--t) linear infinite;
      }
      .n2 {
        animation: s2 var(--t) linear infinite;
      }
      .n3 {
        animation: s3 var(--t) linear infinite;
      }
      .c1 {
        animation: c1 var(--t) linear infinite;
      }
      .c2 {
        animation: c2 var(--t) linear infinite;
      }
      .c3 {
        animation: c3 var(--t) linear infinite;
      }

      @keyframes s1 {
        0%,
        30% {
          opacity: 1;
          animation-timing-function: ease;
        }
        31.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes s2 {
        0%,
        30% {
          opacity: 0;
          animation-timing-function: ease;
        }
        31.5%,
        58% {
          opacity: 1;
          animation-timing-function: ease;
        }
        59.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes s3 {
        0%,
        58% {
          opacity: 0;
          animation-timing-function: ease;
        }
        59.5%,
        100% {
          opacity: 1;
        }
      }

      @keyframes c1 {
        0%,
        36% {
          opacity: 1;
          animation-timing-function: ease;
        }
        37.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes c2 {
        0%,
        36% {
          opacity: 0;
          animation-timing-function: ease;
        }
        37.5%,
        64% {
          opacity: 1;
          animation-timing-function: ease;
        }
        65.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes c3 {
        0%,
        64% {
          opacity: 0;
          animation-timing-function: ease;
        }
        65.5%,
        100% {
          opacity: 1;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* One shared 1.6x clock keeps every part in phase. */
        .card,
        .card *,
        .card *::before,
        .card *::after {
          animation-duration: calc(var(--t) * 1.6);
        }

        /* The narrowing is the reading, so the band keeps it — as three
           widths crossfaded on the label’s beats instead of a morph. */
        .band {
          animation-name: c1;
        }

        .band + .band {
          animation-name: c2;
        }

        .band + .band + .band {
          animation-name: c3;
        }
      }

      @media not (prefers-reduced-motion: reduce) {
        .band + .band {
          display: none;
        }
      }
    </style>
  </head>
  <body>
    <div
      class="card"
      role="img"
      aria-label="An estimated figure with a dashed underline; as two batches of samples arrive, its 90% interval narrows from 31–45% to 37–39% around a point that never moves"
    >
      <span class="k">Claim</span>
      <p class="claim">
        Cache change cut p95 latency <span class="fig">≈38%</span><sup class="ref">1</sup>
      </p>
      <div class="rows">
        <div class="row">
          <span class="n">1</span>
          <span class="t">Canary sample, still running</span>
          <span class="pill">Estimate</span>
        </div>
        <div class="ci">
          <span class="band"></span>
          <span class="band" style="transform: scaleX(0.4286)"></span>
          <span class="band" style="transform: scaleX(0.1429)"></span>
          <span class="pt"></span>
        </div>
        <div class="read">
          <span
            >90% CI
            <b class="sw"
              ><span class="c1">31–45%</span><span class="c2">35–41%</span
              ><span class="c3">37–39%</span></b
            ></span
          >
          <span
            >n =
            <b class="sw"
              ><span class="n1">12</span><span class="n2">48</span><span class="n3">200</span></b
            ></span
          >
        </div>
      </div>
    </div>
  </body>
</html>

The variant family

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