Browse Source

rebuilt, updated ignore, updated history

flowchartTest
Alex de Mulder 9 years ago
parent
commit
560c0f4a73
7 changed files with 994 additions and 1060 deletions
  1. +2
    -4
      .gitignore
  2. +2
    -0
      HISTORY.md
  3. +853
    -879
      dist/vis.js
  4. +66
    -14
      test/graph2dTest.html
  5. +0
    -62
      test/graph2dTestData.js
  6. +0
    -31
      test/graph2dTestData2.js
  7. +71
    -70
      test/networkTest.html

+ 2
- 4
.gitignore View File

@ -3,11 +3,9 @@
*.iml *.iml
node_modules node_modules
.project .project
.settings/.jsdtscope
.settings/org.eclipse.wst.jsdt.ui.superType.container
.settings/org.eclipse.wst.jsdt.ui.superType.name
.settings
npm-debug.log npm-debug.log
examples/graph/24_hierarchical_layout_userdefined2.html
# vim temporary files # vim temporary files
.*.sw[op] .*.sw[op]
test

+ 2
- 0
HISTORY.md View File

@ -23,11 +23,13 @@ http://visjs.org
- Fixed static smooth edges not fully working from every angle. - Fixed static smooth edges not fully working from every angle.
- Fixed updating bounding box of nodes without drawing. - Fixed updating bounding box of nodes without drawing.
- Fixed #1036, bug in lockedRedraw. Thanks @vges! - Fixed #1036, bug in lockedRedraw. Thanks @vges!
- Added getDataset to all manipulation functions. Thanks @ericvandever!
### Graph2d ### Graph2d
- Made graph2d more robust against string values in the y position. - Made graph2d more robust against string values in the y position.
- Fixed bug where 0 axis was always in the automatically fitted range. - Fixed bug where 0 axis was always in the automatically fitted range.
- Added drawPoints.onRender. Thanks @mschallar!
## 2015-06-16, version 4.3.0 ## 2015-06-16, version 4.3.0

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


+ 66
- 14
test/graph2dTest.html View File

@ -10,11 +10,12 @@
body, html { body, html {
font-family: sans-serif; font-family: sans-serif;
} }
</style> </style>
<script src="../dist/vis.js"></script> <script src="../dist/vis.js"></script>
<script src="./graph2dTestData.js"></script>
<script src="./graph2dTestData2.js"></script>
<script src="./locationTrace_processed.js"></script>
<script src="./timeTraveled_processed.js"></script>
<link href="../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../dist/vis.css" rel="stylesheet" type="text/css" />
<body> <body>
@ -25,6 +26,7 @@
<br /> <br />
<div id="visualization"></div> <div id="visualization"></div>
<div id="visualization2"></div> <div id="visualization2"></div>
<div id="visualization3"></div>
<script type="text/javascript"> <script type="text/javascript">
var groups = new vis.DataSet(); var groups = new vis.DataSet();
@ -44,31 +46,81 @@
}) })
groups.add({ groups.add({
id: 'timeTraveled', id: 'timeTraveled',
content: 'timeTraveled'
content: 'timeTraveled',
options:{
yAxisOrientation:'right',
drawPoints:{style:"square", size:10}
}
})
groups.add({
id: 'db',
content: 'db',
options:{
yAxisOrientation:'right',
drawPoints:{style:"circle"}
}
}) })
var items = []; var items = [];
var items2 = [];
for (var i = 0; i < data.length; i++) {
items.push({x:Number(data[i].date+'000'), y:data[i].value.accuracy, group:'accuracy'});
items.push({x:Number(data[i].date+'000'), y:data[i].value.latitude, group:'latitude'});
items.push({x:Number(data[i].date+'000'), y:data[i].value.longitude, group:'longitude'});
var checkItems = [];
for (var i = 0; i < locationTraceData.length; i++) {
items.push({x:Number(locationTraceData[i].date+'000'), y:locationTraceData[i].value.accuracy === undefined ? 50 : locationTraceData[i].value.accuracy, group:'accuracy', label: {content:locationTraceData[i].value.event}});
items.push({x:Number(locationTraceData[i].date+'000'), y:locationTraceData[i].value.latitude === undefined ? -6.8 : locationTraceData[i].value.latitude, group:'latitude'});
items.push({x:Number(locationTraceData[i].date+'000'), y:locationTraceData[i].value.longitude === undefined ? 107.6 : locationTraceData[i].value.longitude, group:'longitude'});
} }
for (var i = 0; i < timeTraveledData.length; i++) { for (var i = 0; i < timeTraveledData.length; i++) {
items2.push({x:Number(timeTraveledData[i].date+'000'), y:timeTraveledData[i].value, group:'timeTraveled'});
items.push({x:Number(timeTraveledData[i].date+'000'), y:timeTraveledData[i].value, group:'timeTraveled'});
}
var lastValue = 0;
var timeTraveled = 0;
var dt = 0;
var start = Number(locationTraceData[0].date);
var departed = false;
for (var i = 0; i < locationTraceData.length; i++) {
var event = locationTraceData[i].value.event;
if (event === 'depart') {
dt = Number(locationTraceData[i].date);
departed = true;
}
else {
if (departed === true) {
timeTraveled += Number(locationTraceData[i].date) - dt;
}
departed = false;
dt = 0;
}
checkItems.push({x:Number(locationTraceData[i].date+'000'), y:timeTraveled, group:'db'});
} }
var matchingItems = [];
for (var i = 0; i < checkItems.length; i++) {
for (var j = 0; j < items.length; j++) {
if (items[j].group === 'timeTraveled') {
if (items[j].x === checkItems[i].x) {
console.log("check @ ", checkItems[i].x, items[j].y - checkItems[i].y);
matchingItems.push(checkItems[i]);
break;
}
}
}
}
items = items.concat(checkItems)
var container = document.getElementById('visualization'); var container = document.getElementById('visualization');
var container2 = document.getElementById('visualization2');
var dataset = new vis.DataSet(items); var dataset = new vis.DataSet(items);
var options = { var options = {
interpolation:false
interpolation:false,
height:800,
sort:true
}; };
var graph2d = new vis.Graph2d(container, dataset,groups, options); var graph2d = new vis.Graph2d(container, dataset,groups, options);
var dataset2 = new vis.DataSet(items2);
var graph2d2 = new vis.Graph2d(container2, dataset2,groups, options);
</script> </script>
</body> </body>
</html> </html>

+ 0
- 62
test/graph2dTestData.js View File

@ -1,62 +0,0 @@
var data = [{"date":1434089922,"human date":"Fri Jun 12 08:18:42 2015","sensor_name":"location_trace","value":{"accuracy":9.8651085,"event":"depart","latitude":-6.88719262,"longitude":107.60112529,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434091791,"human date":"Fri Jun 12 08:49:51 2015","sensor_name":"location_trace","value":{"accuracy":43.81825409,"event":"arrive","id":"1","label":null,"latitude":-6.8872664,"longitude":107.60107174,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434108848,"human date":"Fri Jun 12 13:34:08 2015","sensor_name":"location_trace","value":{"accuracy":8.55207001,"event":"depart","latitude":-6.88727046,"longitude":107.60103358,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434109598,"human date":"Fri Jun 12 13:46:38 2015","sensor_name":"location_trace","value":{"accuracy":49.46214044,"event":"arrive","id":"2","label":null,"latitude":-6.88057248,"longitude":107.61796548,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434111432,"human date":"Fri Jun 12 14:17:12 2015","sensor_name":"location_trace","value":{"accuracy":48.40714981,"event":"depart","latitude":-6.88062124,"longitude":107.61783507,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434111766,"human date":"Fri Jun 12 14:22:46 2015","sensor_name":"location_trace","value":{"accuracy":16.34922773,"event":"arrive","id":"3","label":null,"latitude":-6.87758127,"longitude":107.61716543,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434113152,"human date":"Fri Jun 12 14:45:52 2015","sensor_name":"location_trace","value":{"accuracy":20.92144383,"event":"depart","latitude":-6.87759104,"longitude":107.6171668,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434113562,"human date":"Fri Jun 12 14:52:42 2015","sensor_name":"location_trace","value":{"accuracy":44.55707187,"event":"arrive","id":"2","label":null,"latitude":-6.88051516,"longitude":107.61791165,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434114689,"human date":"Fri Jun 12 15:11:29 2015","sensor_name":"location_trace","value":{"accuracy":59.36579371,"event":"depart","latitude":-6.88059773,"longitude":107.61779569,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434114702,"human date":"Fri Jun 12 15:11:42 2015","sensor_name":"location_trace","value":{"accuracy":90.4257235,"event":"arrive","id":"4","label":null,"latitude":-6.88108843,"longitude":107.61609844,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434115228,"human date":"Fri Jun 12 15:20:28 2015","sensor_name":"location_trace","value":{"accuracy":51.27672614,"event":"depart","latitude":-6.88080118,"longitude":107.61616144,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434115556,"human date":"Fri Jun 12 15:25:56 2015","sensor_name":"location_trace","value":{"accuracy":19.81304222,"event":"arrive","id":"5","label":null,"latitude":-6.88014939,"longitude":107.61266789,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434178314,"human date":"Sat Jun 13 08:51:54 2015","sensor_name":"location_trace","value":{"accuracy":7.23722729,"event":"depart","latitude":-6.88014818,"longitude":107.61267432,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434179256,"human date":"Sat Jun 13 09:07:36 2015","sensor_name":"location_trace","value":{"accuracy":17.38816116,"event":"arrive","id":"6","label":null,"latitude":-6.88241801,"longitude":107.61539814,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434181976,"human date":"Sat Jun 13 09:52:56 2015","sensor_name":"location_trace","value":{"accuracy":14.05118087,"event":"depart","latitude":-6.8824038,"longitude":107.61541507,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434183444,"human date":"Sat Jun 13 10:17:24 2015","sensor_name":"location_trace","value":{"accuracy":49.75070572,"event":"arrive","id":"7","label":null,"latitude":-6.89371451,"longitude":107.61154891,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434184755,"human date":"Sat Jun 13 10:39:15 2015","sensor_name":"location_trace","value":{"accuracy":55.66443874,"event":"depart","latitude":-6.89366818,"longitude":107.6115371,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434185083,"human date":"Sat Jun 13 10:44:43 2015","sensor_name":"location_trace","value":{"accuracy":49.72710721,"event":"arrive","id":"8","label":null,"latitude":-6.89054567,"longitude":107.61124693,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434199431,"human date":"Sat Jun 13 14:43:51 2015","sensor_name":"location_trace","value":{"accuracy":33.69752192,"event":"depart","latitude":-6.89062121,"longitude":107.61125685,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434200593,"human date":"Sat Jun 13 15:03:13 2015","sensor_name":"location_trace","value":{"accuracy":14.23071391,"event":"arrive","id":"9","label":null,"latitude":-6.88131227,"longitude":107.5989531,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434207742,"human date":"Sat Jun 13 17:02:22 2015","sensor_name":"location_trace","value":{"accuracy":23.31002638,"event":"depart","latitude":-6.88128907,"longitude":107.59893803,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434208493,"human date":"Sat Jun 13 17:14:53 2015","sensor_name":"location_trace","value":{"accuracy":77.20428606,"event":"arrive","id":"2","label":null,"latitude":-6.88060048,"longitude":107.61763722,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434208802,"human date":"Sat Jun 13 17:20:02 2015","sensor_name":"location_trace","value":{"accuracy":77.20428606,"event":"depart","latitude":-6.88060048,"longitude":107.61763722,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434209136,"human date":"Sat Jun 13 17:25:36 2015","sensor_name":"location_trace","value":{"accuracy":33.31796294,"event":"arrive","id":"5","label":null,"latitude":-6.88015553,"longitude":107.61265498,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434251757,"human date":"Sun Jun 14 05:15:57 2015","sensor_name":"location_trace","value":{"accuracy":10.41278242,"event":"depart","latitude":-6.88009926,"longitude":107.61263606,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434253352,"human date":"Sun Jun 14 05:42:32 2015","sensor_name":"location_trace","value":{"accuracy":28.48064965,"event":"arrive","id":"10","label":null,"latitude":-6.90170313,"longitude":107.61214595,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434253835,"human date":"Sun Jun 14 05:50:35 2015","sensor_name":"location_trace","value":{"accuracy":42.08014781,"event":"depart","latitude":-6.90171101,"longitude":107.61207844,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434254203,"human date":"Sun Jun 14 05:56:43 2015","sensor_name":"location_trace","value":{"accuracy":80.35412083999999,"event":"arrive","id":"11","label":null,"latitude":-6.8921046,"longitude":107.61095909,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434254666,"human date":"Sun Jun 14 06:04:26 2015","sensor_name":"location_trace","value":{"accuracy":92.1266253,"event":"depart","latitude":-6.8917989,"longitude":107.61094079,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434254673,"human date":"Sun Jun 14 06:04:33 2015","sensor_name":"location_trace","value":{"accuracy":77.07350688,"event":"arrive","id":"8","label":null,"latitude":-6.89035161,"longitude":107.61141994,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434258359,"human date":"Sun Jun 14 07:05:59 2015","sensor_name":"location_trace","value":{"accuracy":44.14984278,"event":"depart","latitude":-6.89048937,"longitude":107.61136302,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434301532,"human date":"Sun Jun 14 19:05:32 2015","sensor_name":"location_trace","value":{"accuracy":8.76517804,"event":"arrive","id":"5","label":null,"latitude":-6.88011422,"longitude":107.61264872,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434309577,"human date":"Sun Jun 14 21:19:37 2015","sensor_name":"location_trace","value":{"accuracy":5.86775248,"event":"depart","latitude":-6.88011528,"longitude":107.61264926,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434335139,"human date":"Mon Jun 15 04:25:39 2015","sensor_name":"location_trace","value":{"accuracy":61.32370768,"event":"arrive","id":"2","label":null,"latitude":-6.88066177,"longitude":107.61811035,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434336013,"human date":"Mon Jun 15 04:40:13 2015","sensor_name":"location_trace","value":{"accuracy":41.79724314,"event":"depart","latitude":-6.88062104,"longitude":107.61809159,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434342433,"human date":"Mon Jun 15 06:27:13 2015","sensor_name":"location_trace","value":{"accuracy":48.73126571,"event":"arrive","id":"1","label":null,"latitude":-6.88725263,"longitude":107.60103205,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434368340,"human date":"Mon Jun 15 13:39:00 2015","sensor_name":"location_trace","value":{"accuracy":21.61201699,"event":"depart","latitude":-6.8872998,"longitude":107.60105245,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434369101,"human date":"Mon Jun 15 13:51:41 2015","sensor_name":"location_trace","value":{"accuracy":72.08036199,"event":"arrive","id":"10","label":null,"latitude":-6.90144182,"longitude":107.61194031,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434376124,"human date":"Mon Jun 15 15:48:44 2015","sensor_name":"location_trace","value":{"accuracy":52.99032469,"event":"depart","latitude":-6.9015362,"longitude":107.61199601,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434377390,"human date":"Mon Jun 15 16:09:50 2015","sensor_name":"location_trace","value":{"accuracy":47.03616961,"event":"arrive","id":"2","label":null,"latitude":-6.88054536,"longitude":107.61796241,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434377771,"human date":"Mon Jun 15 16:16:11 2015","sensor_name":"location_trace","value":{"accuracy":47.03616961,"event":"depart","latitude":-6.88054536,"longitude":107.61796241,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434378417,"human date":"Mon Jun 15 16:26:57 2015","sensor_name":"location_trace","value":{"accuracy":40.51562354,"event":"arrive","id":"5","label":null,"latitude":-6.8801409,"longitude":107.61269824,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434417371,"human date":"Tue Jun 16 03:16:11 2015","sensor_name":"location_trace","value":{"accuracy":14.27015187,"event":"depart","latitude":-6.88014601,"longitude":107.61265679,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434417701,"human date":"Tue Jun 16 03:21:41 2015","sensor_name":"location_trace","value":{"accuracy":30.48131182,"event":"arrive","id":"2","label":null,"latitude":-6.88058681,"longitude":107.61796969,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434418426,"human date":"Tue Jun 16 03:33:46 2015","sensor_name":"location_trace","value":{"accuracy":32.14151466,"event":"depart","latitude":-6.8806009,"longitude":107.61794498,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434419710,"human date":"Tue Jun 16 03:55:10 2015","sensor_name":"location_trace","value":{"accuracy":38.48393903,"event":"arrive","id":"1","label":null,"latitude":-6.88728876,"longitude":107.60105091,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434460889,"human date":"Tue Jun 16 15:21:29 2015","sensor_name":"location_trace","value":{"accuracy":12.59621188,"event":"depart","latitude":-6.88727441,"longitude":107.60104867,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434461551,"human date":"Tue Jun 16 15:32:31 2015","sensor_name":"location_trace","value":{"accuracy":19.31764351,"event":"arrive","id":"12","label":null,"latitude":-6.87633382,"longitude":107.61808237,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434465985,"human date":"Tue Jun 16 16:46:25 2015","sensor_name":"location_trace","value":{"accuracy":19.11954236,"event":"depart","latitude":-6.87630865,"longitude":107.61808388,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434466313,"human date":"Tue Jun 16 16:51:53 2015","sensor_name":"location_trace","value":{"accuracy":41.74256237,"event":"arrive","id":"2","label":null,"latitude":-6.88040489,"longitude":107.61805006,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434470287,"human date":"Tue Jun 16 17:58:07 2015","sensor_name":"location_trace","value":{"accuracy":17.17529627,"event":"depart","latitude":-6.88040091,"longitude":107.61802065,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434470692,"human date":"Tue Jun 16 18:04:52 2015","sensor_name":"location_trace","value":{"accuracy":25.62768635,"event":"arrive","id":"5","label":null,"latitude":-6.88014872,"longitude":107.612666,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434503862,"human date":"Wed Jun 17 03:17:42 2015","sensor_name":"location_trace","value":{"accuracy":16.97034556,"event":"depart","latitude":-6.88014743,"longitude":107.612663,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434504223,"human date":"Wed Jun 17 03:23:43 2015","sensor_name":"location_trace","value":{"accuracy":39.91119162,"event":"arrive","id":"2","label":null,"latitude":-6.88036261,"longitude":107.61798252,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434504635,"human date":"Wed Jun 17 03:30:35 2015","sensor_name":"location_trace","value":{"accuracy":44.98165311,"event":"depart","latitude":-6.88036768,"longitude":107.61796149,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434506331,"human date":"Wed Jun 17 03:58:51 2015","sensor_name":"location_trace","value":{"accuracy":107.826819,"event":"arrive","id":"13","label":null,"latitude":-6.88960661,"longitude":107.66640101,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434507298,"human date":"Wed Jun 17 04:14:58 2015","sensor_name":"location_trace","value":{"accuracy":73.6596208,"event":"depart","latitude":-6.88948967,"longitude":107.6667333,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434508937,"human date":"Wed Jun 17 04:42:17 2015","sensor_name":"location_trace","value":{"accuracy":30.22118878,"event":"arrive","id":"1","label":null,"latitude":-6.88730063,"longitude":107.60103527,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434555454,"human date":"Wed Jun 17 17:37:34 2015","sensor_name":"location_trace","value":{"accuracy":18.15708917,"event":"depart","latitude":-6.88728161,"longitude":107.60105134,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434557415,"human date":"Wed Jun 17 18:10:15 2015","sensor_name":"location_trace","value":{"accuracy":65.51653597000001,"event":"arrive","id":"5","label":null,"latitude":-6.88014859,"longitude":107.6126779,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434588524,"human date":"Thu Jun 18 02:48:44 2015","sensor_name":"location_trace","value":{"accuracy":15.86531182,"event":"depart","latitude":-6.88015002,"longitude":107.6126594,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}},
{"date":1434589637,"human date":"Thu Jun 18 03:07:17 2015","sensor_name":"location_trace","value":{"accuracy":96.19415222000001,"event":"arrive","id":"1","label":null,"latitude":-6.88733572,"longitude":107.60105139,"metadata":{"core version":"v1.8.0-coaching_v3.4.2","module version":"1.3"}}}]

+ 0
- 31
test/graph2dTestData2.js View File

@ -1,31 +0,0 @@
var timeTraveledData = [{"date":1434091791,"human date":"Fri Jun 12 08:49:51 2015","sensor_name":"time_traveled","value":1869},
{"date":1434109598,"human date":"Fri Jun 12 13:46:38 2015","sensor_name":"time_traveled","value":2619},
{"date":1434111766,"human date":"Fri Jun 12 14:22:46 2015","sensor_name":"time_traveled","value":2953},
{"date":1434113562,"human date":"Fri Jun 12 14:52:42 2015","sensor_name":"time_traveled","value":3363},
{"date":1434114702,"human date":"Fri Jun 12 15:11:42 2015","sensor_name":"time_traveled","value":3376},
{"date":1434115556,"human date":"Fri Jun 12 15:25:56 2015","sensor_name":"time_traveled","value":3704},
{"date":1434179256,"human date":"Sat Jun 13 09:07:36 2015","sensor_name":"time_traveled","value":4646},
{"date":1434183444,"human date":"Sat Jun 13 10:17:24 2015","sensor_name":"time_traveled","value":6114},
{"date":1434185083,"human date":"Sat Jun 13 10:44:43 2015","sensor_name":"time_traveled","value":6442},
{"date":1434200593,"human date":"Sat Jun 13 15:03:13 2015","sensor_name":"time_traveled","value":7604},
{"date":1434208493,"human date":"Sat Jun 13 17:14:53 2015","sensor_name":"time_traveled","value":8355},
{"date":1434209136,"human date":"Sat Jun 13 17:25:36 2015","sensor_name":"time_traveled","value":8689},
{"date":1434253352,"human date":"Sun Jun 14 05:42:32 2015","sensor_name":"time_traveled","value":10284},
{"date":1434254203,"human date":"Sun Jun 14 05:56:43 2015","sensor_name":"time_traveled","value":10652},
{"date":1434254673,"human date":"Sun Jun 14 06:04:33 2015","sensor_name":"time_traveled","value":10659},
{"date":1434301532,"human date":"Sun Jun 14 19:05:32 2015","sensor_name":"time_traveled","value":53832},
{"date":1434335139,"human date":"Mon Jun 15 04:25:39 2015","sensor_name":"time_traveled","value":79394},
{"date":1434342433,"human date":"Mon Jun 15 06:27:13 2015","sensor_name":"time_traveled","value":85814},
{"date":1434369101,"human date":"Mon Jun 15 13:51:41 2015","sensor_name":"time_traveled","value":86575},
{"date":1434377390,"human date":"Mon Jun 15 16:09:50 2015","sensor_name":"time_traveled","value":87841},
{"date":1434378417,"human date":"Mon Jun 15 16:26:57 2015","sensor_name":"time_traveled","value":88487},
{"date":1434417701,"human date":"Tue Jun 16 03:21:41 2015","sensor_name":"time_traveled","value":88817},
{"date":1434419710,"human date":"Tue Jun 16 03:55:10 2015","sensor_name":"time_traveled","value":90101},
{"date":1434461551,"human date":"Tue Jun 16 15:32:31 2015","sensor_name":"time_traveled","value":90763},
{"date":1434466313,"human date":"Tue Jun 16 16:51:53 2015","sensor_name":"time_traveled","value":91091},
{"date":1434470692,"human date":"Tue Jun 16 18:04:52 2015","sensor_name":"time_traveled","value":91496},
{"date":1434504223,"human date":"Wed Jun 17 03:23:43 2015","sensor_name":"time_traveled","value":91857},
{"date":1434506331,"human date":"Wed Jun 17 03:58:51 2015","sensor_name":"time_traveled","value":93553},
{"date":1434508937,"human date":"Wed Jun 17 04:42:17 2015","sensor_name":"time_traveled","value":95192},
{"date":1434557415,"human date":"Wed Jun 17 18:10:15 2015","sensor_name":"time_traveled","value":97153},
{"date":1434589637,"human date":"Thu Jun 18 03:07:17 2015","sensor_name":"time_traveled","value":98266}]

+ 71
- 70
test/networkTest.html View File

@ -1,88 +1,89 @@
<!doctype html>
<!DOCTYPE html>
<html> <html>
<head> <head>
<title>Network | Basic usage</title>
<meta charset="utf-8">
<title>JS Bin</title>
<script type="text/javascript" src="../dist/vis.js"></script> <script type="text/javascript" src="../dist/vis.js"></script>
<style type="text/css">
<style>
#mynetwork { #mynetwork {
width: 600px;
height: 400px;
width: 700px;
height: 450px;
border: 1px solid lightgray; border: 1px solid lightgray;
} }
</style> </style>
</head>
<body>
<p>
Create a simple network with some nodes and edges.
</p>
<input type="button" value="asdasa" onclick="b()">
<div id="mynetwork"></div>
<script type="text/javascript">
var nodes = [
{"id":"28","label":"SPD","shape":"image","image":"http://commons.wikimedia.org/wiki/Special:FilePath/SPD_logo.svg?width=300","x":7146,"y":1903},
{"id":"148","label":"Wladimir Putin","shape":"image","image":"http://commons.wikimedia.org/wiki/Special:FilePath/Vladimir_Putin_-_2006.jpg?width=300","x":7677,"y":1885}
];
var edges = []
<script>
var network = null;
function destroy() {
if (network !== null) {
network.destroy();
network = null;
}
}
var nodesDataset = new vis.DataSet(nodes);
var edgesDataset = new vis.DataSet(edges);
function draw() {
destroy();
var container = document.getElementById('mynetwork');
var nodes = new vis.DataSet();
var edges = new vis.DataSet();
data = {
nodes: nodes,
edges:edges
}
var options = {
nodes: {
shape: 'dot',
scaling: {
min: 10,
max: 200,
label: {
min: 50,
max: 100,
drawThreshold: 10,
maxVisible: 60
options = {
edges: {
arrows:{
to: true
},
smooth:{
enabled: true
} }
}, },
font: {
size: 100,
face: 'Tahoma'
}
},
edges: {
width: 0.2,
color: {inherit: 'from'},
smooth: {
type: 'continuous'
layout:{
hierarchical: {
enabled: true
}
},
physics:{
enabled: true,
stabilization: true
},
manipulation:{
enabled:false,
addEdge: function (data, callback) {
setTimeout(function () {network.addEdgeMode();},0);
callback(data);
}
} }
},
physics: false,
interaction: {
tooltipDelay: 200,
hideEdgesOnDrag: true,
navigationButtons: true,
keyboard: true
}
};
var container = document.getElementById('mynetwork');
network = new vis.Network(container, {nodes: nodesDataset, edges: edgesDataset}, options);
function b() {
var nodesToAdd = new vis.DataSet(nodes).get();
console.log(nodesToAdd);
nodesDataset.update(nodesToAdd);
}
};
network = new vis.Network(container, data, options);
var layer1Cnt = 0;
var layer2Cnt = 0;
var layer3Cnt = 0;
document.getElementById("addNodeLayer1").onclick = function(e){
nodes.add({id: "layer1_"+layer1Cnt++, label: 'Layer1-'+layer1Cnt, level: 0});
network.addEdgeMode();
}
document.getElementById("addNodeLayer2").onclick = function(e){
nodes.add({id: "layer2_"+layer2Cnt++, label: 'Layer2-'+layer2Cnt, level:1});
network.addEdgeMode();
}
document.getElementById("addNodeLayer3").onclick = function(e){
nodes.add({id: "layer3_"+layer3Cnt++, label: 'Layer3-'+layer3Cnt, level:2});
network.addEdgeMode();
}
</script>
}
</script>
</head>
<body onLoad="draw()">
<button id="addNodeLayer1">Layer 1</button>
<button id="addNodeLayer2">Layer 2</button>
<button id="addNodeLayer3">Layer 3</button>
<div id="mynetwork"></div>
</body> </body>
</html>
</html>

Loading…
Cancel
Save