Browse Source

fixed typo's in example 29, fixed group id 0 not used

v3_develop
Alex de Mulder 10 years ago
parent
commit
22a76cf2e3
4 changed files with 4142 additions and 4335 deletions
  1. +4136
    -4329
      dist/vis.js
  2. +1
    -1
      dist/vis.min.css
  3. +3
    -3
      examples/network/29_neighbourhood_highlight.html
  4. +2
    -2
      lib/network/Node.js

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


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


+ 3
- 3
examples/network/29_neighbourhood_highlight.html View File

@ -10073,13 +10073,13 @@ function onClick(selectedItems) {
else {
var allEdges = edges.get();
// we clear the level of seperation in all nodes.
// we clear the level of separation in all nodes.
clearLevelOfSeperation(allNodes);
// we will now start to collect all the connected nodes we want to highlight.
var connectedNodes = selectedItems.nodes;
// we can store them into levels of seperation and we could then later use this to define a color per level
// we can store them into levels of separation and we could then later use this to define a color per level
// any data can be added to a node, this is just stored in the nodeObject.
storeLevelOfSeperation(connectedNodes,0, allNodes);
for (var i = 1; i < degrees + 1; i++) {
@ -10126,7 +10126,7 @@ function onClick(selectedItems) {
/**
* update the allNodes object with the level of seperation.
* update the allNodes object with the level of separation.
* Arrays are passed by reference, we do not need to return them because we are working in the same object.
*/
function storeLevelOfSeperation(connectedNodes, level, allNodes) {

+ 2
- 2
lib/network/Node.js View File

@ -157,9 +157,9 @@ Node.prototype.setProperties = function(properties, constants) {
if (this.id === undefined) {
throw "Node must have an id";
}
// console.log(this.options);
// copy group properties
if (this.options.group !== undefined && this.options.group != "") {
if (typeof this.options.group === 'number' || (typeof this.options.group === 'string' && this.options.group != '')) {
var groupObj = this.grouplist.get(this.options.group);
for (var prop in groupObj) {
if (groupObj.hasOwnProperty(prop)) {

Loading…
Cancel
Save