W3C home > Mailing lists > Public > www-svg@w3.org > October 2006

Re: Population simulations using SVG animation

From: Gavin Kistner <gavin@refinery.com>
Date: Sun, 15 Oct 2006 21:38:14 -0600
Message-Id: <1BA7FE42-FD5A-4DB6-9CEB-476B4B865429@refinery.com>
Cc: www-svg@w3.org
To: phil@pricom.com.au

On Oct 13, 2006, at 9:05 AM, Philip Rhoades wrote:

> I want to be able to make the populations dynamic (changing for each
> generation) which will affect the position and diameter of each circle
> ie the sub-pops can be moving, growing & shrinking i.e. the circles  
> are
> animated.  This of course may also mean the fill colours would  
> change if
> the overlapping of the sub-pops changes.
> Could someone direct me to the most sensible way of coding this? - ie
> direct me to some code that will animate one circle to begin with  
> (size
> and position).

Check out the source SVG for: http://phrogz.net/svg/grusn.svgz
(There's also a 2.4MB un-gzipped version here: http://phrogz.net/svg/ 

See all the <animate> elements in the file. I don't have the circles  
changing size or color (only position), but the SMIL syntax is very  
similar and easy to extrapolate.

Alternatively, write out a static SVG file and write out the results  
of all your animations as data in JS embedded in the the SVG, and  
have the JS control the SVG DOM. For a simple example: http:// 

Or, you could have JS controlling the SVG load the animation data  
from a separate XML source. (Don't have a simple example showing  
that, but it, you know, just coding. :)
Received on Monday, 16 October 2006 03:38:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:09 UTC