new SvgPath
The SvgPath widget creates a DOM element for a single SVG path.
Parameters:
Name | Type | Description |
---|---|---|
container |
Element | String | The DOM element or ID that will contain the SVG. |
pathWidth |
Number | The width of the SVG path with no transformations applied. |
pathHeight |
Number | The height of the SVG path with no transformations applied. |
path |
String | The SVG path as a string. |
Throws:
-
DeveloperError : container is required.
-
DeveloperError : Element with id "container" does not exist in the document.
-
DeveloperError : pathWidth is required.
-
DeveloperError : pathHeight is required.
-
DeveloperError : path is required.
Example
// Create a home button var svgPath = new SvgPath(container, 28, 28, 'M14,4l-10,8.75h20l-4.25-3.7188v-4.6562\ h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313\ h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z');
Members
-
container :Element
-
Gets the parent container.
-
element :Element
-
Gets the root node of the SVG.
-
path :String
-
Gets the path.
Methods
-
destroy
-
Destroys the animation widget. Should be called if permanently removing the widget from layout.
-
isDestroyed
-
Returns:
Boolean true if the object has been destroyed, false otherwise.