Class: ln

ln

Shortcut for creating SVG lines.

new ln(options){ln}

Initializes a new ln instance.
Name Type Description
options Object Options used to customize the ln
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
x1 Number 0 optional Start of the line along the x-axis
y1 Number 0 optional Start of the line along the y-axis
x2 Number 50 optional End of the line along the x-axis
y2 Number 50 optional End of the line along the y-axis
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 ln's SVGElement element.
css Object optional CSS Properties to apply to the ln's SVGElement element.
Returns:
Type Description
ln A new ln instance.

Requires

Members

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 ln's fill color

readonlyidString

The id of this instance's SVGElement element

readonlyparentSVGElement

The parent of the primary element

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 ln's stroke color

strokeWidthNumber

The ln's stroke width

x1Number

Start of the line along the x-axis

x2Number

End of the line along the x-axis

y1Number

Start of the line along the y-axis

y2Number

End of the line along the y-axis

Methods

staticln.getElInstance(el){ln}

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

staticln.getInstance(id){ln}

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