commit 4bf10226ed42f0bed82e70ba7e3333d637dd92a7 Author: Karsten Loesing karsten.loesing@gmx.net Date: Tue Nov 18 08:57:34 2014 +0100
Remove advertised bandwidth fraction graph.
This graph is going to be removed from Onionoo as part of #13674. Replace it with the middle probability graph. --- js/models/graph.js | 30 +++++++++++++++--------------- js/views/details/main.js | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/js/models/graph.js b/js/models/graph.js index 434ee9d..36f9e49 100644 --- a/js/models/graph.js +++ b/js/models/graph.js @@ -99,11 +99,11 @@ define([ clients_months: {average: []}, clients_year: {average: []}, clients_years: {average: []}, - weights_week: {advbw: [], cw: [], guard: [], exit: []}, - weights_month: {advbw: [], cw: [], guard: [], exit: []}, - weights_months: {advbw: [], cw: [], guard: [], exit: []}, - weights_year: {advbw: [], cw: [], guard: [], exit: []}, - weights_years: {advbw: [], cw: [], guard: [], exit: []} + weights_week: {cw: [], guard: [], middle: [], exit: []}, + weights_month: {cw: [], guard: [], middle: [], exit: []}, + weights_months: {cw: [], guard: [], middle: [], exit: []}, + weights_year: {cw: [], guard: [], middle: [], exit: []}, + weights_years: {cw: [], guard: [], middle: [], exit: []} }); }, lookup_bw: function(fingerprint, options) { @@ -141,11 +141,11 @@ define([ var success = options.success; // Clear the model this.set({ - weights_week: {advbw: [], cw: [], guard: [], exit: []}, - weights_month: {advbw: [], cw: [], guard: [], exit: []}, - weights_months: {advbw: [], cw: [], guard: [], exit: []}, - weights_year: {advbw: [], cw: [], guard: [], exit: []}, - weights_years: {advbw: [], cw: [], guard: [], exit: []} + weights_week: {cw: [], guard: [], middle: [], exit: []}, + weights_month: {cw: [], guard: [], middle: [], exit: []}, + weights_months: {cw: [], guard: [], middle: [], exit: []}, + weights_year: {cw: [], guard: [], middle: [], exit: []}, + weights_years: {cw: [], guard: [], middle: [], exit: []} });
$.getJSON(this.baseurl+'/weights?lookup='+fingerprint, function(data) { @@ -160,11 +160,6 @@ define([ relay = data.bridges[0]; this.fingerprint = relay.fingerprint;
- if ("advertised_bandwidth_fraction" in relay) { - var advbw = parseWeightHistory(relay.advertised_bandwidth_fraction, model, 'advbw'); - model.set({mperiod: {advbw: advbw}}); - } - if ("consensus_weight_fraction" in relay) { var cw = parseWeightHistory(relay.consensus_weight_fraction, model, 'cw'); model.set({mperiod: {cw: cw}}); @@ -175,6 +170,11 @@ define([ model.set({mperiod: {guard: guard}}); }
+ if ("middle_probability" in relay) { + var middle = parseWeightHistory(relay.middle_probability, model, 'middle'); + model.set({mperiod: {middle: middle}}); + } + if ("exit_probability" in relay) { var exit = parseWeightHistory(relay.exit_probability, model, 'exit'); model.set({mperiod: {exit: exit}}); diff --git a/js/views/details/main.js b/js/views/details/main.js index ee12b89..e958e6e 100644 --- a/js/views/details/main.js +++ b/js/views/details/main.js @@ -211,14 +211,14 @@ define([ graphs = ['weights_week', 'weights_month', 'weights_months', 'weights_year', 'weights_years']; _.each(graphs, function(g) { - var data = [graph.get(g).advbw, graph.get(g).cw, + var data = [graph.get(g).cw, graph.get(g).middle, graph.get(g).guard, graph.get(g).exit]; - var labels = ["advertised bandwidth fraction", - "consensus weight fraction", + var labels = ["consensus weight fraction", + "middle probability", "guard probability", "exit probability"]; - var legendPos = [[3, 0], [181, 0], [341, 0], [450, 0]]; - var colors = ["#edc240", "#afd8f8", + var legendPos = [[28, 0], [309, 0], [194, 0], [429, 0]]; + var colors = ["#afd8f8", "#edc240", "#cb4b4b", "#4da74d"]; plot(g, data, labels, legendPos, colors, ".4%", ".6%"); });