web api interface
SVGAngle
The SVGAngle interface is used to represent a value that can be an <angle> or <number> value.
The SVGAngle returned from animVal and baseVal is read only, but the SVGAngle returned from createSVGAngle() is writable. When designated as read only, attempts to modify the object will result in an exception being thrown.
An SVGAngle object can be associated with a particular element. The associated element is used to determine which element’s content attribute to update if the object reflects an attribute. Unless otherwise described, an SVGAngle object is not associated with any element.
Every SVGAngle object operates in one of two modes:
- Reflect the base value of a reflected animatable attribute (being exposed through the
baseValmember of anSVGAnimatedAngle), - Be detached, which is the case for
SVGAngleobjects created withcreateSVGAngle().
Instance properties
unitType- : The type of the value as specified by one of the
SVG_ANGLETYPE_*constants defined on this interface.
- : The type of the value as specified by one of the
value- : The value as a floating point value, in user units. Setting this attribute will cause
valueInSpecifiedUnitsandvalueAsStringto be updated automatically to reflect this setting.
- : The value as a floating point value, in user units. Setting this attribute will cause
valueInSpecifiedUnits- : The value as a floating point value, in the units expressed by
unitType. Setting this attribute will causevalueandvalueAsStringto be updated automatically to reflect this setting.
- : The value as a floating point value, in the units expressed by
valueAsString- : The value as a string value, in the units expressed by
unitType. Setting this attribute will causevalue,valueInSpecifiedUnits, andunitTypeto be updated automatically to reflect this setting.
- : The value as a string value, in the units expressed by
Instance methods
convertToSpecifiedUnits()- : Preserve the same underlying stored value, but reset the stored unit identifier to the given
unitType. Object attributesunitType,valueInSpecifiedUnits, andvalueAsStringmight be modified as a result of this method.
- : Preserve the same underlying stored value, but reset the stored unit identifier to the given
newValueSpecifiedUnits()- : Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
Static properties
SVG_ANGLETYPE_UNKNOWN(0)- : Some unknown type of value.
SVG_ANGLETYPE_UNSPECIFIED(1)- : A unitless
<number>interpreted as a value in degrees.
- : A unitless
SVG_ANGLETYPE_DEG(2)- : An
<angle>with adegunit.
- : An
SVG_ANGLETYPE_RAD(3)- : An
<angle>with aradunit.
- : An
SVG_ANGLETYPE_GRAD(4)- : An
<angle>with agradunit.
- : An
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.