Release notes5 min read

Mografy 0.1.3: charts with D3, sketches with p5.js, and a workspace that works offline

Mografy 0.1.3 adds two new extras, d3 for data visualisation and p5 for generative art, both drawn frame by frame so every export is identical. init now puts every template, reference film and extra in your workspace, so you can start without a connection. Plus a stricter check and a fix for 3D films.

ReleaseD3p5.js

In one sentence: Mografy can now turn data into charts with D3 and draw generative art with p5.js, and everything you need comes with the install.

This is the biggest update since we moved Mografy to npm. Two new extras, a workspace that no longer needs the internet after init, and a check that now really renders your film. Your projects and commands stay the same.

d3: charts that draw themselves

When a film needs to show a trend, a ranking, shares of a whole, a map or a network, add the d3 extra to it:

npx mografy add d3 projects/my-film

D3 does the maths it is best at: scales, chart shapes, layouts, map projections, colours and number formats. Mografy draws the result on the frame’s canvas from time, so a chart can grow, change its data and hold, and look exactly the same in the player and in the MP4.

  • A ten-second tour comes with it: bars on an axis, a line that draws itself and changes data, a donut, a force network and a turning globe.
  • Helpers for motion: axis draws axes on the canvas, trimPoints grows a line, sweepArcs opens a pie, tweenData moves a chart from one set of numbers to another, and positionsAt shows any moment of a force layout.
  • Your data stays in the project: put CSV, TSV or JSON in assets/data/ and read it with loadData. Change the numbers and the film updates.
  • Numbers in Traditional Chinese: zhNumber writes 12,345 as 1.2 萬.

D3 7.9.2 comes bundled at about 0.23 MB, with only the modules that compute. The ones that build web pages or run their own clock are left out on purpose, because a Mografy frame is drawn from time.

p5: sketches you can scrub

For flow fields, particles, noise landscapes and other generative art, add the p5 extra:

npx mografy add p5 projects/my-film

A normal p5.js sketch runs its own draw loop, so each frame depends on the one before. In Mografy that loop never runs. sketch() reseeds random() and calls your draw(p, t, frame) for exactly the moment Mografy asks for, so you can jump to any frame, play backwards or export with motion blur and get the same picture.

  • An eight-second tour shows a flow field, ridgelines, a recursive tree and twinkling stars.
  • It ships the official, unmodified p5.js 2.4.0 with its LGPL-2.1 licence.
  • The Mografy Skill explains how to port an existing sketch, so you can hand your agent one you like and ask for a film.

Why “the same every time” matters

Chart libraries and sketches like randomness and clocks. Exports don’t: Mografy renders frames in parallel, out of order and in several samples for motion blur. If a frame depended on the one before it, the MP4 would flicker or differ from what you saw in the player.

Both extras are built around this, and the tests check it: each tour is drawn in order, backwards, jumping around and on a fresh page, and the pixels must match exactly.

Everything in your workspace, offline

npx mografy@latest init now fills your workspace from the npm package, with no download:

  • All 43 templates go into templates/ and the 11 reference films (the intro and ten Stage loops) into examples/. Folders you changed are left alone.
  • Every extra is in the package. npx mografy add <extra> projects/<film> copies only what that film needs and lists each file it writes, a little like shadcn add.
  • If a scene imports an extra the project doesn’t have yet, the error now tells you the exact command to run.
  • Films from the showcase download into a new showcase/ folder. add also takes the folder first: npx mografy add examples/ <film>.
  • The player opens on your workspace, with projects/, showcase/, examples/ and templates/ on the left, instead of opening a built-in component.

The package is about 11 MB. Showcase films are the only thing that still download, and only when you add one.

The Skill installs on its own

init no longer writes the Mografy Skill into your workspace. It prints the command instead, and the Skill installs in that folder:

  • The Skill now covers d3 and p5 too: when to use a chart, how to build it in reading order, and how to keep a sketch the same on every frame.
npx skills add mografy/mografy

Fixes

  • npx mografy check now really renders your film when the player isn’t running. Before, it could report success without drawing a frame and miss a Math.random or an error in renderFrame.
  • 3D films no longer time out on their trial render. The limit is now 60 seconds, because a Three.js film can spend about 20 seconds compiling shaders in the headless browser.

How to update

Run this in your Mografy folder. It updates Mografy and adds anything new to templates/ and examples/; your projects stay as they are.

npx mografy@latest init

Then ask your agent for a chart or a sketch. The full list of changes is on the changelog.

Bring your numbers. Mografy will make them move.

Make motion with us

Join the Mografy Discord to share what you make, ask questions and help shape what we build next.