Skip to content

Commit fc94b08

Browse files
committed
Changed default values.
1 parent aa63975 commit fc94b08

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

layouts/force-based-layout.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Layout.ForceDirected = function(graph, options) {
5050
var repulsion_constant;
5151
var forceConstant;
5252
var layout_iterations = 0;
53-
var max_iterations = options.iterations || 10000;
53+
var max_iterations = options.iterations || 1000;
5454
var temperature = 0;
5555
var graph = graph;
5656
var width = options.width || 200;
@@ -105,9 +105,7 @@ Layout.ForceDirected = function(graph, options) {
105105
if(layout === "3d") {
106106
node_v.layout.tmp_pos_z = node_v.layout.tmp_pos_z || node_v.position.z;
107107
}
108-
109-
110-
108+
111109
graph.nodes.forEach(function(node_u) {
112110
if(node_v.id != node_u.id) {
113111
node_u.layout = node_u.layout || {};
@@ -192,7 +190,7 @@ Layout.ForceDirected = function(graph, options) {
192190
node.layout.tmp_pos_z += (node.layout.offset_z / delta_length_z) * Math.min(delta_length_z, temperature);
193191
}
194192

195-
var c = 100;
193+
var c = 200;
196194
var updated = false;
197195
if(node.position.x < (node.layout.tmp_pos_x - c) || node.position.x > (node.layout.tmp_pos_x + c)) {
198196
node.position.x -= (node.position.x-node.layout.tmp_pos_x)/10;

0 commit comments

Comments
 (0)