Class: crcl

crcl

Shortcut for creating SVG circles.

new crcl(options){crcl}

Initializes a new crcl instance.
Name Type Description
options Object Options used to customize the crcl
Name Type Default Description
parent * optional SVGElement which to append the primary element
id String optional The id of the instance. Auto-generated when not provided
cx Number 0 optional Center of the circle along the x-axis
cy Number 0 optional Center of the circle along the y-axis
r Number 50 optional Radius of the circle
fill String 'transparent' optional The default fill color
stroke String '#000000' optional The default stroke color
strokeWidth Number 1 optional The default stroke width
attr Object optional Attributes to apply to the crcl's SVGElement element.
css Object optional CSS Properties to apply to the crcl's SVGElement element.
Returns:
Type Description
crcl A new crcl instance.

Requires

Members

cxNumber

Center of the circle along the x-axis

cyNumber

Center of the circle along the y-axis

dasharray*

The stroke-dasharray of the primary element

dashoffset*

The stroke-dashoffset of the primary element

readonlyelSVGElement

The SVGElement element associated with this instance

fillString

The crcl's fill color

readonlyidString

The id of this instance's SVGElement element

readonlyparentSVGElement

The parent of the primary element

rNumber

Radius of the circle

sliceString

Control how much of the primary element'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 crcl's stroke color

strokeWidthNumber

The crcl's stroke width

Methods

staticcrcl.getElInstance(el){crcl}

returns the crcl instance associated with the provided element's id attribute
Name Type Description
el Element The element with the lookup id
Returns:
Type Description
crcl The associated crcl, if it exists

staticcrcl.getInstance(id){crcl}

returns the crcl instance associated with the id
Name Type Description
id String The lookup id
Returns:
Type Description
crcl The associated crcl, if it exists