SitePromoVideo Make one

Bar chart race video template

Animated bar race with checked numbers · 20 s · 16:9

A bar chart race is motion graphics driven by a table: bars grow, re-sort each time step and land on a summary card. This 20-second, 16:9 example uses six fictional stations over eight weeks. The full recipe below shows how to paste your own numbers so every bar and label comes from your data, not from the model's imagination.

Full recipe to render your own MP4, tested 2026-10-04 ↓

The numbers in this sample are fictional and labelled as such on screen.

Animated bar race with checked numbers — first frame

The prompt

Data-visualization clip: an animated horizontal bar chart race of a FICTIONAL dataset — 'Weekly rides by station, fictional city bike network' — with 6 stations (Harbor, Old Town, Riverside, Market Sq, Uni Campus, Hilltop) over 8 weeks. Hard-code the dataset as one JSON object in the script and drive every bar, value label and rank order from it (bars re-sort smoothly each week, values count up). Show a large week counter, axis gridlines, readable labels (≥30px), and a persistent small 'Sample data — fictional' tag. End on a clean summary card naming the top station with its final number taken from the same dataset. Clean light theme (white, slate text #1f2937, six distinct accessible colors). Up to ~20 words on screen is fine here.

Make it yours

  1. 1Paste or upload your numbers (CSV or a small table).
  2. 2Pick this template and choose which column is the label, the value and the time step.
  3. 3Generate: every bar and label is driven from your table, so the video cannot invent figures.
  4. 4Download the MP4; edit a value and re-render if the data changes.

From this prompt to your own MP4

Run this recipe on your own computer with your own Claude access, or use the studio.

What it is for

A data-driven motion graphics clip: an animated bar chart race for a newsletter, a report, a lesson or a weekly update, where every bar and number comes from a table you paste in.

Inputs: A small table as JSON: a list of time steps and one list of values per item (here 6 items × 8 weeks). No images or fonts to upload.

What we used

Model
Claude Opus 5.5 (claude-opus-5-5), called through Claude Code 2.1.289 in print mode. Any Claude interface that offers Opus 5.5 can take the same two messages; we only timed this one.
Renderer
HyperFrames 0.8.123 from npm (Apache-2.0), run with npx. It drives a headless Chrome and encodes with FFmpeg.
Animation library
GSAP 3.15.0 core from npm; copy gsap.min.js next to index.html.
Machine
macOS 26.5 on an Apple M4 Pro (14 cores, 48 GB), Node.js 22.12, FFmpeg 7.1.1, chrome-headless-shell 152.

Copy the two messages

The prompt above describes the motion. On its own it does not produce a file a renderer can play, so it goes to the model together with a render brief: the rules that make the reply a single HyperFrames index.html. Send the render brief as the system prompt, or paste it first in the same message.

A · Render brief (same for every template)

Show the full brief
You are a senior motion designer who writes HyperFrames compositions: a single HTML file animated with GSAP that a headless renderer turns into an MP4. Make it look like a polished, intentional piece a designer would put in a portfolio.

# Output contract
- Reply with exactly one fenced ```html code block containing the complete index.html. No prose before or after it.
- Keep the file under about 32,000 characters. Inline all CSS and JS. No build step.

# Render environment (hard constraints)
- The renderer may run with no network. Never reference http://, https:// or protocol-relative URLs (no CDNs, web fonts, remote images, @import, fetch, XMLHttpRequest, WebSocket or dynamic import).
- Load GSAP exactly with <script src="gsap.min.js"></script> (GSAP 3 core only; no plugins such as SplitText, TextPlugin, MotionPath or ScrollTrigger).
- No raster images: build everything from HTML/CSS, inline SVG and <canvas>.
- Fonts: use common system families with a generic fallback, e.g. "Liberation Sans", "DejaVu Sans", "Noto Sans", Helvetica, Arial, sans-serif.
- Deterministic only: no Math.random, Date.now, new Date, requestAnimationFrame, setTimeout/setInterval motion, or CSS animations/transitions. If you need randomness, write a small seeded PRNG (e.g. mulberry32 with a fixed seed) and generate all values once at load.
- Any brand, place or data shown must be clearly fictional or supplied in the brief. Do not show real company logos.

# HyperFrames rules
1. Page shell: <!doctype html>, <meta name="viewport" content="width=W, height=H">, html/body exactly W x H px, overflow:hidden, explicit body background.
2. Root: <div id="root" data-composition-id="main" data-start="0" data-duration="D" data-width="W" data-height="H"> containing every visual.
3. Scenes: each timed element gets class="clip" plus data-start and data-duration (seconds); the runtime shows it only inside that window. .clip { position:absolute; inset:0 } unless positioned. Scenes must tile 0–D with no gaps.
4. One paused root timeline registered after the DOM exists:
   const tl = gsap.timeline({ paused: true });
   window.__timelines = window.__timelines || {};
   window.__timelines["main"] = tl;
   Every tween uses an absolute position (third argument). Use set/to/from/fromTo on transforms, opacity, width/height, colors, clip-path and numeric proxy objects.
5. Canvas is allowed. Drive it only from the timeline: tween a proxy, e.g. const P={t:0}; tl.to(P,{t:D,duration:D,ease:"none",onUpdate:()=>draw(P.t)},0); draw(0); where draw(t) renders the whole frame purely from t.
6. The last scene must still be visible at D−0.1s.

# Quality bar
- Transitions last ≤0.45s and use cuts, slides, scale-pushes or mask wipes. Never leave two scenes semi-transparent for longer than 0.3s and never fade the whole frame to the background color.
- Legible, high-contrast text. At 1920x1080: headlines ≥72px, body ≥32px, labels ≥26px. At 1080x1920: headlines ≥96px, body ≥44px. At most ~10 words on screen per moment.
- Fill the frame; no large empty bands. Give each line of text ≥1.6s at rest. Vary layouts so consecutive moments look different.
- Every moment across the duration must show clear, non-blank content.

B · Job message (this template)

Canvas: W=1920, H=1080 (16:9). Duration D=20 seconds. Root must declare data-width="1920" data-height="1080" data-duration="20".

Brief: Data-visualization clip: an animated horizontal bar chart race of a FICTIONAL dataset — 'Weekly rides by station, fictional city bike network' — with 6 stations (Harbor, Old Town, Riverside, Market Sq, Uni Campus, Hilltop) over 8 weeks. Hard-code the dataset as one JSON object in the script and drive every bar, value label and rank order from it (bars re-sort smoothly each week, values count up). Show a large week counter, axis gridlines, readable labels (≥30px), and a persistent small 'Sample data — fictional' tag. End on a clean summary card naming the top station with its final number taken from the same dataset. Clean light theme (white, slate text #1f2937, six distinct accessible colors). Up to ~20 words on screen is fine here.

Swap in your own

Edit only the job message. Leave the render brief as it is.

Your data
Replace the title and item names, then add “Use exactly this dataset, hard-coded as one JSON object” followed by your JSON. Without your own numbers the model invents fictional ones.
Real or sample
Keep the “Sample data — fictional” tag only if the numbers are made up. For real figures, change it to your source, e.g. “Source: our ticket log, Sept 2026”.
Item count
Six to eight bars stay readable at 1080p. With more items, raise D by about 2 seconds per extra time step.
Colors
Name one hex color per item if you have brand colors; otherwise the model picks six accessible ones.

Generate, then render

  1. 1

    Send A and your edited B to Claude Opus 5.5. The reply is one ```html block.

    Prefer the terminal?
    # Optional: the same two messages from a terminal with Claude Code
    claude -p --model claude-opus-5-5 \
      --system-prompt "$(cat render-brief.txt)" --tools "" \
      --output-format json < job.txt > reply.json

    The reply text is in the result field of reply.json.

  2. 2

    Set up a folder once (needs Node.js 22 and FFmpeg):

    mkdir my-clip && cd my-clip
    npm init -y
    npm install [email protected] [email protected]
    npx hyperframes doctor
  3. 3

    Save the code inside the fence as index.html in that folder and render:

    # 1. Save the model's html block as index.html in my-clip/
    # 2. Put GSAP next to it (the brief tells the model to load it locally)
    cp node_modules/gsap/dist/gsap.min.js .
    # 3. Render 30 fps, 1920x1080 H.264
    npx hyperframes render . -o out/my-clip.mp4 --fps 30 --quality standard --workers 4
  4. 4

    To change a word or a color afterwards, edit index.html directly and run the render line again; no new model call is needed.

Our test run, 2026-10-04

We followed the steps above with our own replacements and got a new MP4. It is not the gallery sample at the top of this page.

Animated bar race with checked numbers, recipe test run 2026-10-04 — still frame

The renderer wrote a 1.7 MB file; the player plays a 0.6 MB web re-encode of it.

  • Title and item names replaced with a fictional town library and six reading rooms.
  • Our own 6 × 8 dataset pasted in as JSON, with the instruction to use it exactly.
  • Nothing else edited: no hand fixes to the returned HTML.
Model time
161 s for one reply (9,132 output tokens)
Render time
40 s with the render line above
Output
MP4, H.264 High, 1920×1080, 30 fps, 20.0 s, no audio track
Cost
Claude Code reported $0.56 of model usage at list price for this one call. We ran it on a subscription plan, so the amount you are charged was not measured.

First attempt, no retry. We checked weeks 4, 6 and 8 frame by frame against the JSON: every value and rank matched, and the end card named Comics Den with 300 (+210 since W1). One flaw: the large week counter sits close to the right edge and its last digit is slightly cut off. Asking for “keep 80px margin on the right” would be the next fix round.

The exact job message we sent
Canvas: W=1920, H=1080 (16:9). Duration D=20 seconds. Root must declare data-width="1920" data-height="1080" data-duration="20".

Brief: Data-visualization clip: an animated horizontal bar chart race of a FICTIONAL dataset — 'Weekly visitors by reading room, fictional town library' — with 6 rooms over 8 weeks. Use exactly this dataset, hard-coded as one JSON object in the script, and drive every bar, value label and rank order from it (bars re-sort smoothly each week, values count up):
{"weeks":["W1","W2","W3","W4","W5","W6","W7","W8"],"series":{"Map Room":[120,135,150,160,170,185,190,210],"Kids Corner":[200,190,210,230,240,235,260,280],"Quiet Hall":[180,185,175,190,195,200,205,198],"Comics Den":[90,120,160,190,230,250,270,300],"Study Pods":[150,160,165,170,168,175,180,185],"Garden Desk":[60,75,95,110,140,160,175,190]}}
Show a large week counter, axis gridlines, readable labels (≥30px), and a persistent small 'Sample data — fictional' tag. End on a clean summary card naming the top room with its final number taken from the same dataset. Clean light theme (white, slate text #1f2937, six distinct accessible colors). Up to ~20 words on screen is fine here.

If something goes wrong

The render sits on “Checking browser…” and never starts.
HyperFrames could not download its headless Chrome (on our machine the download went through a proxy that Node did not use). Run npx hyperframes browser ensure on a working connection, or point HYPERFRAMES_BROWSER_PATH at an existing chrome-headless-shell binary, then render again.
A warning that capture workers may exceed the V8 heap.
Pass --workers 4 (as in the command above) or raise NODE_OPTIONS=--max-old-space-size=8192.
The reply contains prose or no html block.
Send the render brief as the system prompt (or paste it first in the same message). Copy only the text inside the ```html fence into index.html.
A blank or half-faded frame in the middle.
Ask the model to fix that timestamp: “At 8.7s the frame is nearly empty; keep every moment readable.” Our original kinetic sample needed one such fix round on 2026-10-01.
Fonts look different from our sample.
The brief only allows system fonts. The renderer uses what your machine has, so Helvetica or Arial may replace Liberation Sans on a Mac. Install the font or name one you have.

Our gallery sample was made on 2026-10-01 from the original wording (the model made up the bike-network numbers) with the same model and HyperFrames 0.8.103. We have only tested the setup listed under “What we used”; other machines and other Claude apps should work the same way but are not verified here.