Motion as a function of time
A drawing can arrive, leave, or be anywhere in between, as a function of time: no clock, no DOM and no randomness that isn't seeded, so frame 412 is the same in any order, in any process, on any machine. It is what a video renderer needs (Remotion asks for frames out of order, in parallel, headless), and what the page's own assemble plays.
import { systems, objects } from '@johnoscott/isometric-engine/systems'; // or { assemble, bindMotion, motion, … } from '…/motion'
const c = systems.compile(yaml, theme, { mode: 'dark', resolveVars: true, strict: 'throw' });
const plan = objects.assemble(c.scenes[0], { style: 'drop', order: 'by-region', duration: 1800, seed: 7 });
plan.duration; // ms
plan.frame(600); // the scene's SVG at 600 ms, as text
const state = plan.at(600); // the same moment as plain JSON
objects.svgAt(c.scenes[0], state); // === plan.frame(600)
objects.paint(svgElement, state); // the same on a live drawing, in placePlans#
assemble(scene, options) and disassemble(scene, options). An assemble's frame(0) is empty and its frame(duration) is the still render, byte for byte; a disassemble's are the other way round. Times past an end are that end.
| Option | |
|---|---|
style (assemble) | edge (the default: from the nearest edge of the canvas), drop, rise (up through the floor), fly (from from), pop, scatter, build (layer by layer), fade |
style (disassemble) | fly-out (the default), explode (from point), lift-off, sink, scatter, collapse (into point, or the region that holds each piece), fade, reverse (the assemble style of, backwards) |
order | by-depth, by-layer, by-region, by-flow (along the connectors, from source), as-listed, random |
connectors | draw (stroked in), grow (from the source), fade; the arrowhead shows once a connector is all there. pulses: true: a token runs along each, once |
labels | fade, type, with-piece |
duration, stagger, piece, overlap | the whole plan's length (everything is scaled to it), ms between starts, ms a piece takes, and how much (0 to 1) each part runs over the end of the one before |
easing | linear, ease, ease-in, ease-out, settle, spring, bounce |
from, point, seed | left, right, top, bottom; [x, y] in the drawing's units, or a piece's id; a number |
In the file, a node or a region may say its own (a region's is for what it holds too, the nearer winning):
- { id: db, asset: server, motion: { style: pop, out: sink, easing: spring, delay: 200, duration: 900 } }States#
at(ms) gives a SceneState: plain JSON, through JSON.stringify and back unchanged. What it doesn't name is as in the still; {} is the still. A host may make its own:
| Key | |
|---|---|
items | by id: opacity, dx, dy, scale (about about), clip (a polygon): a thing's block, walls, gate and name |
labels | by the id of a thing, a connector or a note: opacity, or typed (0 to 1) |
routes | by id: opacity, drawn (0 to 1) and by (stroke or grow), ants (dash and offset) |
tokens, pulses | { route, at, color } (a fraction along it); { x, y, rx, ry, opacity, color } |
outlines, variants | rings: { id, points, opacity }; the looks of things and how much of each (0 to 1) |
marks, camera | the step marks' and badges' opacity; the view, [x, y, w, h] |
morph | a host's own (how far toward the 2D view): svgAt and paint draw the 3D view |
A motion document#
A document says what happens, in plain data (isomotion: 1): beats one after another, each with what it shows, what it lights, its commentary, and what moves in it. It lives in the diagram's file (a scene's motion:) or on its own. Times are ms, or "1.2s", or "30f" with an fps at the top.
# file: story.yaml
isodiag: 1
title: A request
scenes:
- id: s
title: A request
ants: [q]
nodes:
- { id: web, asset: server, label: Web }
- { id: api, asset: server, label: API }
- { id: db, asset: volume, label: Data, variants: { asleep: { role: grey, sub: asleep } } }
routes:
- { id: r, from: web, to: api, kind: send }
- { id: q, from: api, to: db, kind: send }
motion:
series:
- sequence: { name: ask, say: { title: The question, text: "The page asks the API." }, hide: [db], highlight: [api], duration: 3s, children: [ { travel: [r], each: 900, loop: true } ] }
- sequence: { name: data, say: { title: The data, text: "It reads from the store." }, show: [db], focus: { lit: [api, db] }, enter: { fade: 400 }, duration: { read: true } }
- sequence: { name: rest, say: { title: At rest }, variants: { db: asleep }, levels: { db: 0.4 }, enter: { fade: 600 }, duration: 2s, ants: false }const c = systems.compile(yaml, theme), tl = objects.bindMotion(c.scenes[0], c.scenes[0].motion, { kinds: c.theme.kinds });
tl.ok; tl.diags; // what is wrong, by path (a name that isn't there: with a near one)
tl.duration; tl.beats; tl.markers;
tl.at(1500); // the SceneState at 1500 ms: for svgAt and paint
tl.cues(1500); // the beat's commentary: { beat, chapter, index, of, progress, say }
systems.renderSvg(yaml, { theme, mode: 'dark', t: 1500 }); // the frame, as one SVG that needs nothing else
systems.renderSvg(yaml, { theme }); // the still
systems.renderAnimatedSvg(yaml, { theme }).svg // (0.35.0) the whole motion, as one SVG that plays by itselfOne SVG that plays by itself (0.35.0): renderAnimatedSvg(yaml, { theme, motion?, step?, rest?, loop? }) gives { svg, duration, skipped }, for an <img>, a manual or a site. Its CSS keyframes are sampled from the same Timeline as tl.at(t) (every step ms, 80 by default, kept only where something changes), so the export and a page that plays the timeline agree at every sample. It has no script and nothing from outside. prefers-reduced-motion stops it at rest: 'still' (the drawing as drawn, the default), 'start', 'end' or a time in ms. Without a motion document it exports the scene's steps, as the page's player plays them. Things, connectors, labels, tokens, rings, the camera and the step marks move; what it doesn't play yet is named in skipped and drawn as in the still ('looks', a look's crossfade; 'typed', typed labels; 'clips'). objects.animatedSvg(scene, timeline, options) is the same for a compiled scene and any timeline.
In a beat (a sequence of the top series) | |
|---|---|
name, say, duration | its name; { chapter, title, text, code, facts, color }; a time, or { read: true }: as long as its words take |
show, hide | ids: cumulative, so a beat opened first is as if reached. A thing's connectors hide with it |
focus | { lit, scope: all or links, level, always }: everything else dims |
highlight | things ringed while it lasts |
levels | how much of a thing or a connector is there (0 to 1); "*": every one not named |
variants | which of its looks a thing has from here on; "": its own |
enter | { fade, easing }: the ramp from the beat before |
ants | true, ids, or false: marching dashes; not said: the file's |
children | what moves: below |
| What moves | |
|---|---|
assemble, disassemble | a plan, as above |
travel | tokens along connectors, one after another; a nested list at once; "id:kind" colours one. each, hold, loop |
pulse, ants, draw, type | a ring (loop); marching dashes (speed, dash); connectors drawn (by, stagger); labels typed |
move, lift | a thing's x, y, scale, opacity as curves; things raised by so much, staggered, to: up or down. (0.35.0) What a thing holds goes with it: a floor's contents, at any depth, with their labels and notes; a lift of a thing and of something in it adds up |
focus, highlight, camera | for part of a beat; camera: { focus, zoom, margin } or fit |
sequence, series, layers | nesting, each with a clock of its own; a series may hold transitions |
Each takes from, duration and easing (a name, { bezier } or { spring }, which is Remotion's spring). layers at the top go over the whole document, and markers name moments ("data+1200").
Two clocks. at(ms) is the timeline's. What loops (ants, and a travel or pulse with loop) runs on an ambient one, so a player may pause the story and leave them going: at(ms, { ambient }), the same as ms unless given. Held at a time, they stand where they were then; 'off' (or ambient: off in the document): they never ran, and each stands at its start. Nothing is hidden.
In code, the same document: objects.motion().
const doc = objects.motion()
.beat('ask', { title: 'The question' }, { hide: ['db'], duration: '3s' }, b => b.travel(['r'], { each: 900, loop: true }))
.beat('data', { title: 'The data' }, { show: ['db'], read: true, enter: { fade: 400 } }, b => b.camera.focus('db', { over: 600 }))
.mark('answer', 'data+800')
.toJSON();Looks#
variants: on a node or a region names other looks of it: its own keys (role, ghost, label, sub, face, deco), over what it is. A beat's variants switches to one, and enter's fade crossfades. The box stays as it is, so nothing is laid out again. In a state it is variants: { id: { look: 0 to 1 } }.
On a page: <isometric-diagram>#
One script, with the compiler, the theme and the player in it. It fetches and stores nothing, evaluates nothing and adds no style element, so it runs under script-src 'self' alone (123 KB gzipped).
<script type="module" src="isometric-diagram.js"></script>
<isometric-diagram controls autoplay="visible" loop label="How a question is answered">
<script type="text/yaml">
isodiag: 1
scenes:
- id: ask
title: A question and its answer
nodes:
- { id: client, asset: person, label: Client }
- { id: api, asset: server, label: API, right-of: client, gap: 3 }
routes:
- { id: q, from: client, to: api, kind: send }
motion:
isomotion: 1
series:
- sequence: { name: ask, duration: 3s, say: { title: The question }, children: [{ travel: [q], loop: true }] }
</script>
</isometric-diagram>It is in the package as isometric-diagram.js, and import '@johnoscott/isometric-engine/player' defines it. (0.45.0) Its stack's part (el.stack, el.set, el.show: docs/STACK.md) is a second file beside it, isometric-stack.js, which it imports from the same place the first time a stack is drawn; a page of drawings and pictures never fetches it. Serve the two side by side (a CSP of script-src 'self' takes both); a host's bundler splits it the same way. The import is the literal relative import('./isometric-stack.js'), never a URL computed at run time, so a host that vendors the package as a tree (its files served under other names, relative paths kept) keeps it working. A host that copies the player into its own app copies both, side by side. Without the second file (or offline) the element draws no stack: it says "the stack's part did not load (isometric-stack.js, beside isometric-diagram.js)" in its place and raises isometric-error; set el.stack again once the file is there and it is loaded and drawn. (0.49.0) A third file, isometric-block.js, is the stack's part's own: it imports it the same way (import('./isometric-block.js'), literal, relative) the first time a show's building is a block (docs/STACK.md); serve and vendor all three side by side. Without it, a show with a block says "the block part did not load (isometric-block.js, beside isometric-stack.js)" and raises isometric-error. Write the text in a <script type="text/yaml">, or straight in the element with & and < escaped. It plays the scene's motion, or else its steps; a drawing with neither is drawn, and its file's own ants: march (0.19.0; before that only a motion's did).
| Attribute | |
|---|---|
controls | Play, Back, Next, Reset, the ambient switch, Motion off for a reader who asked for less motion, a scrubber, the beats as dots by chapter, the commentary and a text list of the beats. Without it, the drawing alone. |
autoplay | Plays at once. autoplay="visible": when most of it is in view; one on a page plays at a time, a reader's pause is kept, and at its end it stays (0.19.0: before that a scroll began it again; plain autoplay never did). |
loop, rate | Begins again at its end; how fast. |
ambient | on or off: the ants, and the tokens and pulses that loop (default: the document's). |
mode | light or dark (default: the reader's). |
scene | Which scene, by its id (default: the first). |
treatment | mono: black and white, in either mode; none: in colour, whatever the drawing says. |
label | What a screen reader calls it. |
reduced-motion | ignore (the default: motion plays, and a reader who asked for less has a Motion off button, with or without controls: everything is in place and lit, nothing moves, and the steps are open as text; and the page's own transport.play() does nothing; pressed again, it plays from the first step, unless the reader had paused it) or respect: a reader who asked for less motion sees the last state, everything lit, until they press Play. |
expand | off: no Enlarge button (0.18.0; by default there is one, in the corner, shown when the drawing is pointed at or by keyboard, always on a touch screen). It opens the same player, as it is, in a dialog nearly the size of the window; Esc or ✕ closes it and the focus goes back. Not on a #still. |
zoom | off: no zoom and pan (0.19.0; by default a reader has both, 1 to 8 times). On the page the wheel scrolls the page, as anywhere, and says once how to zoom; with ⌘ or Ctrl, or a trackpad's pinch, it zooms about the pointer, and two fingers zoom and move it on a touch screen (one scrolls the page). Enlarged, the wheel alone zooms and one finger moves it. Closer, a drag moves it, never off its edge, and a double click fits it. Keys on the drawing: +, −, 0, and Shift with the arrows (the arrows alone step; with no steps, they move it too). Buttons: Zoom out, Zoom in and Fit, shown when the drawing is pointed at or by keyboard (on a touch screen Fit, once it is closer; all three enlarged). It is on top of the document's own camera, kept when it is enlarged and when the same drawing is drawn again, and never stored. Not on a #still. Not part of the drawing: nothing exported has it. |
links | It follows the page's #step=3, #t=0.5 (how far into the step) and #still (one picture, no controls). |
opening, open | (0.40.0) For a stack (el.stack): one, drawers or all (default one); open with no value opens the whole opening, open="<floor id>" that floor (in one); without it, closed. |
Its properties are source, theme, motion (a document as data), stack, picture, transport and expanded; its methods, expand() (whether it is, after) and collapse(). Its events are expand, collapse, beat (detail.beat, detail.how), play, pause, end, loop, isometric-ready and isometric-error (a fault is also said in its place, in words). Arrow keys step; on the player itself, Space plays and pauses. With mountPlayer, zoom is yours to ask for: zoom: true.
A reader without the script sees what is in the element besides the text. isodiag build writes a still there: it is a command of the repository (bin/isodiag.mjs), not in the npm package. isodiag build PAGE.html -o OUT.html writes one for each element whose text is in a <script type="text/yaml">, in its mode and treatment; run again, it replaces the stills it wrote.
A stack (0.40.0): el.stack = model (a stack/1 model, as data) draws it as renderStackSvg does (each floor's name, the badges, the avatars, their rings and glyphs, in the element's theme and mode), in the opening and open its attributes ask for, fitted when it opens (to the element's width and, when the element has a height of its own, its height: the smaller scale wins), with the element's zoom, pan, double click to fit and Enlarge. Nothing plays and there are no controls. Its styles and its pose go on as CSSOM, so it too runs under script-src 'self' alone. A model with faults is said in words in its place; el.stack = undefined draws the element's text again.
<isometric-diagram opening="all" open label="The group"></isometric-diagram>
<script type="module">
import './isometric-diagram.js';
document.querySelector('isometric-diagram').stack = model;
</script>A picture (0.41.0): el.picture = { svg, css?, label? } shows a host's own SVG (it must have a viewBox) with the element's fit (both ways in a box with a height of its own), zoom, pan, double click to fit and Enlarge. Nothing plays and there are no controls. Its <style> elements and css become one stylesheet the element adopts, and its style attributes are put on as CSSOM, so it too runs under script-src 'self' alone. A space's picture comes from space-render's renderParts(text, state) (docs/editor/INTEGRATION.md); the element knows nothing of what a picture is of. The last of stack and picture set is shown; both unset, the element's text. A picture with no viewBox is said in words.
Your own marks (0.18.0): icons and screen faces a drawing names (deco: [{ icon: ours }], face: ours). The engine has nobody's. Register them with the element's own script: each of the package's bundles keeps its own, so registerMarks from another doesn't reach it. Elements already on the page are drawn again, where they were in their motion. (0.45.0) An agent's mark on a stack (member.agent.mark) is registered with the same script's registerAgentMarks (docs/STACK.md, "Agents": SVG markup for the inside of a 24 × 24 box, or { light, dark }), before or after a stack is set.
import { registerMarks } from './isometric-diagram.js';
registerMarks({
// (kernel, box) => SVG text: the box is the thing's, in grid units; line3 and poly take points [x, y, z]
icons: { ours: (k, b) => k.line3([b.x0, b.y0, b.z1], [b.x1, b.y1, b.z1], 'ico-ours') },
css: '.ico-ours { stroke: #d97757; stroke-width: 3 }',
});Black and white#
treatment: 'mono' (with resolveVars; renderSvg's and the element's too, and treatment: mono in the drawing's own file) paints a self-contained drawing in black and white, light or dark: the same shapes, ids and words, so its motion is the same.
- Each colour role becomes one of four greys, its three faces kept apart; roles on the same grey are told apart by a pattern (
hatch,hatch-wide,dots), in the order of their names. When there are more than can be,rendered.warningsnames them. - Each kind of connector has a dash and a weight of its own, all in ink; ants march in it.
- A ground (what is drawn on) has its pattern on its side only, so that what is written on it can be read.
- Dark inverts by role: what was nearest the paper is nearest it again.
rendered.monois the table used.
mono: { roles: { server: { step: 2, pattern: 'dots' } }, kinds: { send: { dash: [8, 3], width: 3 } } } is a host's own table, over ours. The page isodiag build FILE.yaml writes is in colour.
What changed between two drawings#
diffScenes(a, b) says it as plain data, by ids; drawDiff(a, b) draws it: the second drawing, with what changed since the first marked in it. Both are self-contained drawings (resolveVars) in one mode and treatment; it throws, and says so, for others.
const a = systems.compile(before, theme, { mode: 'dark', resolveVars: true, strict: 'throw' }).scenes[0];
const b = systems.compile(after, theme, { mode: 'dark', resolveVars: true, strict: 'throw' }).scenes[0];
const d = objects.drawDiff(a, b, { as: { oldid: 'newid' } });
d.rendered.svg; // the picture
d.legend; // [{ kind, words, color, dash?, opacity? }]: a row for each kind there is, for you to draw
objects.svgAt(d, { items: { 'was:db': { opacity: 0.5 } } });| A thing | A connector | |
|---|---|---|
| added | a solid outline | a solid band either side of its line |
| changed | a dashed outline | a dashed band: its ends, label, kind or arrowhead |
| moved | a dotted outline, and a fainter one where it was (moved and changed: dashed, with the fainter one) | re-routed: a dotted band, and a fainter dotted line where it went |
| removed | a ghost, unless ghosts: false | a ghost |
A region is marked for what its file says of it, or for a move whole; not when it only grew with what it holds. One pushed along by a neighbour counts as moved. A note is added (outlined) or removed (a ghost, with no outline). In black and white the four are told apart by their dashes. In a legend of yours, draw each swatch in its color and dash at full strength: opacity is how faint the thing itself is in the drawing (a ghost's .4), and a swatch that faint can't be made out. Marks and ghosts are things to a state: mark:ID, from:ID, was:ID, and a connector's band:ID and path:ID. The ids in its defs are its own, so a page may hold the two drawings and several diffs of them (id: a name of yours for them).
Compared: Before and After#
<isometric-diagram compare> holds two texts, before then after, and shows the second with what changed marked in it, with a Before | After pair, a slider between them, what each mark means and What changed as text (with controls; the drawing alone without).
<isometric-diagram compare controls>
<script type="text/yaml"> isodiag: 1 … as it was </script>
<script type="text/yaml"> isodiag: 1 … as it is </script>
</isometric-diagram>It opens on After. Before or After plays the way there, 900 ms (Space or k on the player turns it over); the slider goes straight to any place; autoplay goes from Before to After, once. What is in both and moved glides. Connectors that aren't the same go in the first fifth and come in the last, as marks and ghosts do; the rest is a crossfade, exact on any ground where the browser can add two pictures (mix-blend-mode: plus-lighter), and plain where it can't: there the ground shows through halfway. Tried in Chrome only: Safari and Firefox are untried. Neither drawing's own motion, steps or ants play; loop and ambient do nothing. A reader who asked for less motion has Motion off, and then there is no way between, only the ends and the slider's places. A fault says which of the two it is in. isodiag build PAGE.html writes its still, After as it rests.
Its properties: source (the second text), sourceBefore (the first), as (ids renamed: { old: 'new' }; one that can't be is said as a fault) and ghosts (false: what was removed is not drawn). With your own page, mountCompare(host, { comparison }) and COMPARE_CSS beside PLAY_CSS; the frames, with no page, are compareScenes(a, b):
const c = objects.compareScenes(a, b, { as: { old: 'new' } }); // two scenes, self-contained, painted alike
c.at(0.4); // { before, after, fade }: each drawing's SceneState, and how much of the second there is
c.svgAt(0.4); // the frame as one SVG; between the ends, on the drawing's own paper
c.changes; // [{ kind, what, name, was? }], in words; c.legend, as drawDiff'sA clock of your own: the transport#
A Timeline has no clock. transport is one: headless, for an app, an editor's preview or a player of your own.
import { transport } from '@johnoscott/isometric-engine/transport';
const tr = transport(timeline, { loop: false });
tr.on('time', () => paint(svg, tr.state(), scene.rendered));
tr.on('beat', (beat, how) => narrate(beat.say)); // each beat as it begins; after a seek, the one landed in
tr.play(); tr.pause(); tr.seek(1500); tr.seekBeat('data'); tr.next(); tr.rate = 0.5;
tr.ambient = false; // what loops stops where it is; on again, it goes on from there
tr.rebind(bindMotion(scene2, doc2)); // the place is kept by beat, and how far in itPaused, what loops goes on, until ambient is off. active = false stops both clocks for what nobody can see. clock takes one of your own ({ now, next, cancel }), for tests or a host that has frames already. paint's third argument, the scene's rendered, gives what a state adds (tokens, rings) a self-contained drawing's own colours; { styles: 'cssom' } as its fourth sets styles without style attributes, for a page whose CSP forbids them. motionSource(scene) is what bindMotion needs of a drawing, as JSON, for a page that has the drawing and no compiler.
In a Remotion video#
@johnoscott/isometric-engine/remotion draws a frame for each of Remotion's, from its number alone: in any order, in parallel, at any rate. It needs react (18 or later) and remotion (4.0.546 or later), which you install. They are optional peers: without /remotion, installing the engine installs neither.
import { IsometricScene, isometricMetadata, DEFAULT_THEME, type DrawingProps } from '@johnoscott/isometric-engine/remotion';
const Story = (p: DrawingProps) => <IsometricScene {...p} />;
<Composition id="Story" component={Story} defaultProps={{ src, theme: DEFAULT_THEME, motion }} calculateMetadata={isometricMetadata({ fps: 30, width: 1920, height: 1080 })} /><IsometricScene>takes the drawing's text (src), a theme's text, and what it may have:motion(default: the scene's own, else its steps),scene,mode,treatment: 'mono',font,ambient: 'off'; andwidth,height(both100%of what it is in, where the drawing keeps its proportions),style,className,prefix(its ids' beginning). A fault in the drawing or its motion is thrown, with every one said.isometricMetadatamakes the video as long as the motion.useIsometricCues(props)is the commentary now, for a caption of yours.<IsometricSequences>is a RemotionSequencefor each beat, by its name, with what you put beside it: its children are a function of the beat (beat => <h1>{beat.say?.title}</h1>).- In a
TransitionSeries:isometricTiming({ spring: { damping: 200 } })(or{ linear: 400 },'1.2s','12f') is a document's transition as a timing, andisometricPresentation()its fade. Both scenes fade, as a drawing has no ground of its own;{ exiting: 'stay' }keeps the one going out. - With no React:
drawingOf(props),frameSvg(drawing, frame, fps),cueAt,framesOf,timeOf, the same numbers (the module itself imports both).
samples/remotion is a small project of its own. It is in the repository (github.com/johnoscott/isometric-diagrams), as this page is; neither is in the npm package.
Remotion isn't open source, and using it needs Remotion's own licence (remotion.dev/license). Rendering is your own setup, with Remotion's renderer:
- Passing
licenseKey: 'free-license'to it makes Remotion report each render to remotion.pro. With nolicenseKey, Remotion 4 sends nothing. - The first render downloads a Chrome, unless you give
browserExecutable.
A document's curves beside Remotion's functions (tested against 4.0.546): interpolate gives the same numbers, however it extends; a spring is the same at every frame; linear, bounce and { bezier } are Easing's. ease, ease-in, ease-out and ease-in-out are CSS's: Remotion's Easing.ease is our ease-in, and Easing.inOut(Easing.quad) is near our ease-in-out and is not it.
Text. A drawing is laid out with the system font's widths as measured on a Mac, so another computer's letters may not fit them exactly. For a video, use a font you load: Arimo (OFL 1.1, close to Helvetica). It is not in the package; the sample has the file, unmodified, with its licence.
loadFont(isometricFonts({ url: staticFile('Arimo-wght.ttf') })); // @remotion/fonts; your own file or URL
<IsometricScene {...p} font="arimo" />font: 'arimo'lays the text out with Arimo's widths and asks forArimo, Arial, Helvetica, sans-serif; the SVG saysdata-font="arimo". It is never the default. Choosing it can move things: labels are narrower or wider, and the layout follows. The widths are in code too:compile(src, theme, { resolveVars: true, font: ARIMO }), frommodules/iso-core/arimo.- Arimo's weights are 400 to 700, so what is 800 is drawn as 700.
- No monospaced font is chosen: that text stays the system's, and can differ from one computer to another.
How it is tested: the components are mounted with react-dom through Remotion's Internals, with remotion pinned exactly. A Remotion update may break those tests without breaking you; the fix is in the tests' harness. Rendered video files are not tested here.
Animating the SVG yourself#
Every part of a thing is in a wrapper of its own, with no transform and no class: <g data-item=ID data-part=…> (block, wall-1…, gate, name, label, note), and a connector's <g data-route=ID data-part=…> (line, with its arrowhead's marker; label). data-item and data-part together are one wrapper's. Move and fade wrappers: the texts inside have transforms, and some classes opacities, of their own. There is a wrapper a part and not one a thing, because a thing's parts are painted in different layers (its label over every block). data-id is on every part of a thing.
Self-contained drawings#
systems.compile(yaml, theme, { mode: 'light' | 'dark', resolveVars: true }): each scene's SVG carries its colours and text styles on its elements, with no stylesheet, custom properties, hsl() or color-mix(); frames of it too. strict: true leaves scenes empty when the file has an error, strict: 'throw' throws a CompileError with its diags. stepMs gives every step the same length. Fonts are the host's: the SVG names a stack and embeds none.