File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ Layout.ForceDirected = function(graph, options) {
50
50
var repulsion_constant ;
51
51
var forceConstant ;
52
52
var layout_iterations = 0 ;
53
- var max_iterations = options . iterations || 10000 ;
53
+ var max_iterations = options . iterations || 1000 ;
54
54
var temperature = 0 ;
55
55
var graph = graph ;
56
56
var width = options . width || 200 ;
@@ -105,9 +105,7 @@ Layout.ForceDirected = function(graph, options) {
105
105
if ( layout === "3d" ) {
106
106
node_v . layout . tmp_pos_z = node_v . layout . tmp_pos_z || node_v . position . z ;
107
107
}
108
-
109
-
110
-
108
+
111
109
graph . nodes . forEach ( function ( node_u ) {
112
110
if ( node_v . id != node_u . id ) {
113
111
node_u . layout = node_u . layout || { } ;
@@ -192,7 +190,7 @@ Layout.ForceDirected = function(graph, options) {
192
190
node . layout . tmp_pos_z += ( node . layout . offset_z / delta_length_z ) * Math . min ( delta_length_z , temperature ) ;
193
191
}
194
192
195
- var c = 100 ;
193
+ var c = 200 ;
196
194
var updated = false ;
197
195
if ( node . position . x < ( node . layout . tmp_pos_x - c ) || node . position . x > ( node . layout . tmp_pos_x + c ) ) {
198
196
node . position . x -= ( node . position . x - node . layout . tmp_pos_x ) / 10 ;
You can’t perform that action at this time.
0 commit comments