}, { name: "marcuse16",
fingerprint: "F2A0F204670965A947A1AE5E2867C752E714032F",
color: randomColor(),
- }, { name: "ekumen",
- fingerprint: "9BA84E8C90083676F86C7427C8D105925F13716C",
- color: randomColor(),
}, { name: "marylou1",
fingerprint: "578E007E5E4535FBFEF7758D8587B07B4C8C5D06",
color: randomColor(),
}, { name: "lunar8",
fingerprint: "9F652C63770018EC6E1990C1ED3908EECABB7BAF",
color: randomColor(),
+ }, { name: "lunar9",
+ fingerprint: "88BE6B434C135557C70A013D374E53A28DA40D6A",
+ color: randomColor(),
+ }, { name: "lunar10",
+ fingerprint: "6012069CA4DE5780EB9A0518F15A58A274FE6F38",
+ color: randomColor(),
+ }, { name: "lunar11",
+ fingerprint: "1D3C3EA26EFDF8C9740DDA0402CB7222BCAAAE89",
+ color: randomColor(),
+ }, { name: "lunar12",
+ fingerprint: "E231DA63981425B322614331F58C7A1654EAD630",
+ color: randomColor(),
+ }, { name: "lunar13",
+ fingerprint: "98697EF93E26DD52CD96D3F998BF20B2A4162291",
+ color: randomColor(),
+ }, { name: "lunar14",
+ fingerprint: "51FDFE083BFFBF0E427178C3DEA659DF1E948819",
+ color: randomColor(),
+ }, { name: "lunar15",
+ fingerprint: "2EF5F5304DE04CBB5A0B361F8800AD9CC79928CC",
+ color: randomColor(),
+ }, { name: "lunar16",
+ fingerprint: "8E0F24062F440B4459E0AA5A6A501DAE78425516",
+ color: randomColor(),
}
];
+
+var nos_oignons_group_colors = [
+ "#DB4782", "#DAA03B", "#62A4B7", "#A58585",
+ "#9DCEB8", "#8077DE", "#DE5C48"
+];
+
+var nos_oignons_groups = (function() {
+ var groups = [];
+ var seen = {};
+ nos_oignons_relays.forEach(function(r) {
+ var name = r.name.replace(/\d+$/, '');
+ if (!seen[name]) {
+ seen[name] = { name: name, fingerprints: [] };
+ groups.push(seen[name]);
+ }
+ seen[name].fingerprints.push(r.fingerprint);
+ });
+ groups.forEach(function(g, i) {
+ g.color = nos_oignons_group_colors[i % nos_oignons_group_colors.length];
+ });
+ return groups;
+})();
+
+function buildRelayIndex(raw_relays) {
+ var index = {};
+ raw_relays.forEach(function(r) { index[r.fingerprint] = r; });
+ return index;
+}
+
+function sumGroupRelayValues(group, relayIndex, extractFn) {
+ var result = null;
+ group.fingerprints.forEach(function(fp) {
+ var relay = relayIndex[fp];
+ if (!relay) return;
+ var values = extractFn(relay);
+ if (!result) {
+ result = values.map(function(d) { return { date: d.date, y: d.y }; });
+ } else {
+ values.forEach(function(d, i) { result[i].y += d.y; });
+ }
+ });
+ return result || [];
+}