Commit 32185ab9 authored by Romain Loth's avatar Romain Loth

workaround for tw bug when nodes > 1000

parent adb2513a
...@@ -394,7 +394,8 @@ var ForceAtlas2 = function(graph) { ...@@ -394,7 +394,8 @@ var ForceAtlas2 = function(graph) {
this.p.jitterTolerance = 0.1; this.p.jitterTolerance = 0.1;
} }
if (graph.nodes.length >= 1000) { if (graph.nodes.length >= 1000) {
this.p.barnesHutOptimize = true; // can't use barnesHutOptimize because buildSubRegions is broken
this.p.barnesHutOptimize = false;
} else { } else {
this.p.barnesHutOptimize = false; this.p.barnesHutOptimize = false;
} }
...@@ -846,7 +847,8 @@ var ForceAtlas2 = function(graph) { ...@@ -846,7 +847,8 @@ var ForceAtlas2 = function(graph) {
}; };
// TODO "this" is undefined here => can't barnesHut
// ( pass as argument this_graph = ForceAtlas2.this)
var updateMassAndGeometry = function() { var updateMassAndGeometry = function() {
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
// Compute Mass // Compute Mass
...@@ -899,6 +901,9 @@ var Region = function(nodes, depth) { ...@@ -899,6 +901,9 @@ var Region = function(nodes, depth) {
} }
// TODO "this" is undefined here => can't barnesHut
// ( pass as argument this_graph = ForceAtlas2.this)
var buildSubRegions = function() { var buildSubRegions = function() {
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
var leftNodes = []; var leftNodes = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment