docs/capture-diagrams.md
{: .fs-9 }
Record the interactive SVG architecture diagrams as GIF and MP4 files. {: .fs-6 .fw-300 }
The project provides two capture scripts that use Puppeteer to record SVG animations from the VitePress documentation site and encode them into GIF and MP4 via ffmpeg.
| Script | Target Page | Output Files |
|---|---|---|
capture-arch.mjs | /arch-demo | arch-diagram.mp4, arch-diagram.gif |
capture-claw-dhp.mjs | /claw-dhp-demo | claw-dhp-diagram.mp4, claw-dhp-diagram.gif |
CHROME_PATH environment variablePATHcd docs
npm install
cd docs
npm run dev -- --port 5180
Keep this terminal running.
Open a new terminal:
cd docs
# Capture the NHP architecture diagram
node capture-arch.mjs
# Capture the OpenClaw + DHP architecture diagram
node capture-claw-dhp.mjs
Output files are written to docs/recordings/.
Both scripts support environment variables for customization:
| Variable | Description | Default |
|---|---|---|
CAPTURE_URL | Full URL of the target page | http://localhost:5180/<page> |
CHROME_PATH | Path to Chrome/Chromium executable | Auto-detected |
Example:
CHROME_PATH=/usr/bin/chromium node capture-arch.mjs
Default values are defined at the top of each script and can be edited directly:
| Parameter | capture-arch.mjs | capture-claw-dhp.mjs |
|---|---|---|
| Viewport | 1200 x 800 | 1920 x 1080 |
| Duration | 8 seconds | 8 seconds |
| FPS | 30 | 30 |
| GIF scale width | 800px | 1920px |
| GIF palette colors | 128 | 256 |
.arch-wrapper or .claw-dhp-wrapper)svg.setCurrentTime()