web api interface
SVGTransform
The SVGTransform interface reflects one of the component transformations within an SVGTransformList; thus, an SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute.
An SVGTransform object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Instance properties
type- : The type of the value as specified by one of the
SVG_TRANSFORM_*constants defined on this interface.
- : The type of the value as specified by one of the
angle- : The angle as a floating point value. A convenience attribute for
SVG_TRANSFORM_ROTATE,SVG_TRANSFORM_SKEWXandSVG_TRANSFORM_SKEWY. ForSVG_TRANSFORM_MATRIX,SVG_TRANSFORM_TRANSLATEandSVG_TRANSFORM_SCALE,anglewill be zero.
- : The angle as a floating point value. A convenience attribute for
matrix- : The matrix as a
DOMMatrixthat represents this transformation. The matrix object is live, meaning that any changes made to theSVGTransformobject are immediately reflected in the matrix object and vice versa. In case the matrix object is changed directly (i.e., without using the methods on theSVGTransforminterface itself) then the type of theSVGTransformchanges toSVG_TRANSFORM_MATRIX.
- : The matrix as a
Instance methods
setMatrix()- : Sets the transform type to
SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation. Note that the values from the parametermatrixare copied.
- : Sets the transform type to
setTranslate()- : Sets the transform type to
SVG_TRANSFORM_TRANSLATE, with parameterstxandtydefining the translation amounts.
- : Sets the transform type to
setScale()- : Sets the transform type to
SVG_TRANSFORM_SCALE, with parameterssxandsydefining the scale amounts.
- : Sets the transform type to
setRotate()- : Sets the transform type to
SVG_TRANSFORM_ROTATE, with parameterangledefining the rotation angle and parameterscxandcydefining the optional center of rotation.
- : Sets the transform type to
setSkewX()- : Sets the transform type to
SVG_TRANSFORM_SKEWX, with parameterangledefining the amount of skew.
- : Sets the transform type to
setSkewY()- : Sets the transform type to
SVG_TRANSFORM_SKEWY, with parameterangledefining the amount of skew.
- : Sets the transform type to
Static properties
SVG_TRANSFORM_UNKNOWN(0)- : The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVG_TRANSFORM_MATRIX(1)- : A
matrix(…)transformation.
- : A
SVG_TRANSFORM_TRANSLATE(2)- : A
translate(…)transformation.
- : A
SVG_TRANSFORM_SCALE(3)- : A
scale(…)transformation.
- : A
SVG_TRANSFORM_ROTATE(4)- : A
rotate(…)transformation.
- : A
SVG_TRANSFORM_SKEWX(5)- : A
skewx(…)transformation.
- : A
SVG_TRANSFORM_SKEWY(6)- : A
skewy(…)transformation.
- : A
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.