Browse Source

fixed small bug

flowchartTest
Alex de Mulder 9 years ago
parent
commit
a2fd26e2f6
4 changed files with 2915 additions and 2932 deletions
  1. +2909
    -2925
      dist/vis.js
  2. +1
    -1
      dist/vis.min.css
  3. +3
    -4
      lib/network/modules/Clustering.js
  4. +2
    -2
      test/network_unittests.html

+ 2909
- 2925
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.min.css
File diff suppressed because it is too large
View File


+ 3
- 4
lib/network/modules/Clustering.js View File

@ -304,7 +304,6 @@ class ClusterEngine {
* @private * @private
*/ */
_cluster(childNodesObj, childEdgesObj, options, refreshData = true) { _cluster(childNodesObj, childEdgesObj, options, refreshData = true) {
console.log(childNodesObj)
// kill condition: no children so cant cluster // kill condition: no children so cant cluster
if (Object.keys(childNodesObj).length === 0) {return;} if (Object.keys(childNodesObj).length === 0) {return;}
@ -457,8 +456,8 @@ class ClusterEngine {
*/ */
openCluster(clusterNodeId, options, refreshData = true) { openCluster(clusterNodeId, options, refreshData = true) {
// kill conditions // kill conditions
if (clusterNodeId === undefined) {throw new Error("No clusterNodeId supplied to openCluster.");}
if (this.body.nodes[clusterNodeId] === undefined) {throw new Error("The clusterNodeId supplied to openCluster does not exist.");}
if (clusterNodeId === undefined) {throw new Error("No clusterNodeId supplied to openCluster.");}
if (this.body.nodes[clusterNodeId] === undefined) {throw new Error("The clusterNodeId supplied to openCluster does not exist.");}
if (this.body.nodes[clusterNodeId].containedNodes === undefined) { if (this.body.nodes[clusterNodeId].containedNodes === undefined) {
console.log("The node:" + clusterNodeId + " is not a cluster."); console.log("The node:" + clusterNodeId + " is not a cluster.");
return return
@ -468,7 +467,7 @@ class ClusterEngine {
let containedEdges = clusterNode.containedEdges; let containedEdges = clusterNode.containedEdges;
// allow the user to position the nodes after release. // allow the user to position the nodes after release.
if (options.releaseFunction !== undefined) {
if (options !== undefined && options.releaseFunction !== undefined && typeof options.releaseFunction === 'function') {
let positions = {}; let positions = {};
let clusterPosition = {x:clusterNode.x, y:clusterNode.y}; let clusterPosition = {x:clusterNode.x, y:clusterNode.y};
for (let nodeId in containedNodes) { for (let nodeId in containedNodes) {

+ 2
- 2
test/network_unittests.html View File

@ -175,11 +175,11 @@
var amountOfOptionChecks = 600;
var amountOfOptionChecks = 1;
var optionCheckTime = 150; var optionCheckTime = 150;
var optionsThreshold = 0.8; var optionsThreshold = 0.8;
function checkOptions(i) { function checkOptions(i) {
console.log('checking Options iteration:',i)
// console.log('checking Options iteration:',i)
var allOptions = vis.network.allOptions.allOptions; var allOptions = vis.network.allOptions.allOptions;
var testOptions = {}; var testOptions = {};
constructOptions(allOptions, testOptions); constructOptions(allOptions, testOptions);

Loading…
Cancel
Save