Click here to see the SAS code.
Click here to see the example.
This is an animation done with "gotpions device=javameta" (rather than gifanim).
The javameta animation/slideshow has controls at the bottom of the screen
that lets the user click 'play' [>], and 'pause' [||]. Also, the user can
control the time delay between screens to speed up the animation, and they
can also zoom & pan within the animation window. And, with javameta,
when the user zooms, the text is re-rendered and becomes sharper (whereas
when you zoom on a gif, the text becomes grainier).
Here's how I did this particular animation...
First, I created a data set with election data for each state.
I arranged this data in the order I wanted the states to be drawn/added.
I set a numeric 'order' variable, so I can use that later.
To get this type of javameta slideshow to work, I must script out my
own html header & footer (rather than using ods html).
I then do a 'data null' to loop through all the obsns in my data set.
Within that loop, I do a query and subset all the data where 'order'
is less than or equal to the current obsn, and then I do a gmap of
the current subset of data. The 'metacodes' for each graph are appended
to the htm output file.
When I'm done, I script out the footer (using 'put' statements).
Back to Samples Index