maxGraph/docs/api/classes/GraphHierarchyModel.html

100 lines
37 KiB
HTML

<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GraphHierarchyModel | @maxgraph/core</title><meta name="description" content="Documentation for @maxgraph/core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@maxgraph/core</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../index.html">@maxgraph/core</a></li><li><a href="GraphHierarchyModel.html">GraphHierarchyModel</a></li></ul><h1>Class GraphHierarchyModel</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<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>
</div><div><p>Constructor: mxGraphHierarchyModel</p>
<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>
<p>Arguments:</p>
<p>graph - the facade describing the graph to be operated on
vertices - the vertices for this hierarchy
ordered - whether or not the vertices are already ordered
deterministic - whether or not this layout should be deterministic on each
tightenToSource - whether or not to tighten vertices towards the sources
scanRanksFromSinks - Whether rank assignment is from the sinks or sources.
usage</p>
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">GraphHierarchyModel</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="GraphHierarchyModel.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#SOURCESCANSTARTRANK" class="tsd-kind-icon">SOURCESCANSTARTRANK</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#dfsCount" class="tsd-kind-icon">dfs<wbr/>Count</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#edgeMapper" class="tsd-kind-icon">edge<wbr/>Mapper</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#maxRank" class="tsd-kind-icon">max<wbr/>Rank</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#parent" class="tsd-kind-icon">parent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#ranks" class="tsd-kind-icon">ranks</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#roots" class="tsd-kind-icon">roots</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#tightenToSource" class="tsd-kind-icon">tighten<wbr/>To<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#vertexMapper" class="tsd-kind-icon">vertex<wbr/>Mapper</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#createInternalCells" class="tsd-kind-icon">create<wbr/>Internal<wbr/>Cells</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#dfs" class="tsd-kind-icon">dfs</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#extendedDfs" class="tsd-kind-icon">extended<wbr/>Dfs</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#fixRanks" class="tsd-kind-icon">fix<wbr/>Ranks</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#initialRank" class="tsd-kind-icon">initial<wbr/>Rank</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#visit" class="tsd-kind-icon">visit</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Graph<wbr/>Hierarchy<wbr/>Model<span class="tsd-signature-symbol">(</span>layout<span class="tsd-signature-symbol">: </span><a href="HierarchicalLayout.html" class="tsd-signature-type" data-tsd-kind="Class">HierarchicalLayout</a>, vertices<span class="tsd-signature-symbol">: </span><a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a>, roots<span class="tsd-signature-symbol">: </span><a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a>, parent<span class="tsd-signature-symbol">: </span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a>, tightenToSource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="GraphHierarchyModel.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyModel</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L39">view/layout/hierarchical/GraphHierarchyModel.ts:39</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>layout: <a href="HierarchicalLayout.html" class="tsd-signature-type" data-tsd-kind="Class">HierarchicalLayout</a></h5></li><li><h5>vertices: <a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a></h5></li><li><h5>roots: <a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a></h5></li><li><h5>parent: <a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a></h5></li><li><h5>tightenToSource: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="GraphHierarchyModel.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyModel</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="SOURCESCANSTARTRANK" class="tsd-anchor"></a><h3>SOURCESCANSTARTRANK</h3><div class="tsd-signature tsd-kind-icon">SOURCESCANSTARTRANK<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 100000000</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L153">view/layout/hierarchical/GraphHierarchyModel.ts:153</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>High value to start source layering scan rank value from.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="dfsCount" class="tsd-anchor"></a><h3>dfs<wbr/>Count</h3><div class="tsd-signature tsd-kind-icon">dfs<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L148">view/layout/hierarchical/GraphHierarchyModel.ts:148</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Count of the number of times the ancestor dfs has been used.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="edgeMapper" class="tsd-anchor"></a><h3>edge<wbr/>Mapper</h3><div class="tsd-signature tsd-kind-icon">edge<wbr/>Mapper<span class="tsd-signature-symbol">:</span> <a href="Dictionary.html" class="tsd-signature-type" data-tsd-kind="Class">Dictionary</a><span class="tsd-signature-symbol">&lt;</span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a><span class="tsd-signature-symbol">, </span><a href="GraphHierarchyEdge.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyEdge</a><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L127">view/layout/hierarchical/GraphHierarchyModel.ts:127</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Map from graph edges to internal model edges</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="maxRank" class="tsd-anchor"></a><h3>max<wbr/>Rank</h3><div class="tsd-signature tsd-kind-icon">max<wbr/>Rank<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L117">view/layout/hierarchical/GraphHierarchyModel.ts:117</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Stores the largest rank number allocated</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="parent" class="tsd-anchor"></a><h3>parent</h3><div class="tsd-signature tsd-kind-icon">parent<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L143">view/layout/hierarchical/GraphHierarchyModel.ts:143</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>The parent cell whose children are being laid out</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="ranks" class="tsd-anchor"></a><h3>ranks</h3><div class="tsd-signature tsd-kind-icon">ranks<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphAbstractHierarchyCell.html" class="tsd-signature-type" data-tsd-kind="Class">GraphAbstractHierarchyCell</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L132">view/layout/hierarchical/GraphHierarchyModel.ts:132</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Mapping from rank number to actual rank</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="roots" class="tsd-anchor"></a><h3>roots</h3><div class="tsd-signature tsd-kind-icon">roots<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L138">view/layout/hierarchical/GraphHierarchyModel.ts:138</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Store of roots of this hierarchy model, these are real graph cells, not
internal cells</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="tightenToSource" class="tsd-anchor"></a><h3>tighten<wbr/>To<wbr/>Source</h3><div class="tsd-signature tsd-kind-icon">tighten<wbr/>To<wbr/>Source<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L159">view/layout/hierarchical/GraphHierarchyModel.ts:159</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether or not to tighten the assigned ranks of vertices up towards
the source cells.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="vertexMapper" class="tsd-anchor"></a><h3>vertex<wbr/>Mapper</h3><div class="tsd-signature tsd-kind-icon">vertex<wbr/>Mapper<span class="tsd-signature-symbol">:</span> <a href="Dictionary.html" class="tsd-signature-type" data-tsd-kind="Class">Dictionary</a><span class="tsd-signature-symbol">&lt;</span><a href="Cell.html" class="tsd-signature-type" data-tsd-kind="Class">Cell</a><span class="tsd-signature-symbol">, </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a><span class="tsd-signature-symbol">&gt;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L122">view/layout/hierarchical/GraphHierarchyModel.ts:122</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Map from graph vertices to internal model nodes.</p>
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="createInternalCells" class="tsd-anchor"></a><h3>create<wbr/>Internal<wbr/>Cells</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">create<wbr/>Internal<wbr/>Cells<span class="tsd-signature-symbol">(</span>layout<span class="tsd-signature-symbol">: </span><a href="HierarchicalLayout.html" class="tsd-signature-type" data-tsd-kind="Class">HierarchicalLayout</a>, vertices<span class="tsd-signature-symbol">: </span><a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a>, internalVertices<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L170">view/layout/hierarchical/GraphHierarchyModel.ts:170</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Creates all edges in the internal model</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>layout: <a href="HierarchicalLayout.html" class="tsd-signature-type" data-tsd-kind="Class">HierarchicalLayout</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Reference to the <HierarchicalLayout> algorithm.</p>
</div></div></li><li><h5>vertices: <a href="CellArray.html" class="tsd-signature-type" data-tsd-kind="Class">CellArray</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Array of {@link Cells} that represent the vertices whom are to
have an internal representation created.</p>
</div></div></li><li><h5>internalVertices: <span class="tsd-signature-symbol">{}</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The array of {@link GraphHierarchyNodes} to have their
information filled in using the real vertices.</p>
</div></div><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]: </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5></li></ul></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="dfs" class="tsd-anchor"></a><h3>dfs</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">dfs<span class="tsd-signature-symbol">(</span>parent<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a>, root<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a>, connectingEdge<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyEdge.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyEdge</a>, visitor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, seen<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{}</span>, layer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L506">view/layout/hierarchical/GraphHierarchyModel.ts:506</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Performs a depth first search on the internal hierarchy model</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>parent: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the parent internal node of the current internal node</p>
</div></div></li><li><h5>root: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the current internal node</p>
</div></div></li><li><h5>connectingEdge: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyEdge.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyEdge</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the internal edge connecting the internal node and the parent
internal node, if any</p>
</div></div></li><li><h5>visitor: <span class="tsd-signature-type">Function</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the visitor pattern to be called for each node</p>
</div></div></li><li><h5>seen: <span class="tsd-signature-symbol">{}</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>a set of all nodes seen by this dfs a set of all of the
ancestor node of the current node</p>
</div></div><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5></li></ul></li><li><h5>layer: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the layer on the dfs tree ( not the same as the model ranks )</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="extendedDfs" class="tsd-anchor"></a><h3>extended<wbr/>Dfs</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">extended<wbr/>Dfs<span class="tsd-signature-symbol">(</span>parent<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a>, root<span class="tsd-signature-symbol">: </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a>, connectingEdge<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyEdge.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyEdge</a>, visitor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, seen<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{}</span>, ancestors<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, childHash<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span>, layer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L555">view/layout/hierarchical/GraphHierarchyModel.ts:555</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>parent: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the parent internal node of the current internal node</p>
</div></div></li><li><h5>root: <a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the current internal node</p>
</div></div></li><li><h5>connectingEdge: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyEdge.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyEdge</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the internal edge connecting the internal node and the parent
internal node, if any</p>
</div></div></li><li><h5>visitor: <span class="tsd-signature-type">Function</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the visitor pattern to be called for each node</p>
</div></div></li><li><h5>seen: <span class="tsd-signature-symbol">{}</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>a set of all nodes seen by this dfs</p>
</div></div><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a></h5></li></ul></li><li><h5>ancestors: <span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the parent hash code</p>
</div></div></li><li><h5>childHash: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the new hash code for this node</p>
</div></div></li><li><h5>layer: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the layer on the dfs tree ( not the same as the model ranks )</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="fixRanks" class="tsd-anchor"></a><h3>fix<wbr/>Ranks</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">fix<wbr/>Ranks<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L383">view/layout/hierarchical/GraphHierarchyModel.ts:383</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="initialRank" class="tsd-anchor"></a><h3>initial<wbr/>Rank</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">initial<wbr/>Rank<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L252">view/layout/hierarchical/GraphHierarchyModel.ts:252</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<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><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="visit" class="tsd-anchor"></a><h3>visit</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">visit<span class="tsd-signature-symbol">(</span>visitor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, dfsRoots<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a><span class="tsd-signature-symbol">[]</span>, trackAncestors<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, seenNodes<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/layout/hierarchical/GraphHierarchyModel.ts#L453">view/layout/hierarchical/GraphHierarchyModel.ts:453</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>A depth first search through the internal heirarchy model.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>visitor: <span class="tsd-signature-type">Function</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The visitor function pattern to be called for each node.</p>
</div></div></li><li><h5>dfsRoots: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="GraphHierarchyNode.html" class="tsd-signature-type" data-tsd-kind="Class">GraphHierarchyNode</a><span class="tsd-signature-symbol">[]</span></h5></li><li><h5>trackAncestors: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Whether or not the search is to keep track all nodes
directly above this one in the search path.</p>
</div></div></li><li><h5>seenNodes: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> = null</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="../modules/DomHelpers.html">Dom<wbr/>Helpers</a></li><li class=" tsd-kind-namespace"><a href="../modules/cloneUtils.html">clone<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/constants.html">constants</a></li><li class=" tsd-kind-namespace"><a href="../modules/domUtils.html">dom<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/eventUtils.html">event<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/gestureUtils.html">gesture<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/mathUtils.html">math<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/stringUtils.html">string<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/styleUtils.html">style<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li><li class=" tsd-kind-namespace"><a href="../modules/xmlUtils.html">xml<wbr/>Utils</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="GraphHierarchyModel.html" class="tsd-kind-icon">Graph<wbr/>Hierarchy<wbr/>Model</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="GraphHierarchyModel.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#SOURCESCANSTARTRANK" class="tsd-kind-icon">SOURCESCANSTARTRANK</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#dfsCount" class="tsd-kind-icon">dfs<wbr/>Count</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#edgeMapper" class="tsd-kind-icon">edge<wbr/>Mapper</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#maxRank" class="tsd-kind-icon">max<wbr/>Rank</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#parent" class="tsd-kind-icon">parent</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#ranks" class="tsd-kind-icon">ranks</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#roots" class="tsd-kind-icon">roots</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#tightenToSource" class="tsd-kind-icon">tighten<wbr/>To<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="GraphHierarchyModel.html#vertexMapper" class="tsd-kind-icon">vertex<wbr/>Mapper</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#createInternalCells" class="tsd-kind-icon">create<wbr/>Internal<wbr/>Cells</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#dfs" class="tsd-kind-icon">dfs</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#extendedDfs" class="tsd-kind-icon">extended<wbr/>Dfs</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#fixRanks" class="tsd-kind-icon">fix<wbr/>Ranks</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#initialRank" class="tsd-kind-icon">initial<wbr/>Rank</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="GraphHierarchyModel.html#visit" class="tsd-kind-icon">visit</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>