Skip to content

guess-burger/mandelbrot-cljs

Repository files navigation

Mandelbrot

A naive Mandlebrot set demonstration inspired by Peter Westmacott's excellent talk at re:Clojure.

This version is written in Clojurescript with a simple click to zoom in function allowing you to explore areas like the Seahorse Valley.

Seahorse_Valley

You can try it on my GitHub Page.

Running locally + Getting a REPL

When starting shadow-cljs with shadow-cljs watch app make note of the nREPL port logged out. Connect to http://localhost:8020/mandelbrot-cljs/ to view the mandelbrot. Create a remote REPL that connects to that specific port. Once your REPL is running use the command (shadow/repl :app) to connect to the shadow-cljs REPL

Cursive

As Cursive is my editor of choice, there are a number of hoops to jump through

You can make intellij copy the .shadow-cljs/nrepl.port file to .nrepl-port as a "Before Launch" action to make Cursive auto-connect to nRepl. This works by making it think it's a lein project see thheller/shadow-cljs#524

Colour choice

I've implemented two options for rendering the values outside the Mandelbrot set based on their iteration counts.

Golden-Ratio Random

Use this for a clear view of the different bands/iteration counts. This scheme is based on the concept of using the Golden Ratio to choose random colours that are easy to distinguish.

Golden_Ratio_Random_scheme

Gradient

Use this colour scheme for aesthetics, it's much nicer to look at!

Gradient_scheme

About

A naive Mandelbrot implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published