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;
}
Index
Properties
Methods
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 <length> in user units.
valueAsString
The valueAsString property of the SVGLength interface represents the <length>'s value as a string, in the units expressed by SVGLength.unitType.
valueInSpecifiedUnits
The valueInSpecifiedUnits property of the SVGLength interface represents floating point value, in the units expressed by SVGLength.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 SVGLength.unitType, thereby replacing the values for all of the attributes on the object.Parameters
- unitType: number
- valueInSpecifiedUnits: number
Returns void
The
SVGLengthinterface correspond to the <length> basic data type.MDN Reference