Metadata-Version: 2.4
Name: animate-diagram
Version: 0.1.0
Summary: CLI tool to animate data-flow arrows in SVG diagrams and export a GIF.
License: MIT License
        
        Copyright (c) 2025
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: svg,gif,diagram,animation,excalidraw
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Console
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cairosvg>=2.7
Requires-Dist: Pillow>=10.0
Requires-Dist: playwright>=1.43
Dynamic: license-file

# 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](docs/source.svg)

After (animated GIF):
![Animated diagram](docs/output.gif)

## Build and Run
Requires Python 3.9+.

1) Install dependencies:
```bash
pip install -e .
```

2) Install Chromium for the default renderer:
```bash
playwright install chromium
```

3) Run the CLI:
```bash
python -m animate_diagram path/to/diagram.svg output.gif
```

Or via the console script:
```bash
animate-diagram path/to/diagram.svg output.gif
```

Useful flags:
```bash
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):
```bash
animate-diagram input.svg output.gif --renderer chromium
animate-diagram input.svg output.gif --renderer cairosvg
```

## License
MIT. See `LICENSE`.
