From 6f5bc44eea7501dac2789e571e1baffdf3a84583 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Fri, 24 Apr 2015 17:18:17 +0200 Subject: [PATCH] docs, bugfixes --- dist/vis.js | 29 ++-- docs/css/newdocs.css | 10 +- docs/js/toggleTable.js | 27 ++++ docs/network/canvas.html | 9 +- docs/network/configure.html | 11 +- docs/network/edges.html | 133 ++++++++++++++++--- docs/network/groups.html | 44 +++--- docs/network/nodes.html | 6 + examples/network/01_basic_usage.html | 5 +- lib/network/modules/Validator.js | 25 ++-- lib/network/modules/components/AllOptions.js | 2 +- 11 files changed, 234 insertions(+), 67 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index 1ab29117..1fe38484 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -25980,16 +25980,16 @@ return /******/ (function(modules) { // webpackBootstrap // __any__ is a wildcard. Any value is accepted and will be further analysed by reference. if (Validator.getType(options[option]) === 'object') { util.copyAndExtendArray(path, option); - Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions.__any__.__type__, path, true); + Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions.__any__.__type__, path); } } else { // Since all options in the reference are objects, we can check whether they are supposed to be object to look for the __type__ field. if (referenceOptions[option].__type__ !== undefined) { util.copyAndExtendArray(path, option); // if this should be an object, we check if the correct type has been supplied to account for shorthand options. - Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option].__type__, path, true); + Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option].__type__, path); } else { - Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option], path, false); + Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option], path); } } } @@ -25998,15 +25998,14 @@ return /******/ (function(modules) { // webpackBootstrap /** * - * @param {String} option | the option property - * @param {Object} options | The supplied options object - * @param {Object} referenceOptions | The reference options containing all options and their allowed formats - * @param {String} referenceOption | Usually this is the same as option, except when handling an __any__ tag. - * @param {String} refOptionType | This is the type object from the reference options - * @param path - * @param recursive - */ - value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path, recursive) { + * @param {String} option | the option property + * @param {Object} options | The supplied options object + * @param {Object} referenceOptions | The reference options containing all options and their allowed formats + * @param {String} referenceOption | Usually this is the same as option, except when handling an __any__ tag. + * @param {String} refOptionType | This is the type object from the reference options + * @param {Array} path | where in the object is the option + */ + value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) { var optionType = Validator.getType(options[option]); var refOptionType = refOptionObj[optionType]; if (refOptionType !== undefined) { @@ -26015,10 +26014,10 @@ return /******/ (function(modules) { // webpackBootstrap if (refOptionType.indexOf(options[option]) === -1) { console.log('%cInvalid option detected in "' + option + '".' + ' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". ' + Validator.printLocation(path, option), printStyle); errorFound = true; - } else if (recursive === true && optionType === 'object') { + } else if (optionType === 'object') { Validator.parse(options[option], referenceOptions[referenceOption], path); } - } else if (recursive === true && optionType === 'object') { + } else if (optionType === 'object') { Validator.parse(options[option], referenceOptions[referenceOption], path); } } else { @@ -26212,7 +26211,7 @@ return /******/ (function(modules) { // webpackBootstrap __type__: { object: object } }, clustering: {}, - configuration: { + configure: { filter: { boolean: boolean, string: ['nodes', 'edges', 'layout', 'physics', 'manipulation', 'interaction', 'selection', 'rendering'], array: array }, container: { dom: dom }, __type__: { object: object, string: string, array: array, boolean: boolean } diff --git a/docs/css/newdocs.css b/docs/css/newdocs.css index 411493c5..122adb30 100644 --- a/docs/css/newdocs.css +++ b/docs/css/newdocs.css @@ -94,6 +94,10 @@ pre.code { border:0px; } +pre.top { + margin-left:20px; +} + tr.hidden { max-height:0; /*max-height: 0;*/ @@ -185,5 +189,9 @@ td.methodName { } pre.options { - max-width:500px; + max-width:600px; +} + +pre.hidden { + display:none; } \ No newline at end of file diff --git a/docs/js/toggleTable.js b/docs/js/toggleTable.js index f2d2aa44..353b8fea 100644 --- a/docs/js/toggleTable.js +++ b/docs/js/toggleTable.js @@ -53,5 +53,32 @@ function toggleTable(tableId, parent, clickedRow) { spans[i].className = wasOpen === true ? 'right-caret' : 'caret'; } } +} + +function toggleTab(showTabId, showPreId, hideTabId, hidePreId) { + if (hideTabId !== undefined) { + document.getElementById(hideTabId).className = ''; + document.getElementById(hidePreId).className = document.getElementById(hidePreId).className.replace(' hidden',''); + document.getElementById(hidePreId).className += ' hidden'; + } + + document.getElementById('hiddenTab').className = ''; + document.getElementById(showTabId).className = 'active'; + document.getElementById(showPreId).className = document.getElementById(showPreId).className.replace(' hidden',''); +} + + +function hideOptions(hideTabId1, hidePreId1, hideTabId2, hidePreId2) { + document.getElementById('hiddenTab').className = 'active'; + + document.getElementById(hideTabId1).className = ''; + document.getElementById(hidePreId1).className = document.getElementById(hidePreId1).className.replace(' hidden',''); + document.getElementById(hidePreId1).className += ' hidden'; + + if (hideTabId2 !== undefined) { + document.getElementById(hideTabId2).className = ''; + document.getElementById(hidePreId2).className = document.getElementById(hidePreId2).className.replace(' hidden',''); + document.getElementById(hidePreId2).className += ' hidden'; + } } \ No newline at end of file diff --git a/docs/network/canvas.html b/docs/network/canvas.html index 16c5bf29..48e095af 100644 --- a/docs/network/canvas.html +++ b/docs/network/canvas.html @@ -14,6 +14,7 @@ + @@ -81,7 +82,13 @@

Options

The options for the canvas have to be contained in an object titled 'canvas'.

-
+    

Click on the options shown to show how these options are supposed to be used.

+ +
+