Class: DVLine

DVLine

new DVLine(args)

A DVisual graph element indicate a line
Parameters:
Name Type Description
args Array.<Object> a array contain arguments below
Properties
Name Type Attributes Default Description
beginX double the x value of the start node
beginY double the y value of the start node
endX double the x value of the stop node
endY double the y value of the stop node
color DVColor <optional>
new DVColor() the color of the dot,black in default
style string <optional>
'real' the style of this dot,should be one of 'real','dash'
shadow boolean <optional>
true whether draw the line's shadow.
lineWidth double <optional>
'1' the lineWidth of line
Source:
Example
new DVLine({'beginX':100,'beginY':100,'endX':20,'endY':20,'style':'dash'});

Methods

between(x, y) → {boolean}

whether the node in the lines's region
Parameters:
Name Type Description
x double the x value of test node
y double the y value of test node
Source:
Returns:
result -whether (x,y) is in the line's region
Type
boolean

draw(dv)

draw the line on dv's canvas
Parameters:
Name Type Description
dv DVisual the Dvisual instance you want to draw
Source:

getShadow()

get the shadow according to the line's direction
Source:
Returns:
[0,1]