Documents et Arche › Animations

Documents et Arche

Cette page n’est pas encore traduite : voici la version anglaise.

Animations

A slide that shows a design should still be right the week after it was drawn. Arche's stories get there by pointing at the model instead of screenshotting it; an animation does the same for the moving pictures on those slides: it is one of Arche's animation templates, and the content it draws is written in the model and can name the model.

animation v-handover "From the terminal to the PL" from flow {
  stops [terminal, kria.ps, kria.pl]   // the components: each shows its name
  speed TILES * 55                     // a formula: the app works it out on the slide
  height 160
  group "Stories"
  duration 4s
}

archec build writes what Arche's own animation editor writes, so the app opens it as one of its own:

File What it holds
visuals/v-handover.html The drawing: the template's code, unchanged.
visuals/v-handover.yaml The content it draws, read by the drawing as arche.data.
visuals.yaml Its entry: name, height, group, duration, the parameters it is sent.

Templates#

The templates are Arche's own — 72 of them, in 14 categories: flows (a message along a path, pipelines, sequences, a producer and a consumer around a buffer, retries), timing (timelines, waveforms, latency budgets, schedules), state machines (a walk, a life cycle, checks passing and failing, fail-over), signals, data, interfaces, FPGA, hardware, geometry, mission, naval, antenna and comms.

archec animation list               # the gallery, by category
archec animation list Timing        # one category
archec animation show lifecycle     # what it draws, the data it reads, a starter block
archec animation new sequence v-boot --into app/visuals.arche

show lists each piece of data the template reads, its shape and what the template's own sample says of it. new writes a starter block whose data is the template's sample, in the language — it builds as it is, and draws what the template's gallery picture draws, until you make it say something else.

The template is named in the header (from flow) or as a property (template flow). Arche bundles the library into archec (vendor/animations.js), so a template the app adds is checked here as soon as archec is rebuilt beside it.

The content, and the model#

Every property that is not one of the visual's own (height, group, comment, duration, fps, params, tags, variants, and data-file, where the content is written when not visuals/<id>.yaml) is content for the template, written the way the language writes values:

Written Written for the drawing
step 1.4, ok true, title "Gain per channel" as written
stages Parse, Compute, Write a list (as [Parse, Compute, Write])
{ label: PS, x: 320 } a record
kria.ps — a component, a system, a requirement… its name, as the app shows it
TILES — a constant or a parameter ${TILES}: the app reads the project on the slide
TILES * 8 ${TILES * 8}, worked out the same way
a bare word that names nothing the word

So a slide follows the design: rename the component and the stop says the new name; change TILES and the dot goes faster. A dotted path that names nothing is a warning — it is more likely a typo than a caption.

A list of names where the template wants records. flow reads stops: [{ label, x }]; stops [terminal, kria.ps, kria.pl] is enough. Each name becomes the record's label, and its other fields come from the template's sample: a position the sample spreads (80, 320, 560) is spread the same way over however many there are, any other number is taken from the sample item at the same place.

A state machine. machine <component> fills what a state-machine template reads: states (in the states template, the order they are reached in; in lifecycle, each state placed in columns by how many transitions it is from the initial one), edges (the transitions and their triggers, bent when two states go both ways) and walk (every transition, taken once where it can be).

animation v-life "Life cycle" from lifecycle { machine kria.ps.app; step 1.5 }

A scenario. scenario <id> (or scenario <id>.<sequence>) fills the sequence template: the participants become the lifelines (actors), its steps the arrows (messages), each labelled with its message.

animation v-boot "Boot" from sequence { scenario boot }

What is written in the animation wins over what the model gives.

A drawing of its own#

code "visuals/beam.html" (relative to the file it is written in) is an animation drawn by your own HTML, run in the same sandboxed frame and fed the same way. It is copied into the project beside the others. params lists the parameters it is sent as arche.params; a drawing that reads one it is not sent (arche.params.ELEMENTS) is a warning, since it would arrive undefined. With a template too, the template says what data the code reads.

What is checked#

Code
animation-template the template does not exist (with the nearest one), or there is neither a template nor code
animation-data data the template does not read; a value of the wrong shape (a word where a number is wanted, a field a record does not have); a path that names nothing; a formula over names that are not constants or parameters
animation-binding machine or scenario names nothing, or the template draws nothing from it
animation-param params names something that is not a constant or parameter; the drawing reads one it is not sent
animation-visual a story step animates something that is not a visual or an animation
animation-code the code file does not exist

In a story#

story tour "The tour" {
  step s1 "Booting" { text "The PS talks to the PL."; animate v-boot; dwell 8s }
}

animate is the step's visuals, checked against the project's visuals and animations. dwell is how long the step stays when the story plays by itself.

Seeing one without Arche#

archec animation preview main.arche v-boot --open   # a page that plays it
archec animation render main.arche v-boot -o boot.gif
archec story export main.arche tour --lang en -o tour.html
  • preview writes a page that plays the animation in a sandboxed frame, exactly as a slide does, its ${…} worked out against the constants and parameters; light or dark.
  • render records a GIF the way Arche's .pptx export records one — the drawing paints its own frames — in headless Chrome or Chromium (--chrome, $CHROME). One cycle of its duration (3 s without) at its fps (10).
  • story export writes the whole story as one file for someone with no Arche: the steps in the language asked, the animations running, the pictures, a step on a system its block diagram, the notes (n), and p (or #play in the address) to play it by itself, each step for its dwell. Nothing is fetched.

In VS Code#

  • The Animations view: the project's animations (click to preview) and the templates by category (click to insert a starter block at the cursor).
  • ▶ Preview above each animation: the preview opens beside the editor and follows the model — edit the data, the picture changes.
  • After from, completion offers the templates; at the start of a line in an animation, the data its template reads and has not been given, each with its sample as the value. Hover says what a piece of data is for.