Skip to content

Exporting Diagrams

Vivek Sarin edited this page Nov 20, 2026 · 3 revisions

Exporting diagrams

FlowMotion can download an animated SVG from a diagram in Obsidian. Developers can also export static SVG and HTML files with the tools below.

Download an animated SVG

Select SVG ↓ on the diagram's control bar. FlowMotion saves the current Obsidian theme colors in the .svg file, so the colors do not depend on Obsidian when you open it elsewhere.

The exported SVG uses SMIL animation and plays independently of Obsidian. Playback depends on the viewer's SVG animation support.

The download contains the whole timeline from the beginning, not the current frame or only the visible scene. It repeats independently and does not retain interactive Next pauses, the current slider position, or player speed settings. Open it in an SVG-animation-capable browser to check it. Some Markdown hosts or image previews may suppress animation.

The snapshot resolves FlowMotion's Obsidian theme palette. It is not a capture of arbitrary CSS snippets, custom fonts, or the surrounding note. Explicit scene colors are preserved.

There is no GIF export or export configuration keyword. For authoring rules, see the authoring reference.

Output formats

The functions are in src/export/html.ts:

Function Output Notes
animatedSvg(model, theme) An SVG that animates by itself Uses SMIL. Pass light, dark, or a concrete palette with resolved colors
staticSvg(model, theme, at) An SVG with no movement at is the time shown. The default is the idle state, before anything runs
standaloneHtml(models, runtimeJs, css, title, theme) One HTML page with the controls Embeds the runtime bundle (dist/flowmotion-runtime.js) and the stylesheet

Create the example files

The script scripts/build-examples.ts exports five YAML examples: retain-poc, retain, recall, reflect, and hindsight-retain. The last one is a storyboard.

  1. Run npm run build first. The script reads dist/flowmotion-runtime.js and styles.css, so the build must have run.
  2. Run npm run examples.
  3. Open the out folder.

The script writes the following files:

File What it is
out/<name>.animated.svg The animated diagram, light theme
out/<name>.animated.dark.svg The animated diagram, dark theme
out/<name>.static.svg The diagram with no movement
out/preview.html One page with the five examples and their controls
out/hindsight.html One page with only the hindsight-retain storyboard

The out folder is created when it does not exist. The files are overwritten on each run.

Export one file

scripts/render-one.ts writes the static SVG for a single source file:

npx tsx scripts/render-one.ts <source file> <output file> [theme]

The source can be any input format that buildModel accepts. The theme is optional. Use it to check a new diagram before you add it to the examples.

Related pages

Clone this wiki locally