Skip to content

Commit

Permalink
Update readme and example images
Browse files Browse the repository at this point in the history
  • Loading branch information
rosslh committed Feb 10, 2024
1 parent 2e39b78 commit 3dc8c7c
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 43 deletions.
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
# Rust Mandelbrot Set Explorer
# Mandelbrot.site

[Rust Mandelbrot Set Explorer](https://rust-mandelbrot.netlify.app) is a web app that lets you explore the Mandelbrot set fractal. Built with Rust, compiled to WebAssembly, running on Web Workers.
_Formerly known as Rust Mandelbrot Set Explorer_

[![img](https://raw.githubusercontent.com/rosslh/rust-mandelbrot-set/master/readme-images/site-image.png)](https://rust-mandelbrot.netlify.app)
[Mandelbrot.site](https://mandelbrot.site) is a web app that lets you explore the Mandelbrot set fractal. Built with Rust (compiled to WASM) and TypeScript.

[![img](https://raw.githubusercontent.com/rosslh/rust-mandelbrot-set/master/readme-images/example-output.png)](https://rust-mandelbrot.netlify.app)
## Project Structure

## Code directory
- **Mandelbrot Set Implementation**: [`mandelbrot/src/lib.rs`](mandelbrot/src/lib.rs)
- **Rust Unit Tests**: [`mandelbrot/src/lib_test.rs`](mandelbrot/src/lib_test.rs)
- **TypeScript Entry Point**: [`client/app/main.ts`](client/app/main.ts)

- [Mandelbrot set code - <code>mandelbrot/src/lib.rs</code>](mandelbrot/src/lib.rs)
- [Rust tests - <code>mandelbrot/src/lib_test.rs</code>](mandelbrot/src/lib_test.rs)
- [Web Worker - <code>client/app/worker.js</code>](client/app/worker.js)
- [Leaflet tile generation - <code>client/app/main.ts</code>](client/app/main.ts)
## Key Features

## Features
- **Dynamic Zoom**: Use your mouse to scroll or select a region, diving deeper into the fractal.
- **Iteration Adjustment**: Control the detail level with iteration count.
- **Multibrot Sets**: Explore "multibrot" sets by changing the exponent.
- **High-Resolution Rendering**: Enjoy crystal clear fractal images.
- **Customizable Color Schemes**: Personalize your fractal exploration.
- **Viewport Coordinates**: View and update the viewport's coordinates.
- **Image Export**: Save your discoveries as PNG images.
- **Shareable Views**: Generate URLs to share your current view with others.

- Set max iterations to adjust speed vs render quality
- "Multibrot" sets can be rendered by increasing the exponent parameter
- Adjust the size of map tiles
- Enter fullscreen mode
- Save the visible portion of the fractal as an image
## Gallery

## Local development
View some of the stunning images generated with Mandelbrot.site:

- Build scripts are available in [<code>client/package.json</code>](client/package.json). You can use the following commands from within `client/`:
- `npm install` -- Install npm dependencies
- `npm run start` -- Serve the project locally for development at `http://localhost:9090`
- `npm run build` -- Build the project for production
- `npm run test` -- Run Rust tests
- `npm run lint` -- Find problems with code
- `npm run clean` -- Clear installation caches and remove build artifacts
[![Mandelbrot Set Image](https://raw.githubusercontent.com/rosslh/rust-mandelbrot-set/master/example-images/mandelbrot-4.png)](https://mandelbrot.site)

[![Mandelbrot Set Image](https://raw.githubusercontent.com/rosslh/rust-mandelbrot-set/master/example-images/mandelbrot-2.png)](https://mandelbrot.site)

[Explore more images](/example-images)

## Getting Started Locally

To set up and run the project on your local environment, navigate to the `client/` directory and use the following commands:

- **Install Dependencies**: `npm install`
- **Start Development Server**: `npm run start` - serves the project at `http://localhost:9090`
- **Build for Production**: `npm run build`
- **Run Rust Tests**: `npm run test`
- **Lint**: `npm run lint` - identifies potential code issues
- **Cleanup**: `npm run clean` - removes caches and build artifacts
12 changes: 3 additions & 9 deletions client/app/MandelbrotLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,9 @@ class MandelbrotLayer extends L.GridLayer {

const mapZoom = this._map.getZoom();

const seenTasks = new Set<string>();
const relevantTasks = tilesToGenerate.filter((task) => {
const positionString = JSON.stringify(task.position);
if (task.position.z === mapZoom && !seenTasks.has(positionString)) {
seenTasks.add(positionString);
return true;
}
return false;
});
const relevantTasks = tilesToGenerate.filter(
(task) => task.position.z === mapZoom
);

relevantTasks.forEach((task) => {
this.generateTile(task.canvas, task.position, task.done);
Expand Down
17 changes: 9 additions & 8 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,44 @@
<title>Mandelbrot Set Explorer</title>
<meta
name="description"
content="An interactive application that lets you explore the Mandelbrot set fractal. Built with Rust, compiled to WebAssembly, running on Web Workers. "
content="A web app that lets you explore the Mandelbrot set fractal. Built with Rust (compiled to WASM) and TypeScript."
/>
<link rel="canonical" href="https://mandelbrot.site" />

<!-- Google / Search Engine Tags -->
<meta itemprop="name" content="Mandelbrot Set Explorer" />
<meta
itemprop="description"
content="An interactive application that lets you explore the Mandelbrot set fractal. Built with Rust, compiled to WebAssembly, running on Web Workers. "
content="A web app that lets you explore the Mandelbrot set fractal. Built with Rust (compiled to WASM) and TypeScript."
/>
<meta
itemprop="image"
content="https://rust-mandelbrot.netlify.app/static/site-image.png"
content="https://mandelbrot.site/static/site-image.png"
/>

<!-- Facebook Meta Tags -->
<meta property="og:url" content="https://rust-mandelbrot.netlify.app" />
<meta property="og:url" content="https://mandelbrot.site" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Mandelbrot Set Explorer" />
<meta
property="og:description"
content="An interactive application that lets you explore the Mandelbrot set fractal. Built with Rust, compiled to WebAssembly, running on Web Workers. "
content="A web app that lets you explore the Mandelbrot set fractal. Built with Rust (compiled to WASM) and TypeScript."
/>
<meta
property="og:image"
content="https://rust-mandelbrot.netlify.app/static/site-image.png"
content="https://mandelbrot.site/static/site-image.png"
/>

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Mandelbrot Set Explorer" />
<meta
name="twitter:description"
content="An interactive application that lets you explore the Mandelbrot set fractal. Built with Rust, compiled to WebAssembly, running on Web Workers. "
content="A web app that lets you explore the Mandelbrot set fractal. Built with Rust (compiled to WASM) and TypeScript."
/>
<meta
name="twitter:image"
content="https://rust-mandelbrot.netlify.app/static/site-image.png"
content="https://mandelbrot.site/static/site-image.png"
/>

<link
Expand Down
6 changes: 3 additions & 3 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified client/static/site-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-images/mandelbrot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-images/mandelbrot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-images/mandelbrot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-images/mandelbrot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-images/mandelbrot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-images/example-output.png
Binary file not shown.
Binary file removed readme-images/site-image.png
Binary file not shown.

0 comments on commit 3dc8c7c

Please sign in to comment.