From a7ca47527aa3f74795598ae7a0bed4e2122cda06 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Wed, 23 Apr 2014 16:25:16 +0200 Subject: [PATCH] added update hierarchical layout to update nodes event per #101 --- dist/vis.js | 14 +++++++------- src/graph/Graph.js | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index 4ab8b824..253cd560 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version @@version - * @date @@date + * @version 0.7.4-SNAPSHOT + * @date 2014-04-23 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com @@ -16776,7 +16776,6 @@ Graph.prototype._create = function () { this.frame.className = 'graph-frame'; this.frame.style.position = 'relative'; this.frame.style.overflow = 'hidden'; - this.frame.style.zIndex = "1"; // create the graph canvas (HTML canvas element) this.frame.canvas = document.createElement( 'canvas' ); @@ -17399,12 +17398,13 @@ Graph.prototype._updateNodes = function(ids) { // create node node = new Node(properties, this.images, this.groups, this.constants); nodes[id] = node; - - if (!node.isFixed()) { - this.moving = true; - } } } + this.moving = true; + if (this.constants.hierarchicalLayout.enabled == true && this.initializing == false) { + this._resetLevels(); + this._setupHierarchicalLayout(); + } this._updateNodeIndexList(); this._reconnectEdges(); this._updateValueRange(nodes); diff --git a/src/graph/Graph.js b/src/graph/Graph.js index a9d68a0b..db8d6917 100644 --- a/src/graph/Graph.js +++ b/src/graph/Graph.js @@ -1359,12 +1359,13 @@ Graph.prototype._updateNodes = function(ids) { // create node node = new Node(properties, this.images, this.groups, this.constants); nodes[id] = node; - - if (!node.isFixed()) { - this.moving = true; - } } } + this.moving = true; + if (this.constants.hierarchicalLayout.enabled == true && this.initializing == false) { + this._resetLevels(); + this._setupHierarchicalLayout(); + } this._updateNodeIndexList(); this._reconnectEdges(); this._updateValueRange(nodes);