refactor setData

This commit is contained in:
Nils Schneider 2015-03-29 17:48:25 +02:00
parent 3e143435e6
commit a031ac336d
7 changed files with 47 additions and 35 deletions

View file

@ -105,15 +105,15 @@ define(function () {
self.addTarget = function (d) { targets.push(d) }
self.setData = function (nodes, links) {
self.setData = function (data) {
objects.nodes = {}
objects.links = {}
nodes.forEach( function (d) {
data.nodes.all.forEach( function (d) {
objects.nodes[d.nodeinfo.node_id] = d
})
links.forEach( function (d) {
data.links.forEach( function (d) {
objects.links[linkId(d)] = d
})
}