From 825f79aa6606d8c131cf01b63a4bc8b3ef3d94a0 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 7 Feb 2018 20:35:22 +0100 Subject: [PATCH] router.html: Support babel cost and BATMAN V in neighbor graph This patch uses the absolute value for plotting and removes the graph maximum. A dynamic upper margin is introduced to prevent overlap of data and legend. Signed-off-by: Adrian Schmutzler --- ffmap/web/static/js/graph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmap/web/static/js/graph.js b/ffmap/web/static/js/graph.js index 6d9b05e..af444af 100644 --- a/ffmap/web/static/js/graph.js +++ b/ffmap/web/static/js/graph.js @@ -124,7 +124,7 @@ function neighbour_graph(neighbours) { if(quality == null) { quality = 0; } - data.push([date_value, quality]); + data.push([date_value, Math.abs(quality)]); } catch(TypeError) { // pass @@ -135,7 +135,7 @@ function neighbour_graph(neighbours) { var plot = $.plot(meshstat, pdata, { xaxis: {mode: "time", timezone: "browser"}, selection: {mode: "x"}, - yaxis: {min: 0, max: 400}, + yaxis: {min: 0, autoscaleMargin: 0.5}, legend: {noColumns: 2, hideable: true}, series: {downsample: {threshold: Math.floor(meshstat.width() * points_per_px)}} });