Browse Source

graph: fixed bug with empty nodeset hierarchical layout #145

css_transitions
Alex de Mulder 10 years ago
parent
commit
52a6961d01
4 changed files with 12 additions and 8 deletions
  1. +4
    -0
      HISTORY.md
  2. +2
    -2
      dist/vis.js
  3. +5
    -5
      dist/vis.min.js
  4. +1
    -1
      src/graph/graphMixins/HierarchicalLayoutMixin.js

+ 4
- 0
HISTORY.md View File

@ -9,6 +9,10 @@ http://visjs.org
- Fixed `Timeline.clear()` not resetting a configured `options.start` and
`options.end`.
### Graph
- Fixed error with zero nodes with hierarchical layout.
## 2014-05-28, version 1.0.2

+ 2
- 2
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 1.0.3-SNAPSHOT
* @date 2014-05-28
* @date 2014-06-02
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -12271,7 +12271,7 @@ var HierarchicalLayoutMixin = {
* @private
*/
_setupHierarchicalLayout : function() {
if (this.constants.hierarchicalLayout.enabled == true) {
if (this.constants.hierarchicalLayout.enabled == true && this.nodeIndices.length > 0) {
if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "DU") {
this.constants.hierarchicalLayout.levelSeparation *= -1;
}

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


+ 1
- 1
src/graph/graphMixins/HierarchicalLayoutMixin.js View File

@ -20,7 +20,7 @@ var HierarchicalLayoutMixin = {
* @private
*/
_setupHierarchicalLayout : function() {
if (this.constants.hierarchicalLayout.enabled == true) {
if (this.constants.hierarchicalLayout.enabled == true && this.nodeIndices.length > 0) {
if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "DU") {
this.constants.hierarchicalLayout.levelSeparation *= -1;
}

Loading…
Cancel
Save