Browse Source

fix for sad labelless nodes

flowchartTest
Alex de Mulder 9 years ago
parent
commit
050e2daa7e
3 changed files with 1762 additions and 1757 deletions
  1. +1757
    -1754
      dist/vis.js
  2. +1
    -2
      examples/network/01_basic_usage.html
  3. +4
    -1
      lib/network/modules/components/Node.js

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


+ 1
- 2
examples/network/01_basic_usage.html View File

@ -23,7 +23,7 @@
{id: 1, label: 'Node 1', value:3, title:'hello world'},
{id: 2, label: 'Node 2', value:1, group:'bla'},
{id: 3, label: 'Node 3', value:5},
{id: 4, label: 'Node 4', value:3},
{id: 4, value:3},
{id: 5, label: 'Node 5', value:2}
];
@ -44,7 +44,6 @@
edges: edges
};
var options = {
configure:'nodes',
// physics:{barnesHut:{gravitationslPull:34}, solver:'banana'},
}
var network = new vis.Network(container, data, options);

+ 4
- 1
lib/network/modules/components/Node.js View File

@ -122,7 +122,7 @@ class Node {
if (options.x !== undefined) {this.x = parseInt(options.x); this.predefinedPosition = true;}
if (options.y !== undefined) {this.y = parseInt(options.y); this.predefinedPosition = true;}
if (options.size !== undefined) {this.baseSize = options.size;}
if (options.value !== undefined) {options.value = parseInt(options.value);}
if (options.value !== undefined) {options.value = parseInt(options.value);}
// this transforms all shorthands into fully defined options
Node.parseOptions(this.options,options);
@ -194,6 +194,9 @@ class Node {
}
updateLabelModule() {
if (this.options.label === undefined || this.options.label === null) {
this.options.label = '';
}
this.labelModule.setOptions(this.options);
if (this.labelModule.baseSize !== undefined) {
this.baseFontSize = this.labelModule.baseSize;

Loading…
Cancel
Save