nodefilter: filter unknown nodes
This commit is contained in:
parent
97a00b6925
commit
2e823a90c8
@ -12,10 +12,11 @@ define([], function () {
|
||||
|
||||
n.graph = {}
|
||||
n.graph.nodes = data.graph.nodes.filter( function (d) {
|
||||
if (!d.node)
|
||||
return true
|
||||
|
||||
var r = filter(d.node)
|
||||
var r
|
||||
if (d.node)
|
||||
r = filter(d.node)
|
||||
else
|
||||
r = filter({})
|
||||
|
||||
if (r)
|
||||
filteredIds.add(d.id)
|
||||
@ -24,7 +25,7 @@ define([], function () {
|
||||
})
|
||||
|
||||
n.graph.links = data.graph.links.filter( function (d) {
|
||||
return !d.sourceid || (filteredIds.has(d.source.id) && filteredIds.has(d.target.id))
|
||||
return filteredIds.has(d.source.id) && filteredIds.has(d.target.id)
|
||||
})
|
||||
|
||||
return n
|
||||
|
Loading…
Reference in New Issue
Block a user