<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxFastOrganicLayout"></a>mxFastOrganicLayout</h1><divclass=CBody><p>Extends <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link32onMouseOver="ShowTip(event, 'tt1', 'link32')"onMouseOut="HideTip('tt1')">mxGraphLayout</a> to implement a fast organic layout algorithm. The vertices need to be connected for this layout to work, vertices with no connections are ignored.</p><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint">var layout = new mxFastOrganicLayout(graph);
layout.execute(graph.getDefaultParent());</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxFastOrganicLayout">mxFastOrganicLayout</a></td><tdclass=SDescription>Extends <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxGraphLayout</a> to implement a fast organic layout algorithm. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxFastOrganicLayout.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.mxCompactTreeLayout">mxCompactTreeLayout</a></td><tdclass=SDescription>Constructs a new fast organic layout for the specified graph.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxFastOrganicLayout.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.useInputOrigin"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">useInputOrigin</a></td><tdclass=SDescription>Specifies if the top left corner of the input cells should be the origin of the layout result. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxFastOrganicLayout.resetEdges"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">resetEdges</a></td><tdclass=SDescription>Specifies if all edge points of traversed edges should be removed. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.disableEdgeStyle"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">disableEdgeStyle</a></td><tdclass=SDescription>Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxFastOrganicLayout.forceConstant"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">forceConstant</a></td><tdclass=SDescription>The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.forceConstantSquared"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">forceConstantSquared</a></td><tdclass=SDescription>Cache of <forceConstant>^2 for performance.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxFastOrganicLayout.minDistanceLimit"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">minDistanceLimit</a></td><tdclass=SDescription>Minimal distance limit. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.minDistanceLimit">minDistanceLimit</a></td><tdclass=SDescription>Minimal distance limit. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxFastOrganicLayout.minDistanceLimitSquared"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">minDistanceLimitSquared</a></td><tdclass=SDescription>Cached version of <ahref="#mxFastOrganicLayout.minDistanceLimit"class=LVariableid=link9onMouseOver="ShowTip(event, 'tt7', 'link9')"onMouseOut="HideTip('tt7')">minDistanceLimit</a> squared.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxFastOrganicLayout.initialTemp"id=link10onMouseOver="ShowTip(event, 'tt9', 'link10')"onMouseOut="HideTip('tt9')">initialTemp</a></td><tdclass=SDescription>Start value of temperature. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxFastOrganicLayout.temperature"id=link11onMouseOver="ShowTip(event, 'tt10', 'link11')"onMouseOut="HideTip('tt10')">temperature</a></td><tdclass=SDescription>Temperature to limit displacement at later stages
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.mxCompactTreeLayout"></a>mxCompactTreeLayout</h3><divclass=CBody><p>Constructs a new fast organic layout for the specified graph.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.useInputOrigin"></a>useInputOrigin</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.useInputOrigin</td></tr></table></blockquote><p>Specifies if the top left corner of the input cells should be the origin of the layout result. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.resetEdges"></a>resetEdges</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.resetEdges</td></tr></table></blockquote><p>Specifies if all edge points of traversed edges should be removed. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.disableEdgeStyle"></a>disableEdgeStyle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.disableEdgeStyle</td></tr></table></blockquote><p>Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.forceConstant"></a>forceConstant</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.forceConstant</td></tr></table></blockquote><p>The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. The value equates to the average radius there is of free space around each node. Default is 50.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.forceConstantSquared"></a>forceConstantSquared</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.forceConstantSquared</td></tr></table></blockquote><p>Cache of <forceConstant>^2 for performance.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.minDistanceLimit"></a>minDistanceLimit</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.minDistanceLimit</td></tr></table></blockquote><p>Minimal distance limit. Default is 2. Prevents of dividing by zero.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.minDistanceLimit"></a>minDistanceLimit</h3><divclass=CBody><p>Minimal distance limit. Default is 2. Prevents of dividing by zero.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.minDistanceLimitSquared"></a>minDistanceLimitSquared</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.minDistanceLimitSquared</td></tr></table></blockquote><p>Cached version of <ahref="#mxFastOrganicLayout.minDistanceLimit"class=LVariableid=link33onMouseOver="ShowTip(event, 'tt7', 'link33')"onMouseOut="HideTip('tt7')">minDistanceLimit</a> squared.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.initialTemp"></a>initialTemp</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.initialTemp</td></tr></table></blockquote><p>Start value of temperature. Default is 200.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.temperature"></a>temperature</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.temperature</td></tr></table></blockquote><p>Temperature to limit displacement at later stages of layout.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.maxIterations"></a>maxIterations</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.maxIterations</td></tr></table></blockquote><p>Total number of iterations to run the layout though.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.vertexArray"></a>vertexArray</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.vertexArray</td></tr></table></blockquote><p>An array of all vertices to be laid out.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.dispX"></a>dispX</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.dispX</td></tr></table></blockquote><p>An array of locally stored X co-ordinate displacements for the vertices.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.dispY"></a>dispY</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.dispY</td></tr></table></blockquote><p>An array of locally stored Y co-ordinate displacements for the vertices.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.cellLocation"></a>cellLocation</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.cellLocation</td></tr></table></blockquote><p>An array of locally stored co-ordinate positions for the vertices.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.radius"></a>radius</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.radius</td></tr></table></blockquote><p>The approximate radius of each cell, nodes only.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.radiusSquared"></a>radiusSquared</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.radiusSquared</td></tr></table></blockquote><p>The approximate radius squared of each cell, nodes only.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.isMoveable"></a>isMoveable</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.isMoveable</td></tr></table></blockquote><p>Array of booleans representing the movable states of the vertices.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.neighbours"></a>neighbours</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.neighbours</td></tr></table></blockquote><p>Local copy of cell neighbours.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.indices"></a>indices</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.indices</td></tr></table></blockquote><p>Hashtable from cells to local indices.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.allowedToRun"></a>allowedToRun</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.allowedToRun</td></tr></table></blockquote><p>Boolean flag that specifies if the layout is allowed to run. If this is set to false, then the layout exits in the following iteration.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.isVertexIgnored"></a>isVertexIgnored</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxFastOrganicLayout.prototype.isVertexIgnored = function(</td><tdclass="PParameter prettyprint "nowrap>vertex</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a boolean indicating if the given <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link34onMouseOver="ShowTip(event, 'tt24', 'link34')"onMouseOut="HideTip('tt24')">mxCell</a> should be ignored as a vertex. This returns true if the cell has no connections.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>vertex</td><tdclass=CDLDescription><ahref="../model/mxCell-js.html#mxCell"class=LClassid=link35onMouseOver="ShowTip(event, 'tt24', 'link35')"onMouseOut="HideTip('tt24')">mxCell</a> whose ignored state should be returned.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.execute"></a>execute</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxFastOrganicLayout.prototype.execute = function(</td><tdclass="PParameter prettyprint "nowrap>parent</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Implements <ahref="mxGraphLayout-js.html#mxGraphLayout.execute"class=LFunctionid=link36onMouseOver="ShowTip(event, 'tt26', 'link36')"onMouseOut="HideTip('tt26')">mxGraphLayout.execute</a>. This operates on all children of the given parent where <ahref="#mxFastOrganicLayout.isVertexIgnored"class=LFunctionid=link37onMouseOver="ShowTip(event, 'tt23', 'link37')"onMouseOut="HideTip('tt23')">isVertexIgnored</a> returns false.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.calcPositions"></a>calcPositions</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.calcPositions = function()</td></tr></table></blockquote><p>Takes the displacements calculated for each cell and applies them to the local cache of cell positions. Limits the displacement to the current temperature.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.calcAttraction"></a>calcAttraction</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.calcAttraction = function()</td></tr></table></blockquote><p>Calculates the attractive forces between all laid out nodes linked by edges</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.calcRepulsion"></a>calcRepulsion</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.calcRepulsion = function()</td></tr></table></blockquote><p>Calculates the repulsive forces between all laid out nodes</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxFastOrganicLayout.reduceTemperature"></a>reduceTemperature</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.reduceTemperature = function()</td></tr></table></blockquote><p>Reduces the temperature of the layout from an initial setting in a linear fashion to zero.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CClass>Base class for all layout algorithms in mxGraph. </div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.useInputOrigin</td></tr></table></blockquote>Specifies if the top left corner of the input cells should be the origin of the layout result. </div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.resetEdges</td></tr></table></blockquote>Specifies if all edge points of traversed edges should be removed. </div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.disableEdgeStyle</td></tr></table></blockquote>Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. </div></div><divclass=CToolTipid="tt5"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.forceConstant</td></tr></table></blockquote>The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. </div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.forceConstantSquared</td></tr></table></blockquote>Cache of <forceConstant>^2 for performance.</div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.minDistanceLimit</td></tr></table></blockquote>Minimal distance limit. </div></div><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.minDistanceLimitSquared</td></tr></table></blockquote>Cached version of minDistanceLimit squared.</div></div><divclass=CToolTipid="tt9"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.initialTemp</td></tr></table></blockquote>Start value of temperature. </div></div><divclass=CToolTipid="tt10"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.temperature</td></tr></table></blockquote>Temperature to limit displacement at later stages of layout.</div></div><divclass=CToolTipid="tt11"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.maxIterations</td></tr></table></blockquote>Total number of iterations to run the layout though.</div></div><divclass=CToolTipid="tt12"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.iteration</td></tr></table></blockquote>Current iteration count.</div></div><divclass=CToolTipid="tt13"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.vertexArray</td></tr></table></blockquote>An array of all vertices to be laid out.</div></div><divclass=CToolTipid="tt14"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxFastOrganicLayout.prototype.dispX</td></tr></table></blockquote>An array of locally stored X co-ordinate displacements for the vertices.</div></div><divclass=CToolTipid="tt15"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Pro