Skip to content

Explore the Mandelbrot set fractal in your browser. Built with Rust, Wasm, and TypeScript.

License

Notifications You must be signed in to change notification settings

rosslh/Mandelbrot.site

Repository files navigation

Mandelbrot.site icon

Mandelbrot.site

Mandelbrot.site is an interactive fractal viewer that runs in the browser. It offers a fast and intuitive way to explore the Mandelbrot set and share your discoveries. Built with Rust, WebAssembly, TypeScript, and Leaflet.js.

GitHub branch check runs Uptime Robot status Uptime Robot ratio (30 days) MIT license

Features

Mandelbrot.site offers a variety of features to enhance your experience:

  • Zoom in by scrolling or selecting a region.
  • Adjust the detail level by modifying the iteration count or resolution.
  • Download high-resolution images of your current view.
  • Generate URLs to share your favorite Mandelbrot set locations.
  • Customize your experience with different color palettes.
  • Explore multibrot sets by changing the exponent parameter.
  • View and update viewport coordinates on the complex plane.

Gallery

Explore some stunning images generated with Mandelbrot.site:

Mandelbrot Example 1 Mandelbrot Example 2

View more images

Architecture

Mandelbrot.site is built using modern web technologies to deliver a high-performance, interactive tool for exploring fractals. The computational backend is implemented in Rust, chosen for its performance and safety features. This Rust code is compiled to WebAssembly (Wasm) using the wasm-pack plugin, enabling high-speed computations directly in the browser. On the frontend, the user interface is crafted with TypeScript, enhancing code quality and maintainability. Leaflet.js is creatively adapted to render the Mandelbrot set tiles in a zoomable, map-like interface.

For performance optimization, it employs Web Workers via the threads.js library. This setup prevents intensive computations from blocking the main browser thread by creating a pool of workers that handle the generation of Mandelbrot set tiles in parallel. A key optimization technique used is "rectangle checking," which saves computation time for areas entirely within the set by checking only the perimeter of a tile.

This robust architecture ensures that Mandelbrot.site provides a seamless and responsive experience for users exploring the intricate details of the Mandelbrot set directly in their web browser.

Development

This project requires Node.js to be installed on your system. Check the client/.nvmrc file for the recommended Node.js version. Development scripts are available in client/package.json.

A complete guide can be found in CONTRIBUTING.md.

Contributors

Many thanks to the following contributors who have helped shape this project:

Name GitHub Profile
Ross Hill Ross Hill rosslh
Joseph Weissman Joseph Weissman jweissman
Shubhankar Shandilya Shubhankar Shandilya shubhankar-shandilya-india

Want to contribute? Check out the list of open issues and read our contributing guidelines.