From c8946f614ee46796f6e0c93dbbbee076862595e2 Mon Sep 17 00:00:00 2001 From: copilot-swe-agent <223556219+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 12:01:32 +0000 Subject: [PATCH] Add standalone Mandelbrot set renderer in JavaScript Includes a dependency-free HTML5 canvas renderer with smooth coloring, interactive zoom/pan, and PNG export. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- examples/mandelbrot/README.md | 27 ++++ examples/mandelbrot/index.html | 243 +++++++++++++++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 examples/mandelbrot/README.md create mode 100644 examples/mandelbrot/index.html diff --git a/examples/mandelbrot/README.md b/examples/mandelbrot/README.md new file mode 100644 index 000000000..c81c85a51 --- /dev/null +++ b/examples/mandelbrot/README.md @@ -0,0 +1,27 @@ +# Mandelbrot Set Renderer + +A small, dependency-free Mandelbrot set renderer built with plain JavaScript +and the HTML5 Canvas API. + +## Usage + +Open `index.html` in any modern web browser (no build step or server +required): + +```sh +open examples/mandelbrot/index.html # macOS +xdg-open examples/mandelbrot/index.html # Linux +``` + +## Features + +- Smooth (continuous) coloring using the fractional escape-time algorithm. +- Interactive zoom: scroll the mouse wheel, or click to zoom in + (shift+click to zoom out). +- Drag to pan around the set. +- Iteration budget automatically increases as you zoom in, revealing finer + detail. +- "Reset View" button restores the default view; "Save PNG" downloads the + current render as an image. +- Early-out checks for the main cardioid and period-2 bulb speed up + rendering of large interior regions. diff --git a/examples/mandelbrot/index.html b/examples/mandelbrot/index.html new file mode 100644 index 000000000..d8e39ccfc --- /dev/null +++ b/examples/mandelbrot/index.html @@ -0,0 +1,243 @@ + + +
+ +