.outerRadius(PieDrawer.radius - 10)
.innerRadius(PieDrawer.radius - 40);
PieDrawer.labelRadius = PieDrawer.radius - 15;
.outerRadius(PieDrawer.radius - 10)
.innerRadius(PieDrawer.radius - 40);
PieDrawer.labelRadius = PieDrawer.radius - 15;
- d3.json(PieDrawer.onionoo_url + "&fields=fingerprint," + this.getFieldName(), function(error, raw_data) {
- var frac_nos_oignons = 0;
- raw_data['relays'].forEach(function(d) {
- nos_oignons_relays.forEach(function(r) {
- if (r.fingerprint == d.fingerprint) {
- var value = field_getter(d);
- if (value) {
- frac_nos_oignons += value;
+ d3.json(PieDrawer.onionoo_url + "&fields=fingerprint," + this.getFieldName())
+ .then(function(raw_data) {
+ var frac_nos_oignons = 0;
+ raw_data['relays'].forEach(function(d) {
+ nos_oignons_relays.forEach(function(r) {
+ if (r.fingerprint == d.fingerprint) {
+ var value = field_getter(d);
+ if (value) {
+ frac_nos_oignons += value;
+ }
- data = [ { name: L10n.nos_oignons, frac: frac_nos_oignons, color: PieDrawer.color_nos_oignons, },
- { name: L10n.others, frac: frac_others, color: PieDrawer.color_others }, ];
+ data = [ { name: L10n.nos_oignons, frac: frac_nos_oignons, color: PieDrawer.color_nos_oignons, },
+ { name: L10n.others, frac: frac_others, color: PieDrawer.color_others }, ];
- g.append("path")
- .attr("d", PieDrawer.arc)
- .style("fill", function(d) { return d.data.color; });
+ g.append("path")
+ .attr("d", PieDrawer.arc)
+ .style("fill", function(d) { return d.data.color; });