diff --git a/HISTORY.md b/HISTORY.md index 6272ccf0..a13f64b0 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,7 @@ http://visjs.org ### Network - Fixed #1531 , #1335: border distances for arrow positioning +- Fixed findNode method. It now does not return internal objects anymore. ## 2015-12-18, version 4.11.0 diff --git a/dist/vis.js b/dist/vis.js index fc1c0b3a..ddddec10 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -36479,11 +36479,11 @@ return /******/ (function(modules) { // webpackBootstrap var counter = 0; while (this.clusteredNodes[nodeId] !== undefined && counter < max) { - stack.push(this.clusteredNodes[nodeId].node); + stack.push(nodeId); nodeId = this.clusteredNodes[nodeId].clusterId; counter++; } - stack.push(this.body.nodes[nodeId]); + stack.push(nodeId); return stack; } diff --git a/examples/network/other/clustering.html b/examples/network/other/clustering.html index 30b745ef..2f2eb8eb 100644 --- a/examples/network/other/clustering.html +++ b/examples/network/other/clustering.html @@ -80,7 +80,7 @@ Click any of the buttons below to cluster the network. On every push the network network.openCluster(params.nodes[0]); } } - }) + }); function clusterByCid() { network.setData(data); @@ -89,7 +89,7 @@ Click any of the buttons below to cluster the network. On every push the network return childOptions.cid == 1; }, clusterNodeProperties: {id:'cidCluster', borderWidth:3, shape:'database'} - } + }; network.cluster(clusterOptionsByData); } function clusterByColor() { @@ -111,7 +111,7 @@ Click any of the buttons below to cluster the network. On every push the network return clusterOptions; }, clusterNodeProperties: {id: 'cluster:' + color, borderWidth: 3, shape: 'database', color:color, label:'color:' + color} - } + }; network.cluster(clusterOptionsByData); } } @@ -131,7 +131,7 @@ Click any of the buttons below to cluster the network. On every push the network return clusterOptions; }, clusterNodeProperties: {borderWidth:3, shape:'box', font:{size:30}} - } + }; network.clusterByHubsize(undefined, clusterOptionsByData); } diff --git a/lib/network/modules/Clustering.js b/lib/network/modules/Clustering.js index 6c706dba..7ef1e970 100644 --- a/lib/network/modules/Clustering.js +++ b/lib/network/modules/Clustering.js @@ -672,11 +672,11 @@ class ClusterEngine { let counter = 0; while (this.clusteredNodes[nodeId] !== undefined && counter < max) { - stack.push(this.clusteredNodes[nodeId].node); + stack.push(nodeId); nodeId = this.clusteredNodes[nodeId].clusterId; counter++; } - stack.push(this.body.nodes[nodeId]); + stack.push(nodeId); return stack; }