Commit 4bf10226 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

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.
parent a829ef74
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -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}});
+5 −5
Original line number Diff line number Diff line
@@ -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%");
                        });