refactor setData
This commit is contained in:
parent
3e143435e6
commit
a031ac336d
7 changed files with 47 additions and 35 deletions
lib
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue