From 3575e08a407e7497fee6e7a3f5da59b1df3067aa Mon Sep 17 00:00:00 2001 From: Neal Oakey Date: Fri, 19 Jun 2015 20:24:41 +0200 Subject: [PATCH] add statistic about geoinformations --- lib/proportions.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/proportions.js b/lib/proportions.js index f9bf90e..976acaa 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -3,7 +3,7 @@ define(["chroma-js", "virtual-dom", "numeral-intl"], return function (config) { var self = this - var fwTable, hwTable, autoTable, gwTable + var fwTable, hwTable, geoTable, autoTable, gwTable var scale = Chroma.scale("YlGnBu").mode("lab") function showStatGlobal(o) { @@ -98,6 +98,12 @@ define(["chroma-js", "virtual-dom", "numeral-intl"], var fwDict = count(nodes, ["nodeinfo", "software", "firmware", "release"]) var hwDict = count(nodes, ["nodeinfo", "hardware", "model"]) + var geoDict = count(nodes, ["nodeinfo", "location"], function (d) { + if (d) + return "ja" + else + return "nein" + }) var autoDict = count(nodes, ["nodeinfo", "software", "autoupdater"], function (d) { if (d === null) return null @@ -119,6 +125,7 @@ define(["chroma-js", "virtual-dom", "numeral-intl"], fillTable(fwTable, fwDict.sort(function (a, b) { return b[1] - a[1] })) fillTable(hwTable, hwDict.sort(function (a, b) { return b[1] - a[1] })) + fillTable(geoTable, geoDict.sort(function (a, b) { return b[1] - a[1] })) fillTable(autoTable, autoDict.sort(function (a, b) { return b[1] - a[1] })) fillTable(gwTable, gwDict.sort(function (a, b) { return b[1] - a[1] })) } @@ -141,6 +148,14 @@ define(["chroma-js", "virtual-dom", "numeral-intl"], hwTable.classList.add("proportion") el.appendChild(hwTable) + h2 = document.createElement("h2") + h2.textContent = "Auf der Karte sichtbar" + el.appendChild(h2) + + geoTable = document.createElement("table") + geoTable.classList.add("proportion") + el.appendChild(geoTable) + h2 = document.createElement("h2") h2.textContent = "Autoupdater" el.appendChild(h2)