Browse Source

debugging a bit

flowchartTest
Alex de Mulder 9 years ago
parent
commit
efd876dba8
6 changed files with 10654 additions and 10639 deletions
  1. +10628
    -10623
      dist/vis.js
  2. +2
    -3
      examples/network/01_basic_usage.html
  3. +0
    -1
      lib/network/modules/EdgesHandler.js
  4. +13
    -5
      lib/network/modules/Validator.js
  5. +8
    -5
      lib/network/modules/components/AllOptions.js
  6. +3
    -2
      lib/network/modules/components/Node.js

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


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

@ -44,9 +44,8 @@
edges: edges
};
var options = {
manipulation: 'hello',
physics:{barnesHut:{gravitationslPull:34}, solver:'banana'},
groups:{'bla':{color:{backsground:'red'}, borderWidth:5}}
nodes:{title:undefined},edges:{hoverWidth:function(a) {return a;}},
configuration:{container:container}
}
var network = new vis.Network(container, data, options);
// network.setOptions({nodes:{color:'red'}})

+ 0
- 1
lib/network/modules/EdgesHandler.js View File

@ -139,7 +139,6 @@ class EdgesHandler {
setOptions(options) {
if (options !== undefined) {
console.log('edge',options)
// use the parser from the Edge class to fill in all shorthand notations
Edge.parseOptions(this.options, options);

+ 13
- 5
lib/network/modules/Validator.js View File

@ -93,18 +93,26 @@ class Validator {
' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". ' + Validator.printLocation(path, option), printStyle);
errorFound = true;
}
else if (recursive === true) {
else if (recursive === true && optionType === 'object') {
Validator.parse(options[option], referenceOptions[referenceOption], path);
}
}
else if (recursive === true) {
else if (recursive === true && optionType === 'object') {
Validator.parse(options[option], referenceOptions[referenceOption], path);
}
}
else {
// type of the field is incorrect
console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(referenceOptions[referenceOption].__type__)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle);
errorFound = true;
if (refOptionObj['undef'] !== undefined && optionType === 'undefined') {
// item is undefined, which is allowed
}
else if (refOptionObj['fn'] !== undefined && optionType === 'function') {
// item is a function, which is allowed
}
else {
// type of the field is incorrect
console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle);
errorFound = true;
}
}
}

+ 8
- 5
lib/network/modules/components/AllOptions.js View File

@ -1,6 +1,9 @@
/**
* __any__
* __type__
* This object contains all possible options. It will check if the types are correct, if required if the option is one
* of the allowed values.
*
* __any__ means that the name of the property does not matter.
* __type__ is a required field for all objects and contains the allowed types of all objects
*/
let string = 'string';
let boolean = 'boolean';
@ -57,7 +60,7 @@ let allOptions = {
stroke: {number}, // px
strokeColor: {string},
align: {string:['horizontal','top','middle','bottom']},
__type__: {object}
__type__: {object,string}
},
hidden: {boolean},
hoverWidth: {fn,number},
@ -120,7 +123,7 @@ let allOptions = {
__type__: {object}
},
layout: {
randomSeed: undefined,
randomSeed: {undef,number},
hierarchical: {
enabled: {boolean},
levelSeparation: {number},
@ -187,7 +190,7 @@ let allOptions = {
background: {string},
stroke: {number}, // px
strokeColor: {string},
__type__: {object}
__type__: {object,string}
},
group: {string,number,undef},
hidden: {boolean},

+ 3
- 2
lib/network/modules/components/Node.js View File

@ -161,9 +161,10 @@ class Node {
*/
static parseOptions(parentOptions, newOptions) {
var fields = [
'shadow',
'color',
'fixed'
'fixed',
'font',
'shadow'
];
util.selectiveNotDeepExtend(fields, parentOptions, newOptions);

Loading…
Cancel
Save