UNPKG

markgojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

1,618 lines (598 loc) 89.7 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>GoJS&reg; ForceDirectedLayout Class</title> <script src="../../assets/js/jquery.min.js"></script> <script src="../../assets/js/bootstrap.min.js"></script> <script src="../../assets/js/highlight.js"></script> <script src="../../assets/js/api.js"></script> <script src="../../assets/js/fuse.min.js"></script> <link href="../../assets/css/bootstrap.min.css" rel="stylesheet" > <!-- custom CSS after bootstrap --> <link href="../../assets/css/main.css" rel="stylesheet" type="text/css"/> <link href="../../assets/css/api.css" rel="stylesheet" type="text/css"/> <!--<link rel="stylesheet" href="../../assets/css/api.css" type="text/css" media="all" />--> <link rel="stylesheet" href="../../assets/css/highlight.css" type="text/css" media="all" /> </head> <body> <!-- non-fixed navbar --> <nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top"> <div class="container-fluid"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#navbar"> <a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../../api/index.html">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container-fluid"> <!-- ============================== classes index ============================ --> <div id="navindex" class="col-md-2"> <!-- begin publish.classesIndex --> <!-- <div><a href="../index.html">GoJS Class Index</a></div> --> <div class="sidebar-nav"> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#DiagramNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#DiagramNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Diagram Classes</span> </div> </div> <div id="DiagramNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a></li> <li><a href="../symbols/AnimationManager.html" class="linkConstructor">AnimationManager</a></li> <li><a href="../symbols/CommandHandler.html" class="linkConstructor">CommandHandler</a></li> <li><a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a></li> <li><a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a></li> <li><a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a></li> <li><a href="../symbols/Group.html" class="linkConstructor">Group</a></li> <li><a href="../symbols/InputEvent.html" class="linkConstructor">InputEvent</a></li> <li><a href="../symbols/Layer.html" class="linkConstructor">Layer</a></li> <li><a href="../symbols/Link.html" class="linkConstructor">Link</a></li> <li><a href="../symbols/Node.html" class="linkConstructor">Node</a></li> <li><a href="../symbols/Overview.html" class="linkConstructor">Overview</a></li> <li><a href="../symbols/Palette.html" class="linkConstructor">Palette</a></li> <li><a href="../symbols/Panel.html" class="linkConstructor">Panel</a></li> <li><a href="../symbols/Part.html" class="linkConstructor">Part</a></li> <li><a href="../symbols/Picture.html" class="linkConstructor">Picture</a></li> <li><a href="../symbols/Placeholder.html" class="linkConstructor">Placeholder</a></li> <li><a href="../symbols/RowColumnDefinition.html" class="linkConstructor">RowColumnDefinition</a></li> <li><a href="../symbols/Shape.html" class="linkConstructor">Shape</a></li> <li><a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#GeometryNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#GeometryNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Geometry Classes</span> </div> </div> <div id="GeometryNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Brush.html" class="linkConstructor">Brush</a></li> <li><a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a></li> <li><a href="../symbols/Margin.html" class="linkConstructor">Margin</a></li> <li><a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a></li> <li><a href="../symbols/PathSegment.html" class="linkConstructor">PathSegment</a></li> <li><a href="../symbols/Point.html" class="linkConstructor">Point</a></li> <li><a href="../symbols/Rect.html" class="linkConstructor">Rect</a></li> <li><a href="../symbols/Size.html" class="linkConstructor">Size</a></li> <li><a href="../symbols/Spot.html" class="linkConstructor">Spot</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ModelNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ModelNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Model Classes</span> </div> </div> <div id="ModelNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Binding.html" class="linkConstructor">Binding</a></li> <li><a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a></li> <li><a href="../symbols/GraphLinksModel.html" class="linkConstructor">GraphLinksModel</a></li> <li><a href="../symbols/Model.html" class="linkConstructor">Model</a></li> <li><a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a></li> <li><a href="../symbols/TreeModel.html" class="linkConstructor">TreeModel</a></li> <li><a href="../symbols/UndoManager.html" class="linkConstructor">UndoManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#LayoutNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#LayoutNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Layout Classes</span> </div> </div> <div id="LayoutNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/CircularLayout.html" class="linkConstructor">CircularLayout</a></li> <li><a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a></li> <li><a href="../symbols/GridLayout.html" class="linkConstructor">GridLayout</a></li> <li><a href="../symbols/LayeredDigraphLayout.html" class="linkConstructor">LayeredDigraphLayout</a></li> <li><a href="../symbols/Layout.html" class="linkConstructor">Layout</a></li> <li><a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a></li> <li><a href="../symbols/TreeLayout.html" class="linkConstructor">TreeLayout</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ToolNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ToolNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Tool Classes</span> </div> </div> <div id="ToolNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/ActionTool.html" class="linkConstructor">ActionTool</a></li> <li><a href="../symbols/ClickCreatingTool.html" class="linkConstructor">ClickCreatingTool</a></li> <li><a href="../symbols/ClickSelectingTool.html" class="linkConstructor">ClickSelectingTool</a></li> <li><a href="../symbols/ContextMenuTool.html" class="linkConstructor">ContextMenuTool</a></li> <li><a href="../symbols/DraggingTool.html" class="linkConstructor">DraggingTool</a></li> <li><a href="../symbols/DragSelectingTool.html" class="linkConstructor">DragSelectingTool</a></li> <li><a href="../symbols/HTMLInfo.html" class="linkConstructor">HTMLInfo</a></li> <li><a href="../symbols/LinkingBaseTool.html" class="linkConstructor">LinkingBaseTool</a></li> <li><a href="../symbols/LinkingTool.html" class="linkConstructor">LinkingTool</a></li> <li><a href="../symbols/LinkReshapingTool.html" class="linkConstructor">LinkReshapingTool</a></li> <li><a href="../symbols/PanningTool.html" class="linkConstructor">PanningTool</a></li> <li><a href="../symbols/RelinkingTool.html" class="linkConstructor">RelinkingTool</a></li> <li><a href="../symbols/ResizingTool.html" class="linkConstructor">ResizingTool</a></li> <li><a href="../symbols/RotatingTool.html" class="linkConstructor">RotatingTool</a></li> <li><a href="../symbols/TextEditingTool.html" class="linkConstructor">TextEditingTool</a></li> <li><a href="../symbols/Tool.html" class="linkConstructor">Tool</a></li> <li><a href="../symbols/ToolManager.html" class="linkConstructor">ToolManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#CollectionNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#CollectionNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Collection Classes</span> </div> </div> <div id="CollectionNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Iterable.html" class="linkConstructor">Iterable</a></li> <li><a href="../symbols/Iterator.html" class="linkConstructor">Iterator</a></li> <li><a href="../symbols/List.html" class="linkConstructor">List</a></li> <li><a href="../symbols/Map.html" class="linkConstructor">Map</a></li> <li><a href="../symbols/Set.html" class="linkConstructor">Set</a></li> </ul> </div> </div> </div> <!-- /class="sidebar-nav --> <!-- end publish.classesIndex --> </div> <div id="contentBody" class="col-md-10"> <div class="searchsumm"> <div class="table-wrap"> <div class="table-cell" id="apisearch" data-base="../"> <div class="title">Search API</div> <div class="field"> <label for="search-field" class="search-icon"></label> <input id="search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> </div> <div class="table-cell" id="apisumm"> <input type="checkbox" id="showsumms" /> <label class="apisumms" for="showsumms">Show Summaries</label> </div> </div> </div> <!-- ============================== header ================================= --> <div id="header" class="fineprint"> <b>GoJS</b>&reg; Diagramming Components<br/>version 1.8.36 for JavaScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a> </div> <!-- ============================== class title ============================ --> <h2 class="classTitle"> Class ForceDirectedLayout </h2> <!-- ============================== class summary ========================== --> <p class="classsummary"> <span class="extends"> Extends <a href="../symbols/Layout.html" class="linkConstructor">Layout</a>.</span> Force-directed layout treats the graph as if it were a system of physical bodies with repulsive electrical, attractional gravitational, and spring forces acting on them and between them. <p> Electrical forces come both from the field at the vertex's location as well as from neighboring vertexes and are quadratic by distance. Gravitational forces come from the field at the vertex's location and are constant. Spring forces are only exerted between two different vertexes that are connected by an edge and are linear by distance. <p> The electrical forces on a vertex are the sum of the electrical charge times the electrical field at that location (<a href="../symbols/ForceDirectedLayout.html#electricalCharge" class="linkMethod">electricalCharge</a>, <a href="../symbols/ForceDirectedLayout.html#electricalFieldX" class="linkMethod">electricalFieldX</a>, <a href="../symbols/ForceDirectedLayout.html#electricalFieldY" class="linkMethod">electricalFieldY</a>) and the electrical forces of all nearby vertexes divided by the square of the distance between them. You can easily assign the electrical charge for all vertexes by assigning <a href="../symbols/ForceDirectedLayout.html#defaultElectricalCharge" class="linkProperty">defaultElectricalCharge</a>. By default there is no electrical field, so all forces are due to nearby charged vertexes. For efficiency, <a href="../symbols/ForceDirectedLayout.html#infinityDistance" class="linkProperty">infinityDistance</a> determines a cut-off distance between vertexes for which to consider any influence. <p> The gravitational forces on a vertex are the sum of the gravitational mass times the gravitational field at that location (<a href="../symbols/ForceDirectedLayout.html#gravitationalMass" class="linkMethod">gravitationalMass</a>, <a href="../symbols/ForceDirectedLayout.html#gravitationalFieldX" class="linkMethod">gravitationalFieldX</a>, <a href="../symbols/ForceDirectedLayout.html#gravitationalFieldY" class="linkMethod">gravitationalFieldY</a>). You can easily assign the gravitational mass for all vertexes by assigning <a href="../symbols/ForceDirectedLayout.html#defaultGravitationalMass" class="linkProperty">defaultGravitationalMass</a>. By default there is no gravitational field. <p> The spring forces on a vertex are only exerted by the edges connecting it with other vertexes. The force along an edge is the stiffness of the spring times the difference of the distance between the vertexes and the nominal length of the spring (<a href="../symbols/ForceDirectedLayout.html#springStiffness" class="linkMethod">springStiffness</a>, <a href="../symbols/ForceDirectedLayout.html#springLength" class="linkMethod">springLength</a>) divided by the distance between the vertexes. When the distance is less than the nominal length, the force pushes the vertexes apart; when the distance is greater, the force pulls them together. You can easily assign the spring length and stiffness for all edges by assigning <a href="../symbols/ForceDirectedLayout.html#defaultSpringLength" class="linkProperty">defaultSpringLength</a> and <a href="../symbols/ForceDirectedLayout.html#defaultSpringStiffness" class="linkProperty">defaultSpringStiffness</a>. <p> When the distance between two vertexes is less than one unit, this uses a random number generator to decide which direction the forces should go. For layouts that start with all of the vertexes at the same location, this results in potentially dramatically different results. Set <a href="../symbols/ForceDirectedLayout.html#randomNumberGenerator" class="linkProperty">randomNumberGenerator</a> to null in order to produce reproducible results given the same initial vertex locations. <p> The algorithm seeks a configuration of the bodies with locally minimal energy, i.e. vertex positions such that the sum of the forces on each vertex is zero. This is achieved by repeatedly computing the forces on each vertex, moving them, and repeating. Computations stop when no vertex moves more than <a href="../symbols/ForceDirectedLayout.html#epsilonDistance" class="linkProperty">epsilonDistance</a> or when <a href="../symbols/ForceDirectedLayout.html#maxIterations" class="linkProperty">maxIterations</a> have happened. <p> The layout cannot guarantee that it provides optimal positioning of nodes. Nodes will normally not overlap each other, but when there is a dense interconnectivity overlaps might not be avoidable. <p class="boxrun"> If you want to experiment interactively with most of the properties, try the <a href="../../samples/fdLayout.html">Force Directed Layout</a> sample. See samples that make use of ForceDirectedLayout in the <a href="../../samples/index.html#forcedirectedlayout">samples index</a>. <p> This layout makes use of a <a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a> of <a href="../symbols/ForceDirectedVertex.html" class="linkConstructor">ForceDirectedVertex</a>es and <a href="../symbols/ForceDirectedEdge.html" class="linkConstructor">ForceDirectedEdge</a>s that normally correspond to the <a href="../symbols/Node.html" class="linkConstructor">Node</a>s and <a href="../symbols/Link.html" class="linkConstructor">Link</a>s of the <a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a>. </p> <!-- ============================== constructor summary ==================== --> <h2 id="constructor" class="summaryCaption"> Constructor <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the constructor documented in the class ForceDirectedLayout."> <thead> <tr> <th scope="col" class="name">Name</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr> <td class="name" > <div class="name"> ForceDirectedLayout() </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Constructs a <a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a> with no <a href="../symbols/Layout.html#network" class="linkProperty">Layout.network</a> and with no owning <a href="../symbols/Layout.html#diagram" class="linkProperty">Layout.diagram</a>. </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <!-- ============================== properties summary ===================== --> <h2 class="summaryCaption">Properties<span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the properties documented in the class ForceDirectedLayout."> <thead> <tr> <th scope="col" class="name">Name, Value Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="arrangementSpacing" > <td class="name"> <div class="name"> arrangementSpacing </div> <div class="attributes"> <span class="light">{<a href="../symbols/Size.html" class="linkConstructor">Size</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the space between which the layout will position the connected graphs that together compose the network.<span class="nodetails" id="xproparrangementSpacing"><a class="morelink" onclick="hst('proparrangementSpacing')">More...</a></span> <span class="details" id="proparrangementSpacing"> This defaults to Size(100, 100). These distances are used during a clustered layout; afterwards the normal force-directed layout will likely cause the size of any space between connected graphs to change, perhaps considerably.</span> </div> </td> </tr> <tr id="arrangesToOrigin" > <td class="name"> <div class="name"> arrangesToOrigin </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets whether <a href="../symbols/ForceDirectedLayout.html#commitNodes" class="linkMethod">commitNodes</a> should move all of the nodes so that the nodes all fit with the top-left corner at the <a href="../symbols/Layout.html#arrangementOrigin" class="linkProperty">Layout.arrangementOrigin</a>.<span class="nodetails" id="xproparrangesToOrigin"><a class="morelink" onclick="hst('proparrangesToOrigin')">More...</a></span> <span class="details" id="proparrangesToOrigin"> By default this is false -- the <a href="../symbols/Layout.html#arrangementOrigin" class="linkProperty">Layout.arrangementOrigin</a> is ignored. When this is true, nodes are moved even though <a href="../symbols/ForceDirectedLayout.html#isFixed" class="linkMethod">isFixed</a> was true.</span> </div> </td> </tr> <tr id="comments" > <td class="name"> <div class="name"> comments </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets whether this layout should find all <a href="../symbols/Node.html" class="linkConstructor">Node</a>s whose category is "Comment" and whose anchors are nodes represented in the network, and add <a href="../symbols/ForceDirectedVertex.html" class="linkConstructor">ForceDirectedVertex</a>es representing those balloon comments as nodes in the network.<span class="nodetails" id="xpropcomments"><a class="morelink" onclick="hst('propcomments')">More...</a></span> <span class="details" id="propcomments"> The default value is false.</span> </div> </td> </tr> <tr id="currentIteration" > <td class="name"> <div class="name"> currentIteration </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>This read-only property returns the current iteration count, valid during a call to <a href="../symbols/ForceDirectedLayout.html#doLayout" class="linkMethod">doLayout</a>. </div> </td> </tr> <tr id="defaultCommentElectricalCharge" > <td class="name"> <div class="name"> defaultCommentElectricalCharge </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#electricalCharge" class="linkMethod">electricalCharge</a>.<span class="nodetails" id="xpropdefaultCommentElectricalCharge"><a class="morelink" onclick="hst('propdefaultCommentElectricalCharge')">More...</a></span> <span class="details" id="propdefaultCommentElectricalCharge"> The initial value is 5.</span> </div> </td> </tr> <tr id="defaultCommentSpringLength" > <td class="name"> <div class="name"> defaultCommentSpringLength </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#springLength" class="linkMethod">springLength</a>.<span class="nodetails" id="xpropdefaultCommentSpringLength"><a class="morelink" onclick="hst('propdefaultCommentSpringLength')">More...</a></span> <span class="details" id="propdefaultCommentSpringLength"> The initial value is 10.</span> </div> </td> </tr> <tr id="defaultElectricalCharge" > <td class="name"> <div class="name"> defaultElectricalCharge </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#electricalCharge" class="linkMethod">electricalCharge</a>.<span class="nodetails" id="xpropdefaultElectricalCharge"><a class="morelink" onclick="hst('propdefaultElectricalCharge')">More...</a></span> <span class="details" id="propdefaultElectricalCharge"> The initial value is 150.</span> </div> </td> </tr> <tr id="defaultGravitationalMass" > <td class="name"> <div class="name"> defaultGravitationalMass </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#gravitationalMass" class="linkMethod">gravitationalMass</a>.<span class="nodetails" id="xpropdefaultGravitationalMass"><a class="morelink" onclick="hst('propdefaultGravitationalMass')">More...</a></span> <span class="details" id="propdefaultGravitationalMass"> The initial value is zero.</span> </div> </td> </tr> <tr id="defaultSpringLength" > <td class="name"> <div class="name"> defaultSpringLength </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#springLength" class="linkMethod">springLength</a>.<span class="nodetails" id="xpropdefaultSpringLength"><a class="morelink" onclick="hst('propdefaultSpringLength')">More...</a></span> <span class="details" id="propdefaultSpringLength"> The initial value is 50.</span> </div> </td> </tr> <tr id="defaultSpringStiffness" > <td class="name"> <div class="name"> defaultSpringStiffness </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default value computed by <a href="../symbols/ForceDirectedLayout.html#springStiffness" class="linkMethod">springStiffness</a>.<span class="nodetails" id="xpropdefaultSpringStiffness"><a class="morelink" onclick="hst('propdefaultSpringStiffness')">More...</a></span> <span class="details" id="propdefaultSpringStiffness"> The initial value is 0.05.</span> </div> </td> </tr> <tr id="epsilonDistance" > <td class="name"> <div class="name"> epsilonDistance </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets approximately how far a node must move in order for the iterations to continue.<span class="nodetails" id="xpropepsilonDistance"><a class="morelink" onclick="hst('propepsilonDistance')">More...</a></span> <span class="details" id="propepsilonDistance"> The default value is 1. The value must be larger than zero.</span> </div> </td> </tr> <tr id="infinityDistance" > <td class="name"> <div class="name"> infinityDistance </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets a threshold for the distance beyond which the electrical charge forces may be ignored.<span class="nodetails" id="xpropinfinityDistance"><a class="morelink" onclick="hst('propinfinityDistance')">More...</a></span> <span class="details" id="propinfinityDistance"> The default value is 1000. The value must be larger than 1.</span> </div> </td> </tr> <tr id="maxIterations" > <td class="name"> <div class="name"> maxIterations </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the maximum number of iterations to perform when doing the force-directed auto layout.<span class="nodetails" id="xpropmaxIterations"><a class="morelink" onclick="hst('propmaxIterations')">More...</a></span> <span class="details" id="propmaxIterations"> The value must be non-negative. The default value is 100.</span> </div> </td> </tr> <tr id="moveLimit" > <td class="name"> <div class="name"> moveLimit </div> <div class="attributes"> <span class="light">{number}</span> <span class="since" title="since">1.8</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets how far a vertex may be moved in an iteration.<span class="nodetails" id="xpropmoveLimit"><a class="morelink" onclick="hst('propmoveLimit')">More...</a></span> <span class="details" id="propmoveLimit"> The default value is 10. The value must be larger than 1.</span> </div> </td> </tr> <tr id="randomNumberGenerator" > <td class="name"> <div class="name"> randomNumberGenerator </div> <div class="attributes"> <span class="light">{Object}</span> <span class="since" title="since">1.5</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets a random number generator.<span class="nodetails" id="xproprandomNumberGenerator"><a class="morelink" onclick="hst('proprandomNumberGenerator')">More...</a></span> <span class="details" id="proprandomNumberGenerator"> The default value is Math, which results in calling Math.random(). Change this to null in order to use an instance of an internal repeatable pseudo-random number generator, which will become the new value of this property. </span><div class="details" id="dproprandomNumberGenerator"><p> The new value must be either null or an Object with a method named "random" taking zero arguments and returning a random number between zero (inclusive) and one (exclusive).</div> </div> </td> </tr> <tr id="setsPortSpots" > <td class="name"> <div class="name"> setsPortSpots </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets whether the fromSpot and the toSpot of every <a href="../symbols/Link.html" class="linkConstructor">Link</a> should be set to <a href="../symbols/Spot.html#Default" class="linkConstant">Spot.Default</a>.<span class="nodetails" id="xpropsetsPortSpots"><a class="morelink" onclick="hst('propsetsPortSpots')">More...</a></span> <span class="details" id="propsetsPortSpots"> The default value is true.</span> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <dl class="inheritsList"> <dt>Properties borrowed from class <a href="../symbols/Layout.html" class="linkConstructor">Layout</a>: </dt><dd><a href="../symbols/Layout.html#arrangementOrigin" class="linkProperty">arrangementOrigin</a>, <a href="../symbols/Layout.html#diagram" class="linkProperty">diagram</a>, <a href="../symbols/Layout.html#group" class="linkProperty">group</a>, <a href="../symbols/Layout.html#isInitial" class="linkProperty">isInitial</a>, <a href="../symbols/Layout.html#isOngoing" class="linkProperty">isOngoing</a>, <a href="../symbols/Layout.html#isRealtime" class="linkProperty">isRealtime</a>, <a href="../symbols/Layout.html#isRouting" class="linkProperty">isRouting</a>, <a href="../symbols/Layout.html#isValidLayout" class="linkProperty">isValidLayout</a>, <a href="../symbols/Layout.html#isViewportSized" class="linkProperty">isViewportSized</a>, <a href="../symbols/Layout.html#network" class="linkProperty">network</a></dd> </dl> <!-- ============================== methods summary ======================== --> <h2 class="summaryCaption">Method <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the methods documented in the class ForceDirectedLayout."> <thead> <tr> <th scope="col" class="name">Name, Return Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="addComments"> <td class="name"> <div class="name"> addComments(v) </div> <div class="attributes"> <span class="since" title="since">1.3</span> </div> </td> <td class="description"> <div class="description"> <!--newp-->