Data dictionary for Prototype 01
clusterArray
An array, an array of objects to store the cluster data.
Each object has the following properties:
- (implicit is row number: the array index less 1)
- itemA first leaf or cluster in the cluster
- itemB second leaf or cluster in the cluster
- mergeH (short for mergeHieght)
- redrawn - boolean, true if was redrawn, else false
e.g from our data table The first cluster goes in clusterArray[0]so
clusterArray[0].itemA = 1; clusterArray[0].itemB = 6;clusterArray[0].mergeH = 0;
clusterArray[0].redrawn = 0;
clusterArrayPtr
Indicates the current row of the clusterArray being processed
//set the array pointer to -1 to indicate empty dendrogram
lastDataRow
Indicates the size of the data set for loop control, e.g.
lastDataRow=5
iterationCount
To watch for infinite looping in the drawing iterations
backtrackCount
To watch for drawing backtracking
largestHt
largest mergeH used to decide the size of the canvas, e.g.
largestHt=0;
noOfLeafs
Used to help dimension the canvas and graph, e.g.
noOfLeafs=lastDataRow+1;
leafSpace
Used to help dimension the canvas and graph, e.g.
leafSpace=15
startingSlot
Sets the slot to place the first leaf
startingSlot=noOfLeafs/2 rounded down to nearest whole number
minLeafSlot
Sets the smallest allowed leaf slot
minLeafSlot=1
maxLeafSlot
Sets the largest allowed leaf slot
maxLeafSlot=noOfLeafs+1;
leftMostNodeY
tracks top and bottom of dendrogram along with rightMostNodeY
leftMostNodeY=startingSlot
rightMostNodeY
tracks top and bottom of dendrogram along with leftMostNodeY
rightMostNodeY=startingSlot
standardLeafRadius
Sets the standard Leaf Radius for a leaf node circle
standardLeafRadius= 4
htScaleFactor
No of pixels per mergeHt unit. Used to help dimension the canvas and graph, e.g.
htScaleFactor=100
margin
Gap between graph and edge of canvas. Used to help dimension the canvas and graph, e.g.
margin=50
canvasX
Width of the canvas e.g.
canvasX=(largestHt*htScaleFactor)+(margin*2);
canvasY
Ht of the canvas e.g.
canvasY=((noOfLeafs)*leafSpace)+(margin*2);
paper
To declare and draw the canvas e.g.
var paper = new Raphael(document.getElementById('canvas_container'), canvasX, canvasY);
origin
Used in drawing the graph e.g.
origin=makePt(margin,margin);// gives us origin.x and origin.y
xAxis
the xAxis of the graph e.g.
var xAxis=drawXAxis(paper, origin, canvasX-margin-margin, htScaleFactor/2 );
yAxis
the yAxis of the graph e.g.
var yAxis= paper.path("M "+origin.x+" "+origin.y+"l 0 "+(canvasY-margin-margin));
xAxisLabelMax
label for xAxis of the graph e.g.
var xAxisLabelMax = paper.text((largestHt*htScaleFactor+margin), margin-10, 'Max ht = '+largestHt);
originLabel
label for origin of the graph e.g.
var originLabel = paper.text((margin), margin-10, '0');
yAxixLabel
label for yAxis of the graph e.g.
var yAxixLabel= paper.text(15, Math.round(canvasY/2), 'Leafs');
deArray
dendrogramElementArray or deArray for short. There are 3 types of element:
- Leaf: has a leafslot number (its Y pos)
- Cluster: has a topBoundY, bottomBoundY and htX (its X pos)
- Stem: has a child node (leaf or cluster). The child node's Y is the stem's Y
The child node's ht (X) is the stem's childHtX.
The stem also has a parent cluster. The ht of the parent cluster is the stem's parentHtX
Each deArray object has the following properties:
- eType
- for Leafs this is 1
- for Clusters this is 2
- for Stems this is 3
- e.g. deArray[0].eType= 1
- nodeNo
- for Leafs this is the node item number from the clusterArray
- for Clusters this is the node item number from the clusterArray
- for Stems this is irrelevant (Set to zero)
- e.g. deArray[3].nodeNo=2
- clusterArrayInd
- the index of the clusterArray row that caused it to be drawn
- e.g. deArray[3].clusterArrayI= 4
- topBoundY
- for Leafs this is the leaf slot number (yPos)
- for Clusters this is topBoundY
- for Stems this is its child node's Y
- e.g. deArray[3].topBoundY= 1
- bottomBoundY
- for Leafs this is the same as its topBoundY
- for Clusters this is its bottomBoundY
- for Stems this is the same as its topBoundY
- e.g. deArray[3].bottomBoundY= 2
- htX
- for Leafs this is 0
- for Clusters this is its height
- for Stems this is the height of its child node
- e.g. deArray[3].htX= 2
- parentHtX
- for Leafs this is (irrelevant, set to same as htX)
- for Clusters this is (irrelevant, set to same as htX)
- for Stems this is the height of its child node
- e.g. deArray[3].htX= 2.5
- element
- for Leafs this is a circle object drawn on the chart
- for Clusters this is the crossbar line drawn between 2 stems
- for Stems this is line drawn from its child element up to its Ht
- e.g. deArray[3].element= paper.circle(.........)
deArrayPointer
a pointer to the most recent successfully drawn element e.g.
deArrayPointer=-1;//-1 indicates empty dendrogram