BwDrawer.y = d3.scale.linear()
.range([BwDrawer.height, 0]);
-BwDrawer.color = d3.scale.category20();
-
BwDrawer.xAxis = d3.svg.axis()
.scale(BwDrawer.x)
.orient("bottom");
return values;
}
+BwDrawer.color = d3.scale.ordinal();
+BwDrawer.color.domain(nos_oignons_relays.map(function(r) {return r.fingerprint}));
+BwDrawer.color.range(nos_oignons_relays.map(function(r) {return r.color}));
+
BwDrawer.draw_bandwidth_graph = function(raw_data, selector, period) {
var update_period;
}
});
- var valid_fingerprints = [];
- nos_oignons_relays.forEach(function(r) {
- var relay_data = raw_data["relays"].filter(function(d) { return d.fingerprint == r.fingerprint; })[0];
- valid_fingerprints.push(r.fingerprint);
- });
- BwDrawer.color.domain(valid_fingerprints);
-
var bw_data = {};
BwDrawer.periods.map(function(p) { return p.id; }).forEach(function(period) {
var interval = d3.max(raw_data.relays, function(d) {
+// Colors from https://github.com/mbostock/d3/wiki/Ordinal-Scales#category20
var nos_oignons_relays = [
{ name: "marcuse1",
fingerprint: "EFAE44728264982224445E96214C15F9075DEE1D",
+ color: "#1f77b4",
}, { name: "marcuse2",
fingerprint: "C656B41AEFB40A141967EBF49D6E69603C9B4A11",
+ color: "#aec7e8",
}, { name: "ekumen",
fingerprint: "9BA84E8C90083676F86C7427C8D105925F13716C",
+ color: "#ff7f0e",
}, { name: "marylou1",
fingerprint: "578E007E5E4535FBFEF7758D8587B07B4C8C5D06",
+ color: "#2ca02c",
}, { name: "marylou2",
fingerprint: "90FD830C357A5109AB3C505287713F1AC811174C",
+ color: "#98df8a",
},
- ];
+];