Task System Option
Sets the number of seconds for a frame to fade
into view.
SVGFADEIN
Specifies whether a frame in the animation
overlaps the previous frame or if each frame is
played sequentially when a frame is specified to
fade in and out.
SVGFADEMODE
Sets the number of seconds for a frame to fade out
of view.
SVGFADEOUT
For more information, see SAS System Options: Reference.
Setting the SVG Universal Printer
You set the SVG Universal Printer by setting the PRINTERPATH= system option to one
of the SVG Universal Printers. You can set the PRINTERPATH= system option at any
time. The following OPTIONS statement sets the Universal Printer to create compressed
SVG documents:
options printerpath=svgz;
For more information, see the following topics:
“The SVG Universal Printers and the Output That They Create” on page 315
“PRINTERPATH= System Option” in SAS System Options: Reference
“Fundamentals of Creating SVG Documents Using Universal Printers” on page 316
Scaling an SVG Document to the Viewport
To scale an SVG document to the viewport, you can use the default value of null for the
SVGHEIGHT= and SVGWIDTH= system options. A null value equates to the value of
100%, which scales the SVG document to the size of the viewport. In addition, the value
of the SVGVIEWBOX= system option must be null.
For more information, see the following system options in SAS System Options:
Reference:
SVGHEIGHT= System Option
SVGWIDTH= System Option
SVGVIEWBOX= System Option
Setting the ViewBox
The viewBox attribute on the <svg> element is a set of four numbers: the starting X
coordinate, the starting Y coordinate, the height of the SVG document, and the width of
the SVG document. SAS sets the viewBox attribute value from the value of the
SVGVIEWBOX= system option. If that option has no value, SAS uses the value of the
PAPERSIZE= system option to set the height and the width arguments of the viewBox
attribute. The starting coordinate values are set to 0.
When the SVGVIEWBOX=, SVGHEIGHT=, and SVGWIDTH= system options have a
null value (the default value for each of these system options), the SVG document scales
to the size of the viewport. If you specify a value for the SVGVIEWBOX= system
324 Chapter 15 Printing with SAS
option, the SVG document is scaled to the dimensions specified in the SVGVIEWBOX=
option.
If you specify the SVGHEIGHT= option and the SVGWIDTH= option using percentage
units, the SVG document scales to the size of the browser window whenever the browser
window changes size. If these options are specified using units other than percentage,
such as in, cm, or px, the SVG document is a static size and does not scale to the
browser window when the window changes size.
For more information, see the following topics:
“ODS PRINTER Statement ” in SAS Output Delivery System: Users Guide
“SVGVIEWBOX= System Option” in SAS System Options: Reference
“PAPERSIZE= System Option” in SAS System Options: Reference
“Creating a Static viewBox” on page 326
Interaction between SAS SVG System Options and the SVG Element
Attributes
SAS uses the values of the SVGHEIGHT=, SVGWIDTH=, SVGVIEWBOX=,
SVGPRESERVEASPECTRATIO=, SVGX=, and SVGY= system options as values for
their respective attributes on the outermost <svg> element: height, width, viewBox, and
preserveAspectRatio. For example, if you specify SVGWIDTH=“400” and
SVGHEIGHT=“300”, SAS creates the <svg> element with the attributes width=“400”
and height=“300”. The values of the SVGX= and SVGY= system options are used only
on embedded <svg> elements for the x and y attributes.
All of these system options have a null default value. When the SVGVIEWBOX=
system option is null, SAS determines the viewBox size based on the value of the
PAPERSIZE= system option. Therefore, if you do not specify a value for any of these
system options, the only <svg> attribute that SAS sets is the viewBox attribute using the
SAS SVG system options. Other <svg> attributes, such as version and xmlns are set by
SAS and not by using system options.
SAS creates the following <svg> element when all of the SAS SVG system options are
set to their default values:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" baseProfile="full" version="1.1"
id="SVGMain" onload='SVGMain_Init("SVGMain")'
viewBox="-1 -1 801 601">
The SVGPRESERVEASPECTRATIO= system option is used to set the
preserveAspectRatio attribute in the <svg> element and has an effect only when the
viewBox attribute has also been specified in an SVG document.
Negative values can be specified for the values of SVG options. However, if a negative
value is specified for the SVGHEIGHT= option or the SVGWIDTH= option, or the
height or width arguments in the SVGVIEWBOX= option, the SVG document is not
rendered by the browser. It can be useful to specify negative values for the x and y
arguments of the SVGVIEWBOX= option to place the origin of the SVG document. A
negative argument in the SVGVIEWBOX= option shifts the output to the right. A
negative value of the SVGVIEWBOX= option shifts the placement of the document
downward.
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing 325
Creating a Static viewBox
A static viewBox is a viewBox that cannot be changed. When the viewport changes,
such as when you resize your browser window, the viewBox remains the same size. To
create a static viewBox, you specify the same width and height values for the
PAPERSIZE=, SVGWIDTH=, and SVGHEIGHT= system options. The PAPERSIZE=
system option sets the viewBox. The SVGWIDTH= and SVGHEIGHT= system options
set the size of the SVG document. IF the SVGHEIGHT= and SVGWIDTH= options are
specified using percentage unit, the SVG document scales to the size of the browser
window when the browser window changes size. Figure 15.35 on page 326 shows a
static viewBox created by using the following system options:
options nodate printerpath=svg papersize=("8cm" "5cm") svgwidth="8cm" svgheight="5cm"
svgtitle="Sashelp.Class Plotted by The SGPLOT Procedure";
Figure 15.35 A Static Viewbox
To reset the SVGWIDTH=, SVGHEIGHT=, and SVGPRESERVEASPECTRATIO=
system options to null, specify two single quotation marks or two double quotation
marks with no space between them:
options printerpath=svg svgwidth="" svgheight="" svgpreserveaspectratio="";
Preserving the Aspect Ratio
When you change the size of the viewBox, you can use the
SVGPRESERVEASPECTRATIO= system option to specify whether you want to
preserve the aspect ratio of the SVG document and how to place the SVG document in
the viewport. Set this option by using one of the following assignments:
SVGPRESERVEASPECTRATIO=align | meetOrSlice | NONE | “”
SVGPRESERVEASPECTRATIO=“align meetOrSlice
The first argument, align, specifies whether to force uniform scaling by specifying the
alignment method to use. For example, you can use the xMidYMid value to align the
326 Chapter 15 Printing with SAS
midpoint X value of the viewBox to the midpoint X value of the viewport, which centers
the document horizontally.
The second argument, meetOrSlice, specifies how to scale the SVG document to the
viewBox. The value for this argument can be either meet or slice. If you specify
meet, the SVG document is scaled up as much as possible while meeting other criteria.
The viewport displays some unused space. If you specify slice, the SVG document is
scaled down as much as possible while meeting other criteria. In the latter case, some of
the SVG document appears to be cut off. The SVG document is still complete, but you
cannot see all of it in the viewport. You can use your browser controls to move the SVG
document around in the viewport.
For more information, see “SVGPRESERVEASPECTRATIO= System Option” in SAS
System Options: Reference.
Including the Magnify Tool in SVG Documents
You can include a magnify tool in SVG documents by setting the
SVGMAGNIFYBUTTON system option. When the tool is enabled, a magnifying glass
is available to enlarge a portion of an SVG document. The size of the magnification area
cannot be changed.
By default, the magnify tool is not included in the SVG document. You must explicitly
set the SVGMAGNIFYBUTTON system option. You can use this OPTIONS statement:
options svgmagnifybutton;
To disable the magnify tool, use the NOSVGMAGNIFYBUTTON system option.
When the magnify tool is enabled, the Magnify button, ,
appears at the top of the SVG document. To make the magnifying glass appear, click
Magnify. Using the mouse, move the magnifying glass over the SVG document to
enlarge the area under the glass. To turn the magnifying glass off, click Magnify again.
By default, the magnifying glass enlarges the area using a magnification level of three.
Click on + to increase the magnification level and to decrease the magnification level.
When the SVG document is viewed on an iPad, the first tap of the Magnify button
displays the tooltip. The second and subsequent taps change the magnification and closes
the magnifying glass.
There are some restrictions for using the magnify tool:
The magnify tool is not supported for the SVGT printer and animated SVG
documents.
When you use the SVGnotip printer, no tooltip is displayed to tell you to enable or
disable the magnifying glass.
When the magnify tool is enabled, the magnify tool is turned off on the Index page
of a multi-page document.
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing 327
The magnify tool is more useful when the SVG document is viewed in browsers that
expect an SVG document to control the zoom level.
For more information, see “SVGMAGNIFYBUTTON System Option” in SAS System
Options: Reference.
Adding a Title to an SVG Document
You use the SVGTITLE= system option to add a title to the title bar of a window when
the browser displays only the SVG document. If the SVG document is embedded in an
HTML page, the svgtitle attribute on the <svg> tag has no effect. The static viewport
example in the previous topic shows a title in the browser title bar.
For more information, see “SVGTITLE= System Option” in SAS System Options:
Reference.
Creating Stand-alone SVG Documents Using the ODS PRINTER
Destination
Creating an SVG Document
To create an SVG document, you need to at least set the PRINTERPATH= system option
to an SVG Universal printer and specify the ODS PRINTER statement in your SAS
program. Or, specify the PRINTER= option in the ODS PRINTER statement:
options printerpath=svg;
ods html close;
ods printer;
proc sgplot data=sashelp.class;
reg x=height y=weight / CLM CLI;
run;
ods printer close;
ods html;
In this example, no specific SVG system option values were set to size the SVG
document. Therefore, the viewBox is the default size specified by the PAPERSIZE=
system option. The SVG document scales to the viewport because no value was
specified for the SVGWIDTH= and SVGHEIGHT= system options. The following is the
<svg> element that SAS creates:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" baseProfile="full" version="1.1"
id="SVGMain" onload='SVGMain_Init("SVGMain")'
viewBox="-1 -1 801 601">
SAS creates a single SVG document named sasprt.svg and stores it in a specific location,
depending on your operating environment. Under Windows, the file is stored in the
current directory. Under UNIX, the file is stored in your home directory. Under z/OS, the
file is stored as a z/OS UNIX System Services Hierarchal File System (HFS) file, or as a
z/OS data set. If the SVG file is written to a z/OS data set, it is written to PDSE library
userid.SASPRT.SVG. You can use the FILE= option in the ODS PRINTER statement to
specify a different filename.
The following figure is an SVG file that uses the Adobe Acrobat SVG plug-in for
Microsoft Internet Explorer. This file was created by using the SGPLOT procedure to
plot the Sashelp.Class data set.
328 Chapter 15 Printing with SAS
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.191.86