wrap links/nodes in graph
This commit is contained in:
parent
3c3cb4047d
commit
b8a9ac9a26
|
@ -9,7 +9,7 @@ define(["tablesort", "tablesort.numeric"], function (Tablesort) {
|
|||
}
|
||||
|
||||
self.setData = function (data) {
|
||||
if (data.links.length === 0)
|
||||
if (data.graph.links.length === 0)
|
||||
return
|
||||
|
||||
var h2 = document.createElement("h2")
|
||||
|
@ -39,7 +39,7 @@ define(["tablesort", "tablesort.numeric"], function (Tablesort) {
|
|||
|
||||
var tbody = document.createElement("tbody")
|
||||
|
||||
data.links.forEach( function (d) {
|
||||
data.graph.links.forEach( function (d) {
|
||||
var row = document.createElement("tr")
|
||||
var td1 = document.createElement("td")
|
||||
var a = document.createElement("a")
|
||||
|
|
|
@ -70,7 +70,10 @@ function (config, moment, Router, L, GUI) {
|
|||
new: newnodes,
|
||||
lost: lostnodes
|
||||
},
|
||||
links: links
|
||||
graph: {
|
||||
links: links,
|
||||
nodes: graph.nodes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ define(["leaflet", "moment", "leaflet.label"], function (L, moment) {
|
|||
nodeDict = {}
|
||||
linkDict = {}
|
||||
|
||||
var lines = addLinksToMap(linkDict, linkScale, data.links, router)
|
||||
var lines = addLinksToMap(linkDict, linkScale, data.graph.links, router)
|
||||
L.featureGroup(lines).addTo(map)
|
||||
|
||||
var nodesOnline = subtract(data.nodes.all.filter(online), data.nodes.new)
|
||||
|
|
|
@ -121,7 +121,7 @@ define(function () {
|
|||
objects.nodes[d.nodeinfo.node_id] = d
|
||||
})
|
||||
|
||||
data.links.forEach( function (d) {
|
||||
data.graph.links.forEach( function (d) {
|
||||
objects.links[linkId(d)] = d
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue