Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Add option definitions and validation to Graph3d #3099

Merged
merged 20 commits into from
Jul 23, 2017
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0a33741
Proof of concept with copied options + handling from network
wimrijnders May 24, 2017
e07d68f
Added unit test for Graph3d, for checking default syntax; completed d…
wimrijnders May 24, 2017
95ef79b
Fixes for options in playground example
wimrijnders May 25, 2017
8df2388
Added onclick options to graph3d documentation
wimrijnders May 25, 2017
80a3a09
Fixes in graph3d examples
wimrijnders May 25, 2017
6aa3492
Final fixes for option definitions in Graph3d
wimrijnders May 25, 2017
24bef83
Merge branch 'develop' into optionsGraph3d
wimrijnders Jun 3, 2017
49c4476
Fixed handling of 'undefined' in options, enhanced graph3d unit test
wimrijnders Jun 4, 2017
cd1c203
Disabled console output in graph3d unit test
wimrijnders Jun 4, 2017
1c33c15
merge with develop, fix conflict
wimrijnders Jun 13, 2017
59a045a
Merge branch 'develop' into optionsGraph3d
wimrijnders Jul 3, 2017
be90cea
Merge branch 'develop' into optionsGraph3d
wimrijnders Jul 13, 2017
3de1985
Merge branch 'develop' into optionsGraph3d
wimrijnders Jul 13, 2017
7b8489b
Fix conflicts
wimrijnders Jul 17, 2017
ef2b339
Upgrade webpack module
wimrijnders Jul 17, 2017
cc22771
Merge branch 'optionsGraph3d' of github.com:wimrijnders/vis into opti…
wimrijnders Jul 17, 2017
39639d2
Fixed conflicts
wimrijnders Jul 21, 2017
830c199
Merge branch 'develop' into optionsGraph3d
yotamberk Jul 21, 2017
46286ed
Merge branch 'develop' into optionsGraph3d
wimrijnders Jul 22, 2017
fe0b276
Merge branch 'develop' into optionsGraph3d
yotamberk Jul 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes for options in playground example
  • Loading branch information
wimrijnders committed May 25, 2017
commit 95ef79bbc690b783b19ceff850e7b0404acaecbb
19 changes: 14 additions & 5 deletions examples/graph3d/playground/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function getDataDatasource() {
* Retrieve a JSON object with all options
*/
function getOptions() {
return {
var options = {
width: document.getElementById("width").value,
height: document.getElementById("height").value,
style: document.getElementById("style").value,
Expand All @@ -413,8 +413,8 @@ function getOptions() {
showLegend: (document.getElementById("showLegend").checked != false),
showShadow: (document.getElementById("showShadow").checked != false),
keepAspectRatio: (document.getElementById("keepAspectRatio").checked != false),
verticalRatio: document.getElementById("verticalRatio").value,
animationInterval: document.getElementById("animationInterval").value,
verticalRatio: Number(document.getElementById("verticalRatio").value) || undefined,
animationInterval: Number(document.getElementById("animationInterval").value) || undefined,
xLabel: document.getElementById("xLabel").value,
yLabel: document.getElementById("yLabel").value,
zLabel: document.getElementById("zLabel").value,
Expand All @@ -423,8 +423,8 @@ function getOptions() {
animationPreload: (document.getElementById("animationPreload").checked != false),
animationAutoStart:(document.getElementById("animationAutoStart").checked != false),

xCenter: Number(document.getElementById("xCenter").value) || undefined,
yCenter: Number(document.getElementById("yCenter").value) || undefined,
xCenter: document.getElementById("xCenter").value,
yCenter: document.getElementById("yCenter").value,

xMin: Number(document.getElementById("xMin").value) || undefined,
xMax: Number(document.getElementById("xMax").value) || undefined,
Expand All @@ -442,6 +442,15 @@ function getOptions() {
xBarWidth: Number(document.getElementById("xBarWidth").value) || undefined,
yBarWidth: Number(document.getElementById("yBarWidth").value) || undefined
};

// Remove all options explicitly set to undefined
for (let opt in options) {
if (options.hasOwnProperty(opt) && options[opt] === undefined) {
delete options[opt];
}
}

return options;
}

/**
Expand Down