[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Fix visualization bug in user graphs.



commit 1575912022e65ff7710e8879e50e64b5584180fc
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Oct 28 14:39:22 2013 +0100

    Fix visualization bug in user graphs.
---
 rserve/graphs.R |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rserve/graphs.R b/rserve/graphs.R
index 9070308..8a62bf4 100644
--- a/rserve/graphs.R
+++ b/rserve/graphs.R
@@ -689,8 +689,9 @@ plot_direct_users <- function(start, end, country, events, path) {
     if (events == "on") {
       if (length(r$maxusers) > 0)
         max_y <- max(max_y, max(r$maxusers, na.rm = TRUE))
+      r[r$minusers < 0, "minusers"] <- 0
       plot <- plot +
-        geom_ribbon(data = r, aes(ymin = max(0, minusers),
+        geom_ribbon(data = r, aes(ymin = minusers,
             ymax = maxusers), fill = "gray")
     }
     if (length(upturns$date) > 0)
@@ -1085,8 +1086,9 @@ plot_userstats <- function(start, end, node, variable, value, events,
     if (events == "on") {
       if (length(r$maxusers) > 0)
         max_y <- max(max_y, max(r$maxusers, na.rm = TRUE))
+      r[r$minusers < 0, "minusers"] <- 0
       plot <- plot +
-        geom_ribbon(data = r, aes(ymin = max(0, minusers),
+        geom_ribbon(data = r, aes(ymin = minusers,
             ymax = maxusers), fill = "gray")
     }
     if (length(upturns$date) > 0)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits