Fractals in JavaScript and HTML5 Canvas

Koch Snowflake (animated)

This is one of the earliest described fractals, and it's based on an equilateral triangle. After a few iterations, the triangle turns into a beautiful, self-similar flake. See the animated version here

Circles (animated)

A simple fractal based on dots in a square pattern. See the animated version here

Spiral 1

A variation of a spiral fractal. See it rendered here

Spiral 2

A variation of a spiral fractal. See it rendered here

Spiral 3

A variation of a spiral fractal. See it rendered here

Tree

A simple tree fractal. See it rendered here

Develop your own!


If you are interested, you can download a package containing all fractals here. Each is based on two JavaScript files: fractal.js which is a library in charge of calling a delegate, as well as rendering progressively, so that the generation is animated. The second JavaScript file is particular to each fractal, and defines a delegate generator function, along with the initialization of the fractal library.