From c747e374398549fc889e2d070847b6887eaa2be5 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 15:46:27 +0100 Subject: [PATCH 1/8] Tracker stuff for demo --- tracker-server/public/javascripts/demo.js | 15 +++++++++++++++ tracker-server/views/demo.ejs | 2 ++ 2 files changed, 17 insertions(+) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index 417ef5c..aa1b600 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -32,6 +32,21 @@ $(document).ready(function() { var options = { nodes: { shape: 'dot' + }, + layout: { + randomSeed:2 + }, + configure: { + filter:function (option, path) { + if (path.indexOf('physics') !== -1) { + return true; + } + if (path.indexOf('smooth') !== -1 || option === 'smooth') { + return true; + } + return false; + }, + container: document.getElementById('config') } }; network = new vis.Network(container, data, options); diff --git a/tracker-server/views/demo.ejs b/tracker-server/views/demo.ejs index 9d0ca59..2ed09e1 100644 --- a/tracker-server/views/demo.ejs +++ b/tracker-server/views/demo.ejs @@ -35,6 +35,8 @@
+ +
edges
smooth:
enabled:
type:
forceDirection:
roundness:
physics
enabled:
barnesHut:
gravitationalConstant:
centralGravity:
springLength:
springConstant:
damping:
avoidOverlap:
maxVelocity:
minVelocity:
solver:
timestep:
generate options
From 5c5bd614de6e7e58a7efd9dae8b19d8593d7f831 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 15:55:07 +0100 Subject: [PATCH 2/8] Fix? --- tracker-server/public/javascripts/demo.js | 3 --- tracker-server/views/demo.ejs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index aa1b600..7e3880c 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -33,9 +33,6 @@ $(document).ready(function() { nodes: { shape: 'dot' }, - layout: { - randomSeed:2 - }, configure: { filter:function (option, path) { if (path.indexOf('physics') !== -1) { diff --git a/tracker-server/views/demo.ejs b/tracker-server/views/demo.ejs index 2ed09e1..11a2927 100644 --- a/tracker-server/views/demo.ejs +++ b/tracker-server/views/demo.ejs @@ -36,7 +36,7 @@
-
edges
smooth:
enabled:
type:
forceDirection:
roundness:
physics
enabled:
barnesHut:
gravitationalConstant:
centralGravity:
springLength:
springConstant:
damping:
avoidOverlap:
maxVelocity:
minVelocity:
solver:
timestep:
generate options
+
From d4b9e5a981495ce506e58b0b42401a24a894550b Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:09:20 +0100 Subject: [PATCH 3/8] Better defaults --- tracker-server/public/javascripts/demo.js | 11 +++++++++++ tracker-server/views/demo.ejs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index 7e3880c..655103c 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -33,6 +33,17 @@ $(document).ready(function() { nodes: { shape: 'dot' }, + edges: { + type: 'discrete' + }, + layout: { + randomSeed: 2 + }, + pysics: { + barnesHut: { + springLength: 1000 + } + } configure: { filter:function (option, path) { if (path.indexOf('physics') !== -1) { diff --git a/tracker-server/views/demo.ejs b/tracker-server/views/demo.ejs index 11a2927..40367f5 100644 --- a/tracker-server/views/demo.ejs +++ b/tracker-server/views/demo.ejs @@ -35,7 +35,7 @@
- +
From 48e57e2aa178805d1e9dbf2d4c5cd6d7a0b1a0e5 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:11:17 +0100 Subject: [PATCH 4/8] Fix --- tracker-server/public/javascripts/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index 655103c..d6538fe 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -43,7 +43,7 @@ $(document).ready(function() { barnesHut: { springLength: 1000 } - } + }, configure: { filter:function (option, path) { if (path.indexOf('physics') !== -1) { From 9470efcf0ee444735b3f3ca3114834d470e3351a Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:12:10 +0100 Subject: [PATCH 5/8] Fix spelling --- tracker-server/public/javascripts/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index d6538fe..6b1670f 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -39,7 +39,7 @@ $(document).ready(function() { layout: { randomSeed: 2 }, - pysics: { + physics: { barnesHut: { springLength: 1000 } From b65e8a049e17c1949504b69319d214df42398170 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:13:43 +0100 Subject: [PATCH 6/8] Fix type --- tracker-server/public/javascripts/demo.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index 6b1670f..4934681 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -34,7 +34,9 @@ $(document).ready(function() { shape: 'dot' }, edges: { - type: 'discrete' + smooth: { + type: 'discrete' + } }, layout: { randomSeed: 2 From 90514b7539718715eebec6e45ef97ed33db57940 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:32:44 +0100 Subject: [PATCH 7/8] Add other config options --- tracker-server/public/javascripts/demo.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index 4934681..d039025 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -34,6 +34,9 @@ $(document).ready(function() { shape: 'dot' }, edges: { + color: { + opacity: 0.5 + }, smooth: { type: 'discrete' } @@ -47,15 +50,6 @@ $(document).ready(function() { } }, configure: { - filter:function (option, path) { - if (path.indexOf('physics') !== -1) { - return true; - } - if (path.indexOf('smooth') !== -1 || option === 'smooth') { - return true; - } - return false; - }, container: document.getElementById('config') } }; From 30b77f335340c45e61e587ca9b12484ed10fee01 Mon Sep 17 00:00:00 2001 From: Taico Aerts Date: Fri, 2 Feb 2018 16:41:10 +0100 Subject: [PATCH 8/8] Hide some options --- tracker-server/public/javascripts/demo.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tracker-server/public/javascripts/demo.js b/tracker-server/public/javascripts/demo.js index d039025..573ee47 100644 --- a/tracker-server/public/javascripts/demo.js +++ b/tracker-server/public/javascripts/demo.js @@ -50,6 +50,21 @@ $(document).ready(function() { } }, configure: { + filter:function (option, path) { + if (path.indexOf('physics') !== -1) { + return true; + } + if (path.indexOf('smooth') !== -1 || option === 'smooth') { + return true; + } + if (path.indexOf('color') !== -1 || option === 'color') { + return true; + } + if (path.indexOf('nodes') !== -1) { + return true; + } + return false; + }, container: document.getElementById('config') } };