Heartwood Health · Operations Components

How to build the nine tiles.

Dev guide · v1
← components.html

Each tile in components.html follows the same shape: a tile shell with mono-uppercase label and serif title, a body that animates in when it scrolls into view, and a foot with metadata. Data lives in components-data.js; the inline script in components.html consumes window.HEARTWOOD_DATA and renders each chart.

Animations gate on an IntersectionObserver. When a tile crosses 20% of viewport, the script adds .visible — that's the class every component's CSS keys off of. To replay, the tile temporarily gets .replay-reset, snaps back to initial state, then re-applies .visible on the next animation frame.

Pick a chart below for the full walkthrough — when to use it, the data shape from components-data.js, the animation pattern, a build snippet, and (when there's a real gotcha) a watch-out callout.

01 · Stat Counter Headline metric · count-up A single number, eased in over 1.6s. The page-anchor stat. Read → 02 · Staggered Bars Categorical comparison 4–8 categories on the same metric. Includes the px-not-% gotcha. Read → 03 · Drawn Line Trend over time · animated draw SVG path with stroke-dasharray. The classic "draw itself" trick. Read → 04 · Arc Donut Part-to-whole · ring + legend 3–6 categories summing to 100%. Cumulative-rotation segment trick. Read → 05 · Slope Chart Two-period comparison A → B across paired categories. Crossing lines are the story. Read → 06 · Density Heat Grid 2D distribution · matrix 7 × 12 cells, color-mix() shading, diagonal-wave reveal. Read → 07 · Sankey Ribbon Flow · sources to targets Bezier ribbons. Bilateral allocation prevents crisscross tangles. Read → 08 · Grouped Bars Two periods × N categories Q3 vs Q4. The nested-flex pattern that solves the bar 02 trap. Read → 09 · Horizontal Bar Ranked list · long labels Auto-sort by value. Rank-based default coloring. Read →