Mandelbrot explorer

Every pixel of this fractal is computed on the server and sent as inline SVG: neighboring pixels of the same color are merged into horizontal lines, and all lines of one color share a single path.

To show something as early as possible, the page first streams a blurry preview at 1/8 of the resolution. Then an async function* component computes the image in strips of 32 rows and yields each strip as soon as it is ready, so the sharp picture builds up from top to bottom while the rest is still being computed.

Click into the image to zoom in by a factor of four, or drag a box to zoom into that area. A small script turns your selection into new coordinates and reloads the page, which keeps your scroll position.

Switch to Web Workers to move the work into your browser: the server only sends empty slots, and a pool of workers (one per CPU core) runs the very same fractal.js and Picture component. Each worker renders its strips to markup with jsxToString from jsx-async-runtime and posts the string back, so the main thread stays free while all cores compute in parallel.

Real
-0.745300000000
Imaginary
0.112700000000i
Zoom
38×
Iterations
827
Rendered in
streaming…2663 ms