Flocking behaviour (aka boids) is always a great and easy way to create beautiful, generative graphics. Here are a couple good examples, written in JavaScript. Firstly is Flock by Dustin Hoffman. No, not that Dustin Hoffman. Although I’d love to see a collaboration between the two Hoffmans — Meet the Flockers perhaps?
Second is a different take on the usual “load of flying dots” experiment. It’s an interface for exploring Generative Boids (made by Tim Holman) which leave trails as they flock and swarm over a nice big canvas element. It uses the brushes provided by the Harmony drawing tool, created by JS guru Mr.doob.