Mandelbrot explorer · glm-5.2
Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.
transcript · 4 messages
Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.
thinking
Let me create a single-page Mandelbrot set renderer with pan and zoom.
/workspace/index.html (11024 bytes)Successfully wrote 11024 bytes to /workspace/index.html
Done. `index.html` is a fully self-contained Mandelbrot explorer. **Features:** - **Full-screen canvas** rendered at device-pixel-resolution (capped at 2x for performance), tiled in 64×64 chunks so renders stay responsive and can be cancelled mid-frame. - **Smooth color gradient** using the continuous (normalized) escape-time formula `i + 1 − log₂(log|z|)` mapped onto a cyclic cosine palette of 2048 precomputed colors — no visible banding, seamless wrap. - **Click-and-drag to pan** (mouse + touch), with grab/grabbing cursors. - **Mouse-wheel zoom** anchored to the cursor position so the spot under the pointer stays fixed (also pinch-zoom on touch). - **Adaptive iteration depth** that scales with zoom level (100→2000), plus cardioid/period-2-bulb early-out for speed. - **HUD** showing live zoom factor, center coordinates, and current iteration count, plus a **Reset** button. - Stale renders are cancelled via a token, so rapid panning/zooming doesn't queue up work. Open `index.html` in any browser — it runs entirely offline with no external resources.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Mandelbrot renders with smooth pink/purple gradient; drag pans and wheel zooms correctly, but leaves black rendering artifacts at the bottom.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.