Class: DVDendrogram

DVDendrogram

new DVDendrogram(args)

A DVisual graph element indicate a Dendrogram,which can show some combination rule for the data
Parameters:
Name Type Description
args Array.<Object> a array contain arguments below
Properties
Name Type Attributes Default Description
tree Array.<object> a set indicate the tree you want to draw,the base element is string,for example:["A",["B","C"]]
color DVColor <optional>
DVgetRandomColor(1)[0] the color for bubble
style string <optional>
'bubble' the tree base element style,'bubble' or 'text'
Source:

Methods

calHeight(dv, level, height)

calculate the height of instance level,use L2 function to make the chart more beautiful
Parameters:
Name Type Description
dv DVisual the Dvisual instance you want to draw
level int the level
height double the height of the passed level
Source:

calMaxLevel(tree) → {int}

recurrently calculate the depth of the tree
Parameters:
Name Type Description
tree object tree you want to calculate
Source:
Returns:
level - the depth of the tree
Type
int

draw(dv)

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

prepare(dv)

prepare the needed elements on the first time to draw it
Parameters:
Name Type Description
dv DVisual the Dvisual instance you want to draw
Source:

recurrencePrepare(dv, tree, level) → {object}

recurrence prepare the needed elements
Parameters:
Name Type Description
dv DVisual the Dvisual instance you want to draw
tree elements the tree you want to draw,can be string at the node,otherwise object
level DVisual the level of this procedure
Source:
Returns:
- return the width and base level from the bottom,[double,int]
Type
object