diff --git a/dist/vis.js b/dist/vis.js
index 37d64779..4ae53c82 100644
--- a/dist/vis.js
+++ b/dist/vis.js
@@ -19396,7 +19396,9 @@ return /******/ (function(modules) { // webpackBootstrap
var localSearchThreshold = 8;
var globalSearchThreshold = 4;
- if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
+ if (localSearch.indexMatch !== undefined) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n', printStyle);
+ } else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch, ''), printStyle);
} else if (localSearch.distance <= localSearchThreshold) {
console.log('%cUnknown option detected: "' + option + '". Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option), printStyle);
@@ -19424,6 +19426,8 @@ return /******/ (function(modules) { // webpackBootstrap
var min = 1000000000;
var closestMatch = '';
var closestMatchPath = [];
+ var lowerCaseOption = option.toLowerCase();
+ var indexMatch = undefined;
for (var op in options) {
var type = Validator.getType(options[op]);
var distance = undefined;
@@ -19433,8 +19437,12 @@ return /******/ (function(modules) { // webpackBootstrap
closestMatch = result.closestMatch;
closestMatchPath = result.path;
min = result.distance;
+ indexMatch = result.indexMatch;
}
} else {
+ if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {
+ indexMatch = op;
+ }
distance = Validator.levenshteinDistance(option, op);
if (min > distance) {
closestMatch = op;
@@ -19443,7 +19451,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
}
- return { closestMatch: closestMatch, path: closestMatchPath, distance: min };
+ return { closestMatch: closestMatch, path: closestMatchPath, distance: min, indexMatch: indexMatch };
}
}, {
key: 'printLocation',
@@ -20949,7 +20957,7 @@ return /******/ (function(modules) { // webpackBootstrap
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function customScalingFunction(min, max, total, value) {
if (max === min) {
@@ -21407,7 +21415,7 @@ return /******/ (function(modules) { // webpackBootstrap
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function customScalingFunction(min, max, total, value) {
if (max === min) {
diff --git a/docs/network/edges.html b/docs/network/edges.html
index 18fcf9f3..2180da56 100644
--- a/docs/network/edges.html
+++ b/docs/network/edges.html
@@ -138,7 +138,7 @@ var options = {
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function (min,max,total,value) {
if (max === min) {
@@ -480,7 +480,7 @@ var options: {
scaling.label.drawThreshold
Number
-
6
+
5
When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
When using font scaling, you can use this together with the maxVisible to first show labels of important
edges when zoomed out and only show the rest when zooming in.
diff --git a/docs/network/nodes.html b/docs/network/nodes.html
index 4ae5ecba..bc153b8b 100644
--- a/docs/network/nodes.html
+++ b/docs/network/nodes.html
@@ -143,7 +143,7 @@ var options = {
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function (min,max,total,value) {
if (max === min) {
@@ -507,7 +507,7 @@ network.setOptions(options);
scaling.label.drawThreshold
Number
-
6
+
5
When zooming out, the font will be drawn smaller. This defines a lower limit for when the font is drawn.
When using font scaling, you can use this together with the maxVisible to first show labels of important
nodes when zoomed out and only show the rest when zooming in.
diff --git a/examples/network/categories/23_hierarchical_layout.html b/examples/network/categories/23_hierarchical_layout.html
deleted file mode 100644
index 39356149..00000000
--- a/examples/network/categories/23_hierarchical_layout.html
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
- Network | Hierarchical layout
-
-
-
-
-
-
-
-
-
-
-
-
Hierarchical Layout - Scale-Free-Network
-
- This example shows the randomly generated scale-free-network set of nodes and connected edges from example 2.
- In this example, hierarchical layout has been enabled and the vertical levels are determined automatically.
-
- This example demonstrates dynamically adding, updating and removing nodes
- and edges using a DataSet.
+ This example demonstrates dynamically adding, updating and removing nodes
+ and edges using a DataSet.
+ This example shows the randomly generated scale-free-network set of nodes and connected edges from example 2.
+ In this example, hierarchical layout has been enabled and the vertical levels are determined automatically.
+
+ Create a simple network with some nodes and edges but with a fixed seed. This means the layout will be the same every time the nodes
+ are settled.
+
+
+
+
+
+
+
+
+
diff --git a/lib/network/modules/EdgesHandler.js b/lib/network/modules/EdgesHandler.js
index 0ecb2587..e63cadaa 100644
--- a/lib/network/modules/EdgesHandler.js
+++ b/lib/network/modules/EdgesHandler.js
@@ -57,7 +57,7 @@ class EdgesHandler {
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function (min,max,total,value) {
if (max === min) {
diff --git a/lib/network/modules/NodesHandler.js b/lib/network/modules/NodesHandler.js
index 211c6413..87d62170 100644
--- a/lib/network/modules/NodesHandler.js
+++ b/lib/network/modules/NodesHandler.js
@@ -72,7 +72,7 @@ class NodesHandler {
min: 14,
max: 30,
maxVisible: 30,
- drawThreshold: 6
+ drawThreshold: 5
},
customScalingFunction: function (min,max,total,value) {
if (max === min) {
diff --git a/lib/shared/Validator.js b/lib/shared/Validator.js
index 57b1b2ab..5bbb2d5e 100644
--- a/lib/shared/Validator.js
+++ b/lib/shared/Validator.js
@@ -170,7 +170,10 @@ class Validator {
let localSearchThreshold = 8;
let globalSearchThreshold = 4;
- if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
+ if (localSearch.indexMatch !== undefined) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option,'') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n', printStyle);
+ }
+ else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option,'') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch,''), printStyle);
}
else if (localSearch.distance <= localSearchThreshold) {
@@ -196,6 +199,8 @@ class Validator {
let min = 1e9;
let closestMatch = '';
let closestMatchPath = [];
+ let lowerCaseOption = option.toLowerCase();
+ let indexMatch = undefined;
for (let op in options) {
let type = Validator.getType(options[op]);
let distance;
@@ -205,9 +210,13 @@ class Validator {
closestMatch = result.closestMatch;
closestMatchPath = result.path;
min = result.distance;
+ indexMatch = result.indexMatch;
}
}
else {
+ if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {
+ indexMatch = op;
+ }
distance = Validator.levenshteinDistance(option, op);
if (min > distance) {
closestMatch = op;
@@ -216,7 +225,7 @@ class Validator {
}
}
}
- return {closestMatch:closestMatch, path:closestMatchPath, distance:min}
+ return {closestMatch:closestMatch, path:closestMatchPath, distance:min, indexMatch: indexMatch}
}
static printLocation(path, option, prefix = 'Problem value found at: \n') {