Animated flows (preview)
Two arrow classes loop for as long as the diagram is shown: .pulse sends one glowing dot from the source
to the head, .flow streams dashes along the line. They show where requests and events go, at a glance.
motion.skemo
//- Arrows in motion: a dot per request, dashes for a stream
diagram(dir="right")
card#phone.client(icon="smartphone") Mobile app
to(gateway).pulse requests
card#gateway.svc(icon="shield") API gateway
to(orders).pulse
to(stock).pulse
card#orders.svc Orders
to(kafka).flow.orders events
card#stock.svc Stock
card#kafka.store(icon="activity") Event streammotion.css
.client { --c: #7048E8; }
.svc { --c: #3E6FC4; --label: "Service"; }
.store { --c: #B45309; --label: "Kafka"; }
.edge.orders { color: #E8590C; --flow-speed: 40px; }The diagram above moves in your browser; it is the SVG output with --motion.
How it is written
to(gateway).pulse requests: one dot per arrow at any time. Every dot runs at the same speed, so the dots of all arrows leave together and a long arrow takes longer.to(kafka).flow events: dashes moving towards the head, for a continuous stream.- Settings are CSS properties on the arrow's class:
.edge.orders { --pulse-color: #E8590C; --pulse-size: 7px; --pulse-speed: 200px; }
.edge.flow { --flow-speed: 30px; } /* px per second */
Where it plays
| Output | Motion |
|---|---|
HTML (-o f.html) | plays; stopped for readers who ask their system for less motion |
SVG with --motion | plays, also inside an <img> tag (CSS animation, no script) |
| GIF, APNG, animated WebP | one loop, frame by frame; APNG keeps the glow's colours best |
PNG, WebP, SVG without --motion | still: the arrows are drawn as plain solid lines |
Motion and steps combine: a diagram that unfolds step by step can have pulsing arrows at every step (Step-by-step animations).
See also
- Arrows: every arrow class.
- Command line:
--fps,--holdand the other timing options.
