history: longlings 90th percentile, show tq
This commit is contained in:
parent
ccd46b521b
commit
bbc38c62c7
|
@ -96,7 +96,7 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
#lists td:nth-child(2) {
|
||||
#lists td:not(:first-child) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
|
14
history.js
14
history.js
|
@ -151,7 +151,7 @@ function handle_data(map) {
|
|||
|
||||
longlinks = graph.slice().sort( function (a, b) {
|
||||
return a.distance - b.distance
|
||||
}).reverse().slice(0, 10)
|
||||
}).reverse().slice(0, Math.ceil(0.1 * graph.length))
|
||||
|
||||
addToLongLinksList(document.getElementById("longlinks"), longlinks)
|
||||
|
||||
|
@ -163,6 +163,14 @@ function showDistance(d) {
|
|||
return (new Intl.NumberFormat("de-DE", {maximumFractionDigits: 0}).format(d.distance)) + " m"
|
||||
}
|
||||
|
||||
function showTq(d) {
|
||||
var opts = { maximumFractionDigits: 2,
|
||||
minimumFractionDigits: 2
|
||||
}
|
||||
|
||||
return (new Intl.NumberFormat("de-DE", opts).format(d.tq)) + " TQ"
|
||||
}
|
||||
|
||||
function mkmap(map, newnodes, lostnodes, onlinenodes, graph) {
|
||||
L.control.zoom({ position: "topright" }).addTo(map)
|
||||
|
||||
|
@ -242,6 +250,10 @@ function addToLongLinksList(el, links) {
|
|||
td2.textContent = showDistance(d)
|
||||
row.appendChild(td2)
|
||||
|
||||
var td3 = document.createElement("td")
|
||||
td3.textContent = showTq(d)
|
||||
row.appendChild(td3)
|
||||
|
||||
el.appendChild(row)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue