Every chart on the site now draws itself in as it scrolls into view: rings fill, bars grow, calendar months appear in order. The motion comes from one script and one list of chart types kept inside it, so not one of the generators that build the charts had to change. A reader whose browser cannot run the script, or who has asked their system for reduced motion, sees every chart complete and still.
Why the motion could not live in the generators
The charts on the site come from many places. Record pages carry generated infographics, the Analysis page has its rings and bars, the Sessions calendar is drawn from its own data file, and the Test Lab holds hand-built prototypes. Adding motion to each would have meant editing every generator, re-running it, and re-checking every page it writes, for a change that alters nothing a chart shows. It would also have left the next new chart without motion until someone remembered to add it.
A cue sheet instead of stage directions
A theatre can mark every movement inside each actor’s script, or the stage manager can keep one cue sheet by the door: this prop moves on this line, that light comes up after it. We chose the cue sheet. The script, js/motion.js, holds a registry: each entry names a family of charts by the markup it already uses and says how its parts move, whether a line draws, a bar grows along its long axis, a dot pops or a panel fades. The charts are the props and the generators are the actors’ scripts, which stay as they were. A hand-built lab page, which no generator writes, carries small attributes on its figures instead, naming the parts and the order they move in. Like a cue sheet, the registry only says when and how things move. It never changes what a chart draws, so a chart with no entry is simply shown as it is.
Safe defaults for every reader
The script loads early in each page, before anything is painted, so a chart is never shown complete and then snatched away to be animated. It plays each chart once, when the chart’s top passes into the lower edge of the window, and does not replay it on the way back up. Charts that a page draws after it loads are picked up as they appear, and a chart that redraws fades in rather than replaying its whole entrance. If the reader’s system asks for reduced motion, the script sets nothing and hides nothing. The speeds were set once and apply everywhere: the homepage progress chart takes 0.65 seconds. Some things were left still on purpose: the tag graph already moves, tag clouds and lists are text, and icons are not charts.
What the rendering checks caught
Before anything was published, the pages were opened in a real browser and every animated unit was watched to the end: none could be left hidden, and none could stay unpainted. On the first nine lab pages that pass found three faults; a fourth was reported after publishing.
| Finding | Fix |
|---|---|
| Chart parts that already carried their own position drifted across the chart as they animated | Those parts fade in instead of moving |
| Printing a page could catch a chart halfway through its entrance | All motion rules apply to the screen only |
| The network lines on one explorer took 2.2 seconds to draw | Shortened to 650 milliseconds |
| The small chart thumbnails on the Test Lab cards stayed still, because the cards had been treated as navigation, not charts | A registry entry for card thumbnails, covering 50 on the lab index and four on the homepage |
The roll-out checks then covered 18 pages, from the homepage, an album page and a song page to Analysis, Sessions and thirteen lab pages. The thumbnail miss was the one found after publishing, and its fix went out as a second, smaller change the same day.
The rule that keeps it complete
Motion is now a site standard rather than a feature. The publish chain has a step that checks every page carries the script, and at the first full run all 375 pages did. A new kind of chart gets its registry entry in the same session that builds it, which is the cue sheet’s whole advantage: the list is one place to look, and a chart that is missing from it is a single entry to add, not a generator to rework.