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

[or-cvs] [metrics-db/master 2/2] Add metrics website URL to graphs as attribution.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed, 28 Jul 2010 17:17:28 +0200
Subject: Add metrics website URL to graphs as attribution.
Commit: 6420a39a1e529c95fbe93a3fc0521210619bb0bf

---
 R/bridge-stats.R     |    3 ++-
 R/consensus-stats.R  |    6 ++++--
 R/descriptor-stats.R |    7 ++++---
 R/gettor.R           |    3 ++-
 R/torperf.R          |    2 +-
 5 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/R/bridge-stats.R b/R/bridge-stats.R
index c353522..bebb56d 100644
--- a/R/bridge-stats.R
+++ b/R/bridge-stats.R
@@ -4,7 +4,8 @@ suppressPackageStartupMessages(library("ggplot2"))
 plot_bridges <- function(filename, title, limits, code) {
   c <- data.frame(date = bridge$date, users = bridge[[code]])
   ggplot(c, aes(x = as.Date(date, "%Y-%m-%d"), y = users)) +
-    geom_line() + scale_x_date(name = "", limits = limits) +
+    geom_line() + scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";,
+    limits = limits) +
     scale_y_continuous(name = "", limits = c(0, max(bridge[[code]],
     na.rm = TRUE))) +
     opts(title = title)
diff --git a/R/consensus-stats.R b/R/consensus-stats.R
index ba6763d..70c28a5 100644
--- a/R/consensus-stats.R
+++ b/R/consensus-stats.R
@@ -11,7 +11,8 @@ if (file.exists("stats/consensus-stats-raw")) {
     m <- melt(relaysDay[,c(1, 5, 2)], id = "datetime")
     ggplot(m, aes(x = as.POSIXct(datetime, tz = "GMT"), y = value,
       colour = variable)) + geom_point() +
-      scale_x_datetime(name = "", limits = c(from, to)) +
+      scale_x_datetime(name = "\nThe Tor Project - https://metrics.torproject.org/";,
+      limits = c(from, to)) +
       scale_y_continuous(name = "") +
       scale_colour_hue("", breaks = c("running", "exit"),
       labels = c("All relays", "Exit relays")) +
@@ -38,7 +39,8 @@ plot_consensus <- function(directory, filename, title, limits, rows, breaks,
   c <- melt(consensuses[rows], id = "date")
   ggplot(c, aes(x = as.Date(date, "%Y-%m-%d"), y = value,
     colour = variable)) + geom_line() + #stat_smooth() +
-    scale_x_date(name = "", limits = limits) +
+    scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";,
+    limits = limits) +
     #paste("\nhttp://metrics.torproject.org/ -- last updated:",
     #  date(), "UTC"),
     scale_y_continuous(name = "",
diff --git a/R/descriptor-stats.R b/R/descriptor-stats.R
index 3ee5d86..159eb28 100644
--- a/R/descriptor-stats.R
+++ b/R/descriptor-stats.R
@@ -38,7 +38,7 @@ plot_versions <- function() {
 
     # Override the default x axis which would display a label "date" with
     # an x axis that has no label. This line can be commented out.
-    scale_x_date(name = "") +
+    scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";) +
 
     # Override the default y axis with label "value" with one that has no
     # label and that starts at the origin. Note that the max() function is
@@ -73,7 +73,8 @@ plot_platforms <- function() {
   p <- melt(platforms, id = "date")
   ggplot(p, aes(x = date, y = value, colour = variable)) +
     geom_line(size = 1) +
-    scale_x_date(name = "") + scale_y_continuous(name = "",
+    scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";) +
+    scale_y_continuous(name = "",
         limits = c(0, max(p$value, na.rm = TRUE))) +
     scale_colour_brewer(name = "Platform",
         breaks = rev(names(platforms)[2:length(names(platforms))]),
@@ -87,7 +88,7 @@ plot_platforms <- function() {
 # plot_versions() for details.
 plot_bandwidth <- function() {
   ggplot(bandwidth, aes(x = date, y = advbw / 1024)) + geom_line() +
-    scale_x_date(name = "") +
+    scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";) +
     scale_y_continuous(name = "Bandwidth (MiB/s)",
         limits = c(0, max(bandwidth$advbw / 1024, na.rm = TRUE))) +
     opts(title = "Total advertised bandwidth\n")
diff --git a/R/gettor.R b/R/gettor.R
index 7470d26..6ed7a91 100644
--- a/R/gettor.R
+++ b/R/gettor.R
@@ -26,7 +26,8 @@ if (file.exists("stats/gettor-stats")) {
 
   plot_packages <- function(filename, title, data) {
     ggplot(data, aes(x = as.Date(date, "%Y-%m-%d"), y = packages)) + geom_line() +
-      scale_x_date(name = "", limits = c(start, end)) +
+      scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";,
+      limits = c(start, end)) +
       scale_y_continuous(name = "",
       limits = c(0, max(data$packages, na.rm = TRUE))) +
       opts(title = paste(title, "\n", sep = ""))
diff --git a/R/torperf.R b/R/torperf.R
index 0b5332c..51ba985 100644
--- a/R/torperf.R
+++ b/R/torperf.R
@@ -44,7 +44,7 @@ if (file.exists("stats/torperf-stats")) {
           geom_line(colour = colors[sourceInd], size = 0.75) +
           geom_ribbon(data = u, aes(x = date, ymin = q1/1e3,
             ymax = q3/1e3, fill = "ribbon")) +
-          scale_x_date(name = "") +
+          scale_x_date(name = "\nThe Tor Project - https://metrics.torproject.org/";) +
           scale_y_continuous(name = "", limits = c(0, maxy / 1e3)) +
           coord_cartesian(ylim = c(0, 0.8 * maxy / 1e3)) +
           scale_fill_manual(name = paste("Measured times on",
-- 
1.7.1