[tor-commits] [atlas/master] Do not plot empty graphs

irl at torproject.org irl at torproject.org
Thu Mar 2 13:29:54 UTC 2017


commit 3211eabe844ebbd0969940e5a399b0ce01c01728
Author: Raphael Bergmann <raphael at cc-ltd.net>
Date:   Thu Mar 2 12:06:00 2017 +0100

    Do not plot empty graphs
---
 js/views/details/main.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/js/views/details/main.js b/js/views/details/main.js
index f95e015..cc4d51a 100644
--- a/js/views/details/main.js
+++ b/js/views/details/main.js
@@ -26,6 +26,9 @@ define([
         plot: function(g, data, labels, legendPos, colors, tickFormat,
                        tooltipFormat) {
 
+            /* do not plot graph if there is no data */
+            if (data[0].length==0) return;
+
             /* Initialize graph. */
             var margin = {top: 30, right: 10, bottom: 20, left: 60},
                 width = 550 - margin.left - margin.right,



More information about the tor-commits mailing list