After cloning the repository, install dependencies and Chrome:
pnpm install
npx puppeteer browsers install chromeThe simplest way to test the export tool:
pnpm export --sample output.pngThis will:
- Use built-in sample map data
- Export to
output.pngat 18×24 inches (default) - Take approximately 7-8 seconds
- Produce a ~114KB PNG file at 5475×7275 pixels
Export your own map definition:
pnpm export data/my-map.json output.pngChoose from three standard sizes:
# 12×16 inches (3675×4875px @ 300 DPI)
pnpm export --sample output.png --size 12x16
# 18×24 inches (5475×7275px @ 300 DPI) - DEFAULT
pnpm export --sample output.png --size 18x24
# 24×36 inches (7275×10875px @ 300 DPI)
pnpm export --sample output.png --size 24x36pnpm export --helpCreate a JSON file with this structure:
{
"title": "Your Map Title",
"subtitle": "2010-2024",
"people": [
{
"id": "unique-id",
"name": "Person Name",
"color": "#FF6B6B",
"locations": [
{
"countryCode": "US",
"longitude": -74.006,
"latitude": 40.7128,
"date": "2010-01-01"
}
]
}
],
"rotation": [-20, -30, 0]
}See data/sample-map.json for a complete example.
Each export produces a print-ready PNG with:
- ✅ Exact dimensions for chosen print size at 300 DPI
- ✅ Embedded sRGB ICC color profile (required by Printful)
- ✅ Maximum quality PNG compression
- ✅ All fonts loaded and verified
- ✅ Validated output
Install Puppeteer's Chrome:
npx puppeteer browsers install chromeThe tool will automatically try different ports if 5173 is taken.
This warning is normal and can be safely ignored.
The tool automatically validates:
- Dimensions match print specification
- sRGB color space
- ICC profile is embedded
- PNG format
If validation fails, the tool will report specific errors.
Typical export times:
- 12×16: ~6.8 seconds
- 18×24: ~7.6 seconds
- 24×36: ~10-12 seconds (larger file)
The CLI tool:
- Validates your map definition
- Starts Vite dev server programmatically
- Waits for server to be ready (HTTP polling)
- Launches Puppeteer headless Chrome
- Renders map at exact pixel dimensions
- Verifies all fonts loaded
- Takes full-page screenshot
- Embeds sRGB ICC profile with Sharp
- Validates output
- Stops server (always, even on error)
No manual server start required!