new rgplygn(options){rgplygn}
Initializes a new rgplygn instance.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Options used to customize the rgplygn
|
Returns:
Type | Description |
---|---|
rgplygn | A new rgplygn instance. |
Requires
Members
-
dasharray*
-
The stroke-dasharray of the polygon
-
dashoffset*
-
The stroke-dashoffset of the polygon
-
readonlyelSVGElement
-
The polygon element associated with this instance
-
fillString
-
The rgplygn's fill color
-
readonlyidString
-
The id of this instance's polygon element
-
readonlyparentSVGElement
-
The parent of the polygon element
-
rNumber
-
The radius of the polygon
-
sidesint
-
The number of sides on the polygon
-
sliceString
-
Control how much of the polygon's stroke is drawn. Space-delimited values define a slice, ie '10 30'. A single value asserts 0 as the starting value. Accepts percentages for relative values
-
strokeString
-
The rgplygn's stroke color
-
strokeWidthNumber
-
The rgplygn's stroke width
-
xNumber
-
The origin of the polygon along the x-axis
-
yNumber
-
The origin of the polygon along the y-axis
Methods
-
staticrgplygn.getElInstance(el){rgplygn}
-
returns the rgplygn instance associated with the provided element's id attribute
Name Type Description el
Element The element with the lookup id Returns:
Type Description rgplygn The associate rgplygn, if it exists -
staticrgplygn.getInstance(id){rgplygn}
-
returns the rgplygn instance associated with the id
Name Type Description id
String The lookup id Returns:
Type Description rgplygn The associate rgplygn, if it exists -
getPoint(index){Array}
-
Returns the point at the specified index
Name Type Default Description index
int -1 optional The index of the desired point. When negative, becomes the sum of itself and the length of the points array Returns:
Type Description Array The point at the specified index -
update()
-
Updates the points attribute of the polygon element.