From 349017cf8554ee0d21d2d8a2cf046da286dabc8f Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Fri, 20 Nov 2015 12:45:39 +0100 Subject: [PATCH] - Fixed #1416: Fixed error in improvedLayout. --- HISTORY.md | 2 + dist/vis.js | 6 +- lib/network/modules/components/Node.js | 2 - .../components/algorithms/FloydWarshall.js | 3 +- test/networkTest.html | 4207 ++++++++++------- 5 files changed, 2582 insertions(+), 1638 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 57496241..03ece476 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -20,6 +20,8 @@ http://visjs.org - Fixed #1414: Fixed color references for nodes and edges. - Fixed #1408: Unclustering without release function respects fixed positions now. - Fixed #1358: Fixed example for clustering on zoom. +- Fixed #1416: Fixed error in improvedLayout. + ### Timeline diff --git a/dist/vis.js b/dist/vis.js index faa62881..0945606e 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -5,7 +5,7 @@ * A dynamic, browser-based visualization library. * * @version 4.9.1-SNAPSHOT - * @date 2015-11-16 + * @date 2015-11-20 * * @license * Copyright (C) 2011-2015 Almende B.V, http://almende.com @@ -41954,8 +41954,8 @@ return /******/ (function(modules) { // webpackBootstrap // put the weights for the edges in. This assumes unidirectionality. for (var i = 0; i < edgesArray.length; i++) { var edge = edges[edgesArray[i]]; - if (edge.connected === true) { - // edge has to be connected if it counts to the distances. + // edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix + if (edge.connected === true && D_matrix[edge.fromId] !== undefined && D_matrix[edge.toId] !== undefined) { D_matrix[edge.fromId][edge.toId] = 1; D_matrix[edge.toId][edge.fromId] = 1; } diff --git a/lib/network/modules/components/Node.js b/lib/network/modules/components/Node.js index 37bdedd2..969d1c12 100644 --- a/lib/network/modules/components/Node.js +++ b/lib/network/modules/components/Node.js @@ -126,7 +126,6 @@ class Node { if (options.size !== undefined) {this.baseSize = options.size;} if (options.value !== undefined) {options.value = parseFloat(options.value);} - // copy group options if (typeof options.group === 'number' || (typeof options.group === 'string' && options.group != '')) { var groupObj = this.grouplist.get(options.group); @@ -151,7 +150,6 @@ class Node { this.updateLabelModule(); this.updateShape(currentShape); - if (options.hidden !== undefined || options.physics !== undefined) { return true; } diff --git a/lib/network/modules/components/algorithms/FloydWarshall.js b/lib/network/modules/components/algorithms/FloydWarshall.js index b3851d65..e0d3f92d 100644 --- a/lib/network/modules/components/algorithms/FloydWarshall.js +++ b/lib/network/modules/components/algorithms/FloydWarshall.js @@ -23,7 +23,8 @@ class FloydWarshall { // put the weights for the edges in. This assumes unidirectionality. for (let i = 0; i < edgesArray.length; i++) { let edge = edges[edgesArray[i]]; - if (edge.connected === true) { // edge has to be connected if it counts to the distances. + // edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix + if (edge.connected === true && D_matrix[edge.fromId] !== undefined && D_matrix[edge.toId] !== undefined) { D_matrix[edge.fromId][edge.toId] = 1; D_matrix[edge.toId][edge.fromId] = 1; } diff --git a/test/networkTest.html b/test/networkTest.html index 1d93d2ca..7ab14016 100644 --- a/test/networkTest.html +++ b/test/networkTest.html @@ -1,1641 +1,2584 @@ - + - - - - + + + + - -
+ + + +
+ + - + \ No newline at end of file