The SVGAngle
interface is used to represent a value that can be an <angle>
or <number>
value. An SVGAngle
reflected through the animVal
attribute is always read only.
An SVGAngle
object can be designated as read only, which means that 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. It can:
baseVal
member of an SVGAnimatedAngle
),SVGAngle
objects created with SVGSVGElement.createSVGAngle()
.<number>
interpreted as a value in degrees.<angle>
with a deg
unit.<angle>
with a rad
unit.<angle>
with a grad
unit.SVG_ANGLETYPE_*
constants defined on this interface.The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits
and valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting: a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.
The value as a floating point value, in the units expressed by unitType
. Setting this attribute will cause value
and valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting: a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.
The value as a DOMString
value, in the units expressed by unitType
. Setting this attribute will cause value
, valueInSpecifiedUnits
and unitType
to be updated automatically to reflect this setting.
Exceptions on setting:
aDOMException
with code SYNTAX_ERR
is raised if the assigned string cannot be parsed as a valid <angle>
. a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
Exceptions:
aDOMException
with code NOT_SUPPORTED_ERR
is raised if unitType
is SVG_ANGLETYPE_UNKNOWN
or not a valid unit type constant (one of the other SVG_ANGLETYPE_*
constants defined on this interface). a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.unitType
. Object attributes unitType
, valueInSpecifiedUnits
and valueAsString
might be modified as a result of this method.Specification | Status | Comment |
---|---|---|
Scalable Vector Graphics (SVG) 2 The definition of 'SVGElement' in that specification. | Candidate Recommendation | Adds the dataset property. |
Scalable Vector Graphics (SVG) 1.1 (Second Edition) The definition of 'SVGElement' in that specification. | Recommendation | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? | Yes | ? | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | ? | Yes | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGAngle