Wraps an SVGElement as a Visual.
Inheritance Hierarchy
Members
No filters for this type
Constructors
Creates a new instance which wraps the specified SVG element.
Creates a new instance which wraps the specified SVG element.
Properties
Gets or sets the SVG element of this visual.
Gets or sets the SVG element of this visual.
final
See Also
Developer's Guide
Static Methods
Creates a new TypedSvgVisual<TElement> for the given element.
Creates a new TypedSvgVisual<TElement> for the given
element.The purpose of this factory method is to get an instance of SvgVisual but with a better matching type for the svgElement property.
Note that this method still returns an instance of the SvgVisual class, since TypedSvgVisual<TElement> is just a typeScript type. The main benefit is the added type-safety.
static
Parameters
- element: TElement
- The element to wrap.
Return Value
- TypedSvgVisual<TElement>
- A properly typed SvgVisual for the given element.
See Also
Developer's Guide
API
- from
The purpose of this factory method is to get an instance of SvgVisual but with a better matching type of the svgElement property and the ability to store an user-provided object as tag with type-safety.
Note that this method still returns an instance of the SvgVisual class, since TaggedSvgVisual<TElement, TTag> is just a typeScript type. The main benefit is the added type-safety.
static
Parameters
- element: TElement
- The element to wrap.
- tag: TTag
Return Value
- TaggedSvgVisual<TElement, TTag>
- A properly typed SvgVisual for the given element and tag value.
See Also
Developer's Guide
API
- from
This implementation uses caching and the baseVal property of the
transform attribute if possible and thus performs better than using the plain DOM API.static
Parameters
- transformable: Element
- The SVG element that should be translated.
- scaleX: number
- The vertical scale.
- scaleY: number
- The horizontal scale.
This implementation uses caching and the baseVal property of the
transform attribute if possible and thus performs better than using the plain DOM API.static
Parameters
- transformable: Element
- The SVG element that should be translated.
- dx: number
- The offset on the x-axis.
- dy: number
- The offset on the y-axis.