Menu

Step-by-step animations

Markers at the end of a line make a diagram unfold step by step, for a talk, a tutorial or an incident review. One file gives the HTML reader, the GIF and an image per step.

animation.skemo
diagram(dir="right")
  card#idea.t3 Idea             @1
    to(proto)
  card#proto.t2 Prototype       @2:up
    | two weeks                @2.5
    to(prod)
  card#prod.t1 Product          @3:zoom @4:focus
Diagram rendered by skemo from animation.skemo, step 1
Diagram rendered by skemo from animation.skemo, step 1
Step 1
Diagram rendered by skemo from animation.skemo, step 2
Diagram rendered by skemo from animation.skemo, step 2
Step 2
Diagram rendered by skemo from animation.skemo, step 2.5
Diagram rendered by skemo from animation.skemo, step 2.5
Step 2.5
Diagram rendered by skemo from animation.skemo, step 3
Diagram rendered by skemo from animation.skemo, step 3
Step 3
Diagram rendered by skemo from animation.skemo, step 4
Diagram rendered by skemo from animation.skemo, step 4
Step 4

Markers

WriteMeaning
@2appears at step 2 (effect fade; draw for an arrow)
@2:upappears at step 2 with the effect up; effects: fade up zoom draw
@2-4visible from step 2 to step 4 included, then hidden
@0-2 (preview)visible from the start to step 2 included, then hidden
@4:focus, @4-6:focushighlighted at step 4 (or from 4 to 6): the rest is dimmed
@3-4:halo, @5:chase, @6:magnifya highlight played by the tool that shows the SVG (glitu): written in data-highlight, not drawn in PNG, GIF or WebP

Markers go at the end of a card, zone, | or to(…) line, after at least one space, and are removed from the displayed text. Steps are ordered values, not a count: @2.5 slots between 2 and 3 without renumbering anything.

Replacing a line (preview)

Diagram rendered by skemo from replace-line.skemo, step 0
Diagram rendered by skemo from replace-line.skemo, step 0
Step 0
Diagram rendered by skemo from replace-line.skemo, step 1
Diagram rendered by skemo from replace-line.skemo, step 1
Step 1
Diagram rendered by skemo from replace-line.skemo, step 2
Diagram rendered by skemo from replace-line.skemo, step 2
Step 2
replace-line.skemo
card#svc Service
  | type: NodePort    @0-1
  | type: ClusterIP   @2
card#pod Pod           @1
  to(svc)

@0-1 shows a line from the start and hides it after step 1; the next line appears at step 2. Lines that are never visible together share one place: the card is one line tall and the text changes in place.

Animating a chip (preview)

Diagram rendered by skemo from tag-step.skemo, step 1
Diagram rendered by skemo from tag-step.skemo, step 1
Step 1
Diagram rendered by skemo from tag-step.skemo, step 2
Diagram rendered by skemo from tag-step.skemo, step 2
Step 2
tag-step.skemo
card#svc Service
  to(pod)
card#pod(tag="8080 @1") pod-a
  | 10.0.0.12 @2

Markers at the end of a tag="…" value animate the chip alone: tag="8080 @1" shows the port at step 1. In HTML, this works with the band (default) and header looks.

Rules

  • At most one appearance marker per element; as many :focus and highlights as you like.
  • A child never appears before its parent nor outlives it (a card in a zone, a line in a card).
  • An arrow without a marker appears with the later of its two ends, drawn progressively.
  • Only the final tokens of a line are markers: meet @3 tomorrow stays text. \@2 writes a literal @2; admin@example.com needs no escaping.
  • An inconsistent marker (earlier than its parent, a range with no later step) gives a warning and is adjusted.

Outputs

CommandResult
skemo talk.skemo -o talk.htmlstandalone page with a step reader: arrow keys, space or PageDown
-o talk.gif, -o talk.apng, -o talk.webpanimation with the effects (--hold, --transition, --fps, --final-hold, --no-loop)
--step 2 -o s2.pngone state
--animated -o talk.pngone PNG per state (talk.00.png…)
--board -o board.pnga contact sheet of every state

In SVG, skemo animates nothing itself: it marks elements with data-step, data-fx, data-until, data-focus and data-highlight, for your own player. The root <svg> lists the steps in order in data-states (["1","2","2.5","3"]), so a player that only counts whole steps, such as reveal.js fragments, can map 2.5 to its own index.

See also