Browse Source

cleaned up code a little

flowchartTest
Alex de Mulder 9 years ago
parent
commit
4b2cc60bba
2 changed files with 47 additions and 28 deletions
  1. +26
    -16
      dist/vis.js
  2. +21
    -12
      lib/network/modules/LayoutEngine.js

+ 26
- 16
dist/vis.js View File

@ -35258,6 +35258,30 @@ return /******/ (function(modules) { // webpackBootstrap
writable: true, writable: true,
configurable: true configurable: true
}, },
_getHubSize: {
/**
* Get the hubsize from all remaining unlevelled nodes.
*
* @returns {number}
* @private
*/
value: function _getHubSize() {
var hubSize = 0;
for (var nodeId in this.body.nodes) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
var node = this.body.nodes[nodeId];
if (this.hierarchicalLevels[nodeId] === undefined) {
hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
}
}
}
return hubSize;
},
writable: true,
configurable: true
},
_determineLevelsByHubsize: { _determineLevelsByHubsize: {
@ -35290,24 +35314,9 @@ return /******/ (function(modules) { // webpackBootstrap
writable: true, writable: true,
configurable: true configurable: true
}, },
_getHubSize: {
value: function _getHubSize() {
var hubSize = 0;
for (var nodeId in this.body.nodes) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
var node = this.body.nodes[nodeId];
if (this.hierarchicalLevels[nodeId] === undefined) {
hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
}
}
}
return hubSize;
},
writable: true,
configurable: true
},
_setLevel: { _setLevel: {
/** /**
* this function is called recursively to enumerate the barnches of the largest hubs and give each node a level. * this function is called recursively to enumerate the barnches of the largest hubs and give each node a level.
* *
@ -35375,6 +35384,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
_setLevelDirected: { _setLevelDirected: {
/** /**
* this function is called recursively to enumerate the branched of the first node and give each node a level based on edge direction * this function is called recursively to enumerate the branched of the first node and give each node a level based on edge direction
* *

+ 21
- 12
lib/network/modules/LayoutEngine.js View File

@ -226,6 +226,26 @@ class LayoutEngine {
} }
/**
* Get the hubsize from all remaining unlevelled nodes.
*
* @returns {number}
* @private
*/
_getHubSize() {
let hubSize = 0;
for (let nodeId in this.body.nodes) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
let node = this.body.nodes[nodeId];
if (this.hierarchicalLevels[nodeId] === undefined) {
hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
}
}
}
return hubSize;
}
/** /**
* this function allocates nodes in levels based on the recursive branching from the largest hubs. * this function allocates nodes in levels based on the recursive branching from the largest hubs.
* *
@ -253,18 +273,6 @@ class LayoutEngine {
} }
} }
_getHubSize() {
let hubSize = 0;
for (let nodeId in this.body.nodes) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
let node = this.body.nodes[nodeId];
if (this.hierarchicalLevels[nodeId] === undefined) {
hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
}
}
}
return hubSize;
}
/** /**
* this function is called recursively to enumerate the barnches of the largest hubs and give each node a level. * this function is called recursively to enumerate the barnches of the largest hubs and give each node a level.
@ -326,6 +334,7 @@ class LayoutEngine {
} }
} }
/** /**
* this function is called recursively to enumerate the branched of the first node and give each node a level based on edge direction * this function is called recursively to enumerate the branched of the first node and give each node a level based on edge direction
* *

Loading…
Cancel
Save