-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.js
More file actions
39 lines (36 loc) · 1.04 KB
/
data.js
File metadata and controls
39 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* This module is responsible for initializing the data.
* 1) if a local storage is available it is used.
* 2) also the combined objects from a previous session is restored.
*/
exports.init = function(rawData)
{
hasLocalStorage = typeof(Storage) !== "undefined";
// if(hasLocalStorage) {
// data = JSON.parse(localStorage.getItem("data"));
// if(data == null) {
// data = require('dataparse').parse(rawData);
// localStorage.setItem("data",JSON.stringify(data));
// }
// }
// else {
data = require('dataparse').parse(rawData);
// }
nodes = data[0];
links = data[1];
ndxLinks = crossfilter(links);
binwidth = 1000;
sourceRestId = nodes.length;
nodes.push({name:"Sonstige Rechtsträger",gov:1});
targetRestId = nodes.length;
nodes.push({name:"Sonstige Medien",gov:0});
// if(hasLocalStorage) {
// combinedObj = JSON.parse(localStorage.getItem("combinedObj"));
// if(combinedObj == null) {
// combinedObj = new Array();
// }
// }
// else{
combinedObj = new Array();
// }
};