-
staticclp.getElInstance(el){clp}
-
returns the clp instance associated with the provided element's id attribute
Name |
Type |
Description |
el |
Element
|
The element with the lookup id |
Returns:
Type |
Description |
clp
|
The associate clp, if it exists |
-
staticclp.getInstance(id){clp}
-
returns the clp instance associated with the id
Name |
Type |
Description |
id |
String
|
The lookup id |
Returns:
Type |
Description |
clp
|
The associate clp, if it exists |
-
-
Invokes mkr.add to add existing elements to the clippath
Name |
Type |
Description |
target |
*
|
A single element, array of elements, or a css selector string. |
index |
int
|
optional
Insertion index of the target. Defaults to the number of clippath children. |
Returns:
Type |
Description |
*
|
The added element, or array of elements |
-
assign(targets, options, add, index){Element}
-
Assigns this instance's clippath url to the targeted elements.
Name |
Type |
Default |
Description |
targets |
*
|
|
An array or selector string |
options |
Object
|
|
optional
A set of attributes and css properties applied to the target elements |
add |
Boolean
|
false
|
optional
Optionally add the targets to the parent. |
index |
int
|
|
optional
The insertion index, defaults to the number of children on the parent. When negative, becomes the sum of itself and the number of children |
Returns:
Type |
Description |
Element
|
The target elements |
-
construct(type, options, index){Element}
-
Invokes mkr.construct to produce a new construct and add it to the clippath
Name |
Type |
Description |
type |
String
|
The type of construct to produce. |
options |
Object
|
optional
A set of attributes and css properties used to produce the element |
index |
int
|
optional
The insertion index, defaults to the number of clippath children. When negative, becomes the sum of itself and the length of clips |
Returns:
Type |
Description |
Element
|
The new element |
-
constructTarget(type, options, index){*}
-
Invokes mkr.construct to produce a new construct, add it to the parent and set its css clippath set to this instances's url property.
Name |
Type |
Description |
type |
String
|
The type of construct to produce. |
options |
Object
|
optional
A set of attributes and css properties to assign to the construct |
index |
int
|
optional
The insertion index, defaults to the number of children on the parent. When negative, becomes the sum of itself and the number of children |
Returns:
Type |
Description |
*
|
The new construct |
-
create(type, options, index){Element}
-
Invokes mkr.create to produce a new element and add it to the clippath
Name |
Type |
Description |
type |
String
|
The type of element to produce. Checkout MDN Clippath for permitted content |
options |
Object
|
optional
A set of attributes and css properties used to produce the element |
index |
int
|
optional
The insertion index, defaults to the number of clippath children. When negative, becomes the sum of itself and the length of clips |
Returns:
Type |
Description |
Element
|
The new element |
-
createTarget(type, options, index){Element}
-
Invokes mkr.create to produce new element, add it to the root svg and set its css clippath set to this instances's url property.
Name |
Type |
Description |
type |
*
|
Type of element to produce. |
options |
Object
|
optional
A set of attributes and css properties to assign to the element |
index |
int
|
optional
The insertion index, defaults to the number of children on the parent. When negative, becomes the sum of itself and the number of children |
Returns:
Type |
Description |
Element
|
The target element |
-
-
Returns the element at the specified index in the clippath
Name |
Type |
Default |
Description |
index |
int
|
-1
|
optional
The index of the target element. When negative, becomes the sum of itself and the length of clips |
Returns:
Type |
Description |
SVGElement
|
The element at the specified index |
-
remove(index){SVGElement}
-
Removes the element at the specified index from the clippath
Name |
Type |
Default |
Description |
index |
int
|
-1
|
optional
The index of the target element. When negative, becomes the sum of itself and the length of clips |
Returns:
Type |
Description |
SVGElement
|
The element that was removed |
-
set(options, index){SVGElement}
-
Updates the element at the specified index in the clippath
Name |
Type |
Default |
Description |
options |
Object
|
|
A set of attributes and css properties to set on the element |
index |
int
|
-1
|
optional
The index of the target element. When negative, becomes the sum of itself and the length of clips |
Returns:
Type |
Description |
SVGElement
|
The updated element |
-
unassign(targets, remove){Element}
-
Removes the clippath assignment from the target elements.
Name |
Type |
Default |
Description |
targets |
*
|
|
An array or selector string |
remove |
Boolean
|
false
|
optional
Optionally remove the targets from the parent. |
Returns:
Type |
Description |
Element
|
The target elements |