Convert a Worldographer wxx file into a D3js web visualization
  • Python 61.8%
  • HTML 28.2%
  • CSS 10%
Find a file
Brad Wenner c5f7e5319c
All checks were successful
Build and Push to Pages / build-and-deploy (push) Successful in 1m53s
Add icosahedral map for testing. Fix layer order - render in file order
2026-01-14 17:26:10 -08:00
.forgejo/workflows
assets Add icosahedral map for testing. Fix layer order - render in file order 2026-01-14 17:26:10 -08:00
src Add icosahedral map for testing. Fix layer order - render in file order 2026-01-14 17:26:10 -08:00
.gitignore
build.py
CLAUDE.md update claude, remove invalid file 2026-01-14 16:10:53 -08:00
README.md Normalize sizes when using old hxm file conversions 2026-01-14 16:53:43 -08:00

webographer

Transform Worldographer .wxx map files into interactive D3js visualizations for publishing on the web.

Example Maps

Direct Linking to Hexes

Share specific locations using URL parameters:

?x=25&y=12          # Center on hex at column 25, row 12
?x=25&y=12&zoom=3.5 # Also set zoom level

How to Use

1. Add Your Map Files

assets/
├── your-map.wxx              # Your Worldographer map file
└── icons/                    # (Optional) Your icon pack
    ├── worldographer-*.wxx   # Icon config file
    └── *.png                 # Icon images

2. Build

python3 build.py

The build will:

  • Find all .wxx map files in assets/
  • Extract terrain colors from icon config (if present)
  • Generate per-map resources with smart fallbacks
  • Create standalone and embed versions

Example output:

Building map: Aendrim - MCDM
  ✓ 38 colors extracted from icon config
  ⚠ 6 generated with fallback
  ✓ 35 icons mapped
  ⚠ 9 terrains use color fill only

3. Test Locally

python3 -m http.server 8000 --directory dist
# Open http://localhost:8000

Development Info

Project Structure

pyora-hex/
├── assets/
│   ├── *.wxx                    # PUT YOUR MAP FILES HERE
│   └── icons/                   # PUT YOUR ICON PACK HERE (optional)
│       └── worldographer-*.wxx  # Icon config (auto-detected)
├── build.py                     # Run this to build
└── dist/                        # Generated output (don't commit)
    ├── index.html               # Map list (or redirect if single map)
    └── {mapname}/
        ├── standalone/          # Full-screen version
        │   ├── index.html
        │   ├── map_data.json
        │   ├── terrain_colors.json
        │   └── terrain_icon_mapping.json
        └── embed/               # Iframe version

What gets generated:

  • data/ - Intermediate JSON files (not committed)
  • dist/ - Final HTML/JSON/assets (not committed to main)

Deployment

Option 1: Static Hosting (nginx, Apache, etc.)

Copy the dist/ directory to your web server:

rsync -av dist/ user@server:/var/www/your-map/

Option 2: Iframe Embed

Upload the embed/ directory and embed anywhere:

<iframe
  src="https://your-site.com/maps/your-map/embed/index.html"
  width="100%"
  height="600px"
  frameborder="0">
</iframe>

Option 3: Automated CI/CD

The repo includes Forgejo Actions workflow (.forgejo/workflows/build-and-push.yml) that automatically builds and deploys on push to main.

Advanced: Customizing Fallback Colors

The system automatically generates smart fallback colors, but you can customize the logic in src/generate_map_resources.py:

def generate_fallback_color(terrain_name, all_extracted_colors):
    # Category heuristics
    if 'water' in terrain_name.lower():
        return '#006699'  # Blue
    if 'lava' in terrain_name.lower():
        return '#ff4500'  # Orange-red
    # ... customize as needed

Credits