SVGPRESERVEASPECTRATIO= System Option

Specifies whether to force uniform scaling of SVG output; specifies the preserveAspectRatio attribute on the outermost <svg> element.
Valid in: Configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Category: Log and procedure output control: SVG
PROC OPTIONS GROUP= SVG
Restriction: The SVGPRESERVEASPECTRATIO= option sets the preserveAspectRatio attribute only on the outermost <svg> element.
Note: This option can be restricted by a site administrator. For more information, see Restricted Options.

Syntax

SVGPRESERVEASPECTRATIO=align | meetOrSlice | NONE | ""
SVGPRESERVEASPECTRATIO="align meetOrSlice"

Syntax Description

align
specifies to force uniform scaling by specifying the alignment method to use. The value for align can be one of the following:
xMinYMin
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x> of the element's viewBox with the smallest X value of the viewport.
  • Align the <min–y> of the element's viewBox with the smallest Y value of the viewport.
xMidYMin
specifies to force uniform scaling by using the following alignment:
  • Align the midpoint X value of the element's viewBox with the midpoint X value of the viewport.
  • Align the <min–y> of the element's viewBox with the smallest Y value of the viewport.
xMaxYMin
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x>+<width> of the element's viewBox with the maximum X value of the viewport.
  • Align the <min–y> of the element's viewBox with the smallest Y value of the viewport.
xMinYMid
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x> of the element's viewBox with the smallest X value of the viewport.
  • Align the midpoint Y value of the element's viewBox with the midpoint Y value of the viewport.
xMidYMid
specifies to force uniform scaling by using the following alignment:
  • Align the midpoint X value of the element's viewBox with the midpoint X value of the viewport.
  • Align the midpoint Y value of the element's viewBox with the midpoint Y value of the viewport. This is the default.
xMaxYMid
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x>+<width> of the element's viewBox with the maximum X value of the viewport.
  • Align the midpoint Y value of the element's viewBox with the midpoint Y value of the viewport.
xMinYMax
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x> of the element's viewBox with the smallest X value of the viewport.
  • Align the <min–y>+<height> of the element's viewBox with the maximum Y value of the viewport.
xMidYMax
specifies to force uniform scaling by using the following alignment:
  • Align the midpoint X value of the element's viewBox with the midpoint X value of the viewport.
  • Align the <min–y>+<height> of the element's viewBox with the maximum Y value of the viewport.
xMaxYMax
specifies to force uniform scaling by using the following alignment:
  • Align the <min–x>+<width> of the element's viewBox with the maximum X value of the viewport.
  • Align the <min–y>+<height> of the element's viewBox with the maximum Y value of the viewport.
meetOrSlice
specifies to preserve the aspect ratio and how the viewBox displays. The following values are valid for meetOrSlice:
meet
specifies to scale the SVG graphic as follows:
  • preserve the aspect ratio
  • make the entire viewBox visible within the viewport
  • scale up the viewBox as much as possible while meeting other criteria
If the aspect ratio of the graphic does not match the viewport, some of the viewport will extend beyond the bounds of the viewBox.
slice
specifies to scale the SVG graphic as follows:
  • preserve the aspect ratio
  • cover the entire viewBox with the viewport
  • scale down the viewBox as much as possible while meeting other criteria
If the aspect ratio of the viewBox does not match the viewport, some of the viewBox will extend the bounds of the viewport.
NONE
specifies not to force uniform scaling and to scale the SVG output nonuniformly so that the element's bounding box exactly matches the viewport rectangle.
""
specifies to reset the preserveAspectRatio attribute of the <svg> element to the default value of xMidYMid meet.
Requirement:Use two double quotation marks with no space between them.

Details

When the value of the SVGPRESERVEASPECTRATIO= option includes both align and meetOrSlice, you can delimit the value by using single or double quotation marks or parentheses.
The preserveAspectRatio attribute applies only when a value is provided for the viewBox on the same <svg> element. If the viewBox attribute is not provided, the preserveAspectRatio attribute is ignored.

Example

The following OPTIONS statements are examples of using the SVGPRESERVEASPECTRATIO= system option:
options preserveaspectratio=xMinYMax;
options preserveaspectratio="xMinYMin meet";
options preserveaspectratio=(xMinYMin meet);
options preserveaspectratio="";