For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface SVGLength
SVG_LENGTHTYPE_CM: 6;
SVG_LENGTHTYPE_EMS: 3;
SVG_LENGTHTYPE_EXS: 4;
SVG_LENGTHTYPE_IN: 8;
SVG_LENGTHTYPE_MM: 7;
SVG_LENGTHTYPE_NUMBER: 1;
SVG_LENGTHTYPE_PC: 10;
SVG_LENGTHTYPE_PERCENTAGE: 2;
SVG_LENGTHTYPE_PT: 9;
SVG_LENGTHTYPE_PX: 5;
SVG_LENGTHTYPE_UNKNOWN: 0;
unitType: number;
value: number;
valueAsString: string;
valueInSpecifiedUnits: number;
convertToSpecifiedUnits(unitType: number): void;
newValueSpecifiedUnits(
unitType: number,
valueInSpecifiedUnits: number,
): void;
}
Properties
ReadonlySVG_LENGTHTYPE_CM
ReadonlySVG_LENGTHTYPE_EMS
ReadonlySVG_LENGTHTYPE_EXS
ReadonlySVG_LENGTHTYPE_IN
ReadonlySVG_LENGTHTYPE_MM
ReadonlySVG_LENGTHTYPE_NUMBER
ReadonlySVG_LENGTHTYPE_PC
ReadonlySVG_LENGTHTYPE_PERCENTAGE
ReadonlySVG_LENGTHTYPE_PT
ReadonlySVG_LENGTHTYPE_PX
ReadonlySVG_LENGTHTYPE_UNKNOWN
ReadonlyunitType
The unitType property of the SVGLength interface that represents type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.
value
The value property of the SVGLength interface represents the floating point value of the
valueAsString
The valueAsString property of the SVGLength interface represents the
valueInSpecifiedUnits
The valueInSpecifiedUnits property of the SVGLength interface represents floating point value, in the units expressed by unitType.
Methods
convertToSpecifiedUnits
-
The
convertToSpecifiedUnits()method of the SVGLength interface allows you to convert the length's value to the specified unit type.Parameters
- unitType: number
Returns void
newValueSpecifiedUnits
-
The
newValueSpecifiedUnits()method of the SVGLength interface resets the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.Parameters
- unitType: number
- valueInSpecifiedUnits: number
Returns void
The basic data type.
SVGLengthinterface correspond to theMDN Reference