FloraJS is a JavaScript framework for simulating natural systems in a web browser. In Flora, the "world" is your web browser. DOM elements inhabit the world and behave according to rules meant to simulate a natural environment.

The formulas driving a large part of Flora are adapted from Daniel Shiffman's 'The Nature of Code'. Inspiration also came from the writings of Valentino Braitenberg and Gary Flake.

I found it was easier to learn the concepts these writers cover by building my own examples using a common set of classes. Under the hood, the framework describes classes like "Agent", "Sensor", and "Walker" and allows you to easily attach behaviors like "followMouse" or "flock". By creating instances of these classes and adjusting their properties, you can create natural looking systems.

I chose to code the framework in JavaScript so I could run the simulations in both desktop and mobile web browsers. Devices equipped with accelerometers can exert a gravitational force on the system for an especially realistic simulation.

All the simulations are animated using DOM rendering. There is no HTML5 Canvas or Flash involved. All modern browsers have been tested. If you see any differences, it's likely in the CSS. If not, let me know!

Please check out the demos and share any comments.