Wraps an SVGElement as a Visual.
See Also
Developer's Guide
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.
Parameters
- element: SVGElement
- The SVG element which this visual wraps.
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
Type Parameters
TElement
- The type of the element, which will typically be inferred from the argument.
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 TaggedSvgVisual.tag<TElement, TTag> 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
Type Parameters
TElement
- The type of the element, typically inferred from the first argument.
TTag
- The type of the cache value, typically inferred from the second argument.
Parameters
- element: TElement
- The element to wrap.
- tag: TTag
- The object to set to the SvgVisual as TaggedSvgVisual.tag<TElement, 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.