<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxGraphHierarchyModel"></a>mxGraphHierarchyModel</h1><divclass=CBody><p>Internal model of a hierarchical graph. This model stores nodes and edges equivalent to the real graph nodes and edges, but also stores the rank of the cells, the order within the ranks and the new candidate locations of cells. The internal model also reverses edge direction were appropriate , ignores self-loop and groups parallels together under one edge object.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxGraphHierarchyModel">mxGraphHierarchyModel</a></td><tdclass=SDescription>Internal model of a hierarchical graph. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.mxGraphHierarchyModel"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxGraphHierarchyModel</a></td><tdclass=SDescription>Creates an internal ordered graph model using the vertices passed in. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.maxRank"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">maxRank</a></td><tdclass=SDescription>Stores the largest rank number allocated</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.vertexMapper"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">vertexMapper</a></td><tdclass=SDescription>Map from graph vertices to internal model nodes.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.edgeMapper"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">edgeMapper</a></td><tdclass=SDescription>Map from graph edges to internal model edges</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.ranks"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">ranks</a></td><tdclass=SDescription>Mapping from rank number to actual rank</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.roots"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">roots</a></td><tdclass=SDescription>Store of roots of this hierarchy model, these are real graph cells, not internal cells</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.parent"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">parent</a></td><tdclass=SDescription>The parent cell whose children are being laid out</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.dfsCount"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">dfsCount</a></td><tdclass=SDescription>Count of the number of times the ancestor dfs has been used.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.SOURCESCANSTARTRANK"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">SOURCESCANSTARTRANK</a></td><tdclass=SDescription>High value to start source layering scan rank value from.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxGraphHierarchyModel.tightenToSource"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10')">tightenToSource</a></td><tdclass=SDescription>Whether or not to tighten the assigned ranks of vertices up towards the source cells.</td></tr><trclass="SGroup SIndent1"><tdclass=SEn
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.mxGraphHierarchyModel"></a>mxGraphHierarchyModel</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxGraphHierarchyModel(</td><tdclass=PParameternowrap>layout,</td></tr><tr><td></td><tdclass=PParameternowrap>vertices,</td></tr><tr><td></td><tdclass=PParameternowrap>roots,</td></tr><tr><td></td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>tightenToSource</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates an internal ordered graph model using the vertices passed in. If there are any, leftward edge need to be inverted in the internal model</p><h4class=CHeading>Arguments</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>the facade describing the graph to be operated on</td></tr><tr><tdclass=CDLEntry>vertices</td><tdclass=CDLDescription>the vertices for this hierarchy</td></tr><tr><tdclass=CDLEntry>ordered</td><tdclass=CDLDescription>whether or not the vertices are already ordered</td></tr><tr><tdclass=CDLEntry>deterministic</td><tdclass=CDLDescription>whether or not this layout should be deterministic on each</td></tr><tr><tdclass=CDLEntry>tightenToSource</td><tdclass=CDLDescription>whether or not to tighten vertices towards the sources</td></tr><tr><tdclass=CDLEntry>scanRanksFromSinks</td><tdclass=CDLDescription>Whether rank assignment is from the sinks or sources. usage</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.maxRank"></a>maxRank</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.maxRank</td></tr></table></blockquote><p>Stores the largest rank number allocated</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.vertexMapper"></a>vertexMapper</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.vertexMapper</td></tr></table></blockquote><p>Map from graph vertices to internal model nodes.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.edgeMapper"></a>edgeMapper</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.edgeMapper</td></tr></table></blockquote><p>Map from graph edges to internal model edges</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.ranks"></a>ranks</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.ranks</td></tr></table></blockquote><p>Mapping from rank number to actual rank</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.roots"></a>roots</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.roots</td></tr></table></blockquote><p>Store of roots of this hierarchy model, these are real graph cells, not internal cells</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.parent"></a>parent</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.parent</td></tr></table></blockquote><p>The parent cell whose children are being laid out</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.dfsCount"></a>dfsCount</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.dfsCount</td></tr></table></blockquote><p>Count of the number of times the ancestor dfs has been used.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.SOURCESCANSTARTRANK"></a>SOURCESCANSTARTRANK</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK</td></tr></table></blockquote><p>High value to start source layering scan rank value from.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.tightenToSource"></a>tightenToSource</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.tightenToSource</td></tr></table></blockquote><p>Whether or not to tighten the assigned ranks of vertices up towards the source cells.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.createInternalCells"></a>createInternalCells</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphHierarchyModel.prototype.createInternalCells = function(</td><tdclass=PParameternowrap>layout,</td></tr><tr><td></td><tdclass=PParameternowrap>vertices,</td></tr><tr><td></td><tdclass=PParameternowrap>internalVertices</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates all edges in the internal model</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>layout</td><tdclass=CDLDescription>Reference to the <ahref="../mxHierarchicalLayout-js.html#mxHierarchicalLayout"class=LClassid=link17onMouseOver="ShowTip(event, 'tt17', 'link17')"onMouseOut="HideTip('tt17')">mxHierarchicalLayout</a> algorithm.</td></tr><tr><tdclass=CDLEntry>vertices</td><tdclass=CDLDescription>Array of <ahref="../../../model/mxCell-js.html#mxCell"class=LClassid=link18onMouseOver="ShowTip(event, 'tt18', 'link18')"onMouseOut="HideTip('tt18')">mxCells</a> that represent the vertices whom are to have an internal representation created.</td></tr><tr><tdclass=CDLEntry>internalVertices</td><tdclass=CDLDescription>The array of <ahref="mxGraphHierarchyNode-js.html#mxGraphHierarchyNode"class=LClassid=link19onMouseOver="ShowTip(event, 'tt19', 'link19')"onMouseOut="HideTip('tt19')">mxGraphHierarchyNodes</a> to have their information filled in using the real vertices.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.initialRank"></a>initialRank</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.initialRank = function()</td></tr></table></blockquote><p>Basic determination of minimum layer ranking by working from from sources or sinks and working through each node in the relevant edge direction. Starting at the sinks is basically a longest path layering algorithm.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.fixRanks"></a>fixRanks</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.fixRanks = function()</td></tr></table></blockquote><p>Fixes the layer assignments to the values stored in the nodes. Also needs to create dummy nodes for edges that cross layers.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.visit"></a>visit</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphHierarchyModel.prototype.visit = function(</td><tdclass=PParameternowrap>visitor,</td></tr><tr><td></td><tdclass=PParameternowrap>dfsRoots,</td></tr><tr><td></td><tdclass=PParameternowrap>trackAncestors,</td></tr><tr><td></td><tdclass=PParameternowrap>seenNodes</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>A depth first search through the internal heirarchy model.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>visitor</td><tdclass=CDLDescription>The visitor function pattern to be called for each node.</td></tr><tr><tdclass=CDLEntry>trackAncestors</td><tdclass=CDLDescription>Whether or not the search is to keep track all nodes directly above this one in the search path.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.dfs"></a>dfs</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphHierarchyModel.prototype.dfs = function(</td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>root,</td></tr><tr><td></td><tdclass=PParameternowrap>connectingEdge,</td></tr><tr><td></td><tdclass=PParameternowrap>visitor,</td></tr><tr><td></td><tdclass=PParameternowrap>seen,</td></tr><tr><td></td><tdclass=PParameternowrap>layer</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Performs a depth first search on the internal hierarchy model</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>parent</td><tdclass=CDLDescription>the parent internal node of the current internal node</td></tr><tr><tdclass=CDLEntry>root</td><tdclass=CDLDescription>the current internal node</td></tr><tr><tdclass=CDLEntry>connectingEdge</td><tdclass=CDLDescription>the internal edge connecting the internal node and the parent internal node, if any</td></tr><tr><tdclass=CDLEntry>visitor</td><tdclass=CDLDescription>the visitor pattern to be called for each node</td></tr><tr><tdclass=CDLEntry>seen</td><tdclass=CDLDescription>a set of all nodes seen by this dfs a set of all of the ancestor node of the current node</td></tr><tr><tdclass=CDLEntry>layer</td><tdclass=CDLDescription>the layer on the dfs tree ( not the same as the model ranks )</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxGraphHierarchyModel.extendedDfs"></a>extendedDfs</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphHierarchyModel.prototype.extendedDfs = function(</td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>root,</td></tr><tr><td></td><tdclass=PParameternowrap>connectingEdge,</td></tr><tr><td></td><tdclass=PParameternowrap>visitor,</td></tr><tr><td></td><tdclass=PParameternowrap>seen,</td></tr><tr><td></td><tdclass=PParameternowrap>ancestors,</td></tr><tr><td></td><tdclass=PParameternowrap>childHash,</td></tr><tr><td></td><tdclass=PParameternowrap>layer</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Performs a depth first search on the internal hierarchy model. This dfs extends the default version by keeping track of cells ancestors, but it should be only used when necessary because of it can be computationally intensive for deep searches.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>parent</td><tdclass=CDLDescription>the parent internal node of the current internal node</td></tr><tr><tdclass=CDLEntry>root</td><tdclass=CDLDescription>the current internal node</td></tr><tr><tdclass=CDLEntry>connectingEdge</td><tdclass=CDLDescription>the internal edge connecting the internal node and the parent internal node, if any</td></tr><tr><tdclass=CDLEntry>visitor</td><tdclass=CDLDescription>the visitor pattern to be called for each node</td></tr><tr><tdclass=CDLEntry>seen</td><tdclass=CDLDescription>a set of all nodes seen by this dfs</td></tr><tr><tdclass=CDLEntry>ancestors</td><tdclass=CDLDescription>the parent hash code</td></tr><tr><tdclass=CDLEntry>childHash</td><tdclass=CDLDescription>the new hash code for this node</td></tr><tr><tdclass=CDLEntry>layer</td><tdclass=CDLDescription>the layer on the dfs tree ( not the same as the model ranks )</td></tr></table></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxGraphHierarchyModel(</td><tdclass=PParameternowrap>layout,</td></tr><tr><td></td><tdclass=PParameternowrap>vertices,</td></tr><tr><td></td><tdclass=PParameternowrap>roots,</td></tr><tr><td></td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>tightenToSource</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Creates an internal ordered graph model using the vertices passed in. </div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.maxRank</td></tr></table></blockquote>Stores the largest rank number allocated</div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.vertexMapper</td></tr></table></blockquote>Map from graph vertices to internal model nodes.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.edgeMapper</td></tr></table></blockquote>Map from graph edges to internal model edges</div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.ranks</td></tr></table></blockquote>Mapping from rank number to actual rank</div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.roots</td></tr></table></blockquote>Store of roots of this hierarchy model, these are real graph cells, not internal cells</div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.parent</td></tr></table></blockquote>The parent cell whose children are being laid out</div></div><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.dfsCount</td></tr></table></blockquote>Count of the number of times the ancestor dfs has been used.</div></div><divclass=CToolTipid="tt9"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK</td></tr></table></blockquote>High value to start source layering scan rank value from.</div></div><divclass=CToolTipid="tt10"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.tightenToSource</td></tr></table></blockquote>Whether or not to tighten the assigned ranks of vertices up towards the source cells.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraphHierarchyModel.prototype.createInternalCells = function(</td><tdclass=PParameternowrap>layout,</td></tr><tr><td></td><tdclass=PParameternowrap>vertices,</td></tr><tr><td></td><tdclass=PParameternowrap>internalVertices</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Creates all edges in the internal model</div></div><divclass=CToolTipid="tt12"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxGraphHierarchyModel.prototype.initialRank = function()</td></tr></table><