• for SVG documents only, whether to immediately start the animation when the
document is loaded in the web page
• for SVG documents only, whether a frame fades in and out of view and if during the
fade-in and fade-out time, the frames are overlaid or played sequentially
SAS/GRAPH is required to create animated files for the ODS HTML5, ODS HTML,
and the ODS LISTING destinations. For more information, see SAS/GRAPH: Reference.
You set the options using the OPTIONS statement before opening the ODS PRINTER
destination:
options printerpath=gif animation=start animduration=5 animloop=yes noanimoverlay;
ods printer file='myfile.gif';
In this OPTIONS statement, the ANIMATION option starts creating the animation file,
the ANIMDURATION option specifies that each frame is held for 5 seconds. The
ANIMLOOP option specifies to continuously repeat the animation loop. The
NOANIMOVERLAY option specifies that each frame is played sequentially.
When the PRINTERPATH= option is set to SVG, you can use the SVG animation
options to configure the fade-in and fade-out attributes and the autoplay attribute. The
animation options that begin with SVG do not affect GIF images.
After you set the options and opened the PRINTER destination, proceed with your SAS
code to create each frame in your file. The animation frame is created when you run SAS
procedures. You can use animation options in between procedures to change the duration
that a frame is held in view and the fade-in and fade-out times. For example, you can
hold a particular frame in view for a longer period of time. You would use the OPTIONS
ANIMDURATION= statement before a procedure to increase the time that the frame is
held in view. Specify ANIMATION=STOP to end the creation of the animation file. Use
the ODS PRINTER CLOSE statement to close the file.
T I P Be sure to specify ANIMATION=STOP after you create the frames for your
animation file. If ANIMATION=START remains set, you might create an animation
file unintentionally for subsequent procedure statements.
To embed the file in a web page or to create a link to the file from a web page, see “SVG
Documents in HTML Files” on page 336.
When an animated file is displayed in a browser, the animation control buttons can be
used to reset ( ) the animation, to pause ( ) the animation, and to play ( ) the
animation. You can toggle SVG Controls to show or hide the control buttons. Here is
one frame of an animated SVG document with the control buttons:
344 Chapter 15 • Printing with SAS