From ffa3be85dba0b081ba0bdee9ce0e53d65158fca5 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Mon, 16 Nov 2015 18:13:43 +0100 Subject: [PATCH] - Fixed #1408: Unclustering without release function respects fixed positions now. --- HISTORY.md | 1 + dist/vis.js | 8 +- lib/network/modules/Clustering.js | 4 +- test/networkTest.html | 1643 ++++++++++++++++++++++++++++- 4 files changed, 1627 insertions(+), 29 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index a5442b69..5f54a773 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -18,6 +18,7 @@ http://visjs.org - Fixed #1324: Labels now scale again. - Fixed #1362: Layout of hierarchicaly systems no longer overlaps NODES. - Fixed #1414: Fixed color references for nodes and edges. +- Fixed #1408: Unclustering without release function respects fixed positions now. ### Timeline diff --git a/dist/vis.js b/dist/vis.js index be0ee14d..06e61121 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -35765,8 +35765,12 @@ return /******/ (function(modules) { // webpackBootstrap var containedNode = this.body.nodes[nodeId]; containedNode = containedNodes[nodeId]; // inherit position - containedNode.x = clusterNode.x; - containedNode.y = clusterNode.y; + if (containedNode.options.fixed.x === false) { + containedNode.x = clusterNode.x; + } + if (containedNode.options.fixed.y === false) { + containedNode.y = clusterNode.y; + } } } } diff --git a/lib/network/modules/Clustering.js b/lib/network/modules/Clustering.js index def96b52..e0379729 100644 --- a/lib/network/modules/Clustering.js +++ b/lib/network/modules/Clustering.js @@ -567,8 +567,8 @@ class ClusterEngine { let containedNode = this.body.nodes[nodeId]; containedNode = containedNodes[nodeId]; // inherit position - containedNode.x = clusterNode.x; - containedNode.y = clusterNode.y; + if (containedNode.options.fixed.x === false) {containedNode.x = clusterNode.x;} + if (containedNode.options.fixed.y === false) {containedNode.y = clusterNode.y;} } } } diff --git a/test/networkTest.html b/test/networkTest.html index c24aeb81..1d93d2ca 100644 --- a/test/networkTest.html +++ b/test/networkTest.html @@ -13,35 +13,1628 @@ -
-