Skip to main content

CLI tool to animate data-flow arrows in SVG diagrams and export a GIF.

Project description

Animate Diagram

CLI tool to animate data-flow arrows in SVG diagrams and export a GIF. This project was created by Codex.

Notes:

  • Works with Excalidraw diagrams today.
  • Other SVG sources are not fully tested but may work.

How It Works

The tool detects arrow groups in the SVG (as Excalidraw exports them), infers the arrow direction, and applies a dashed stroke animation only to the arrow bodies. Each frame is rendered to PNG and then assembled into an animated GIF.

Before (source SVG): Source diagram

After (animated GIF): Animated diagram

Build and Run

Requires Python 3.9+.

  1. Install dependencies:
pip install -e .
  1. Install Chromium for the default renderer:
playwright install chromium
  1. Run the CLI:
python -m animate_diagram path/to/diagram.svg output.gif

Or via the console script:

animate-diagram path/to/diagram.svg output.gif

Useful flags:

animate-diagram input.svg output.gif --frames 12 --dash-length 6 --gap-length 6 --step 2 --duration 80

Renderer selection (default is Chromium for better font fidelity):

animate-diagram input.svg output.gif --renderer chromium
animate-diagram input.svg output.gif --renderer cairosvg

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

animate_diagram-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

animate_diagram-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file animate_diagram-0.1.0.tar.gz.

File metadata

  • Download URL: animate_diagram-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for animate_diagram-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa487b402771a4084c582fc8fc1b548f96f99874b87be5a602e2c5463a4efed3
MD5 cf6e001c5b3f15d7f42e29fa0dc989d9
BLAKE2b-256 4066885350f5228fd83bd1cb982661c8d6a38e1d4187ee71aac2e4e606dee2bc

See more details on using hashes here.

File details

Details for the file animate_diagram-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for animate_diagram-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 212322acdb2ad2f1b0efd21b785b8002c43e27e7e1e3f60b592c00be904d9458
MD5 308fb1d4abbf8e2eba6758324bd14534
BLAKE2b-256 b976c767ec6acdac6ced04bc553a8003c8f8741efc1bfa389e5842a7d6f60dbc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page