Christopher Johnson (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/238739
Change subject: removes smoothing adds mailing lists
......................................................................
removes smoothing
adds mailing lists
Change-Id: I1c255098a4985efe10c50095f694cb4324e925d2
---
A assets/content/wikidata_mailing_lists.md
A data/wikidata_mailing_lists.tsv
M server.R
M ui.R
M utils.R
5 files changed, 86 insertions(+), 53 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikidata/analytics/dashboard
refs/changes/39/238739/1
diff --git a/assets/content/wikidata_mailing_lists.md
b/assets/content/wikidata_mailing_lists.md
new file mode 100644
index 0000000..0e8874b
--- /dev/null
+++ b/assets/content/wikidata_mailing_lists.md
@@ -0,0 +1,8 @@
+Mailing Lists
+=======
+
+* Type: Aggregate
+* Source:
+* Update Interval:
+* Reliability:
+* Description:
diff --git a/data/wikidata_mailing_lists.tsv b/data/wikidata_mailing_lists.tsv
new file mode 100644
index 0000000..ba1c3d5
--- /dev/null
+++ b/data/wikidata_mailing_lists.tsv
@@ -0,0 +1,44 @@
+date mailing list subscribers -l mailing list subscribers -tech mailing
list messages -l mailing list messages -tech newsletter subscribers
+2012-03-06 67 0 1 0 0
+2012-03-16 117 0 0 0
+2012-04-01 343 0 212 0 0
+2012-05-01 425 0 355 0 0
+2012-06-01 454 0 144 0 0
+2012-07-01 459 0 199 0 0
+2012-07-19 490 0 54 0 0
+2012-08-01 494 0 72 0 0
+2012-09-03 502 0 124 0 52
+2012-10-01 514 0 97 0 66
+2012-11-01 540 0 92 0 84
+2012-12-01 590 0 150 0 103
+2013-01-01 590 0 197 0 121
+2013-01-15 599 0 69 0 130
+2013-02-01 622 0 164 0 136
+2013-02-14 642 0 58 0 144
+2013-03-01 649 0 101 0 185
+2013-03-28 689 0 172 0 229
+2013-04-01 690 0 190 0 231
+2013-04-25 706 0 184 0 256
+2013-05-04 732 0 215 0 267
+2013-05-29 749 60 103 12 264
+2013-06-27 754 67 130 56 264
+2013-08-15 760 75 129 84 257
+2013-09-03 761 75 215 81 258
+2013-10-01 767 81 135 64 256
+2013-11-02 786 90 141 11 254
+2013-12-01 797 99 139 14 256
+2014-01-01 810 102 70 24 260
+2014-01-29 820 107 80 23 261
+2014-03-09 841 113 93 51 261
+2014-04-09 835 115 181 10 264
+2014-05-01 839 119 125 9 267
+2014-06-23 854 131 167 12 266
+2014-09-25 903 148 244 27 265
+2014-12-23 940 163 96 18 272
+2015-01-09 954 163 139 18 273
+2015-03-03 975 175 150 10 270
+2015-04-01 989 184 214 40 269
+2015-05-04 1001 192 299 4 274
+2015-06-11 986 198 271 7 275
+2015-07-12 988 199 287 9 276
+2015-08-14 988 203 219 7 284
diff --git a/server.R b/server.R
index e6dd5b1..e527eb9 100644
--- a/server.R
+++ b/server.R
@@ -21,6 +21,9 @@
data <- download_set("wikidata-social-media.tsv")
wikidata_social_media <<- data
+ data <- download_set("wikidata_mailing_lists.tsv")
+ wikidata_mailing_lists <<- data
+
data <- download_set("wikidata-content-overview.tsv")
wikidata_content_overview <<- data
@@ -62,19 +65,14 @@
}
output$wikidata_edits_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_edits
make_dygraph(wikidata_edits,
- "", "Edits", "Wikidata Edits",
- smoothing = ifelse(smooth_level == "global",
input$smoothing_global, smooth_level))
+ "", "Edits", "Wikidata Edits")
})
output$wikidata_pages_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_pages
make_dygraph(wikidata_pages,
- "", "Pages", "Wikidata Pages", legend_name = "pages",
- smoothing = ifelse(smooth_level == "global",
input$smoothing_global, smooth_level))
+ "", "Pages", "Wikidata Pages", legend_name = "pages")
})
output$wikidata_properties_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_properties
wikidata_properties<- xts(wikidata_properties[, -1], wikidata_properties[,
1])
return(dygraph(wikidata_properties,
main = "Wikidata Properties",
@@ -89,18 +87,32 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_active_users_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_active_users
make_dygraph(wikidata_active_users,
- "", "Active Users", "Wikidata Active Users", legend_name =
"active users",
- smoothing = ifelse(smooth_level == "global",
input$smoothing_global, smooth_level))
+ "", "Active Users", "Wikidata Active Users", legend_name =
"active users")
})
output$wikidata_social_media_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_social_media
wikidata_social_media <- xts(wikidata_social_media[, -1],
wikidata_social_media[, 1])
- return(dygraph(wikidata_social_media))
+ return(dygraph(wikidata_social_media,
+ main = "Wikidata Social Media",
+ ylab = "Lists") %>%
+ dyLegend(width = 400, show = "always", labelsDiv =
"legend_social_media", labelsSeparateLines = TRUE) %>%
+ dyOptions(useDataTimezone = TRUE,
+ labelsKMB = TRUE,
+ strokeWidth = 2, colors = brewer.pal(5, "Set2")[5:1])
%>%
+ dyCSS(css = "./assets/css/custom.css"))
+ })
+ output$wikidata_mailing_lists_plot <- renderDygraph({
+ wikidata_mailing_lists <- xts(wikidata_mailing_lists[, -1],
wikidata_mailing_lists[, 1])
+ return(dygraph(wikidata_mailing_lists,
+ main = "Wikidata Mailing Lists",
+ ylab = "Lists") %>%
+ dyLegend(width = 400, show = "always", labelsDiv =
"legend_lists", labelsSeparateLines = TRUE) %>%
+ dyOptions(useDataTimezone = TRUE,
+ labelsKMB = TRUE,
+ strokeWidth = 2, colors = brewer.pal(5, "Set2")[5:1])
%>%
+ dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_overview_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_overview
wikidata_content_overview<- xts(wikidata_content_overview[, -1],
wikidata_content_overview[, 1])
return(dygraph(wikidata_content_overview,
main = "Wikidata Content Overview",
@@ -112,7 +124,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_refstmts_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_refstmts
wikidata_content_refstmts<- xts(wikidata_content_refstmts[, -1],
wikidata_content_refstmts[, 1])
return(dygraph(wikidata_content_refstmts,
main = "Referenced Statements by Type",
@@ -125,7 +136,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_refstmts_wikipedia_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_refstmts_wikipedia
wikidata_content_refstmts_wikipedia<-
xts(wikidata_content_refstmts_wikipedia[, -1],
wikidata_content_refstmts_wikipedia[, 1])
return(dygraph(wikidata_content_refstmts_wikipedia,
main = "Referenced Statements to Wikipedia by Type",
@@ -138,7 +148,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_refstmts_other_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_refstmts_other
wikidata_content_refstmts_other<- xts(wikidata_content_refstmts_other[,
-1], wikidata_content_refstmts_other[, 1])
return(dygraph(wikidata_content_refstmts_other,
main = "Referenced Statements to Other Sources by Type",
@@ -151,7 +160,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_references_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_references
wikidata_content_references<- xts(wikidata_content_references[, -1],
wikidata_content_references[, 1])
return(dygraph(wikidata_content_references,
main = "References by Type",
@@ -164,7 +172,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_statement_ranks_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_statement_ranks
wikidata_content_statement_ranks<- xts(wikidata_content_statement_ranks[,
-1], wikidata_content_statement_ranks[, 1])
return(dygraph(wikidata_content_statement_ranks,
main = "Statement Ranks",
@@ -177,7 +184,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_statement_item_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_statement_item
wikidata_content_statement_item<- xts(wikidata_content_statement_item[,
-1], wikidata_content_statement_item[, 1])
return(dygraph(wikidata_content_statement_item,
main = "Statements per Item",
@@ -190,7 +196,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_labels_item_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_labels_item
wikidata_content_labels_item<- xts(wikidata_content_labels_item[, -1],
wikidata_content_labels_item[, 1])
return(dygraph(wikidata_content_labels_item,
main = "Labels per Item",
@@ -203,7 +208,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_descriptions_item_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_descriptions_item
wikidata_content_descriptions_item<-
xts(wikidata_content_descriptions_item[, -1],
wikidata_content_descriptions_item[, 1])
return(dygraph(wikidata_content_descriptions_item,
main = "Descriptions per Item",
@@ -216,7 +220,6 @@
dyCSS(css = "./assets/css/custom.css"))
})
output$wikidata_content_wikilinks_item_plot <- renderDygraph({
- smooth_level <- input$smoothing_wikidata_content_wikilinks_item
wikidata_content_wikilinks_item<- xts(wikidata_content_wikilinks_item[, -1],
wikidata_content_wikilinks_item[, 1])
return(dygraph(wikidata_content_wikilinks_item,
main = "Wikilinks per Item",
diff --git a/ui.R b/ui.R
index f892ec2..526de69 100644
--- a/ui.R
+++ b/ui.R
@@ -18,7 +18,8 @@
menuSubItem(text = "Pages", tabName = "wikidata_pages"),
menuSubItem(text = "Properties", tabName = "wikidata_properties"),
menuSubItem(text = "Active Users", tabName =
"wikidata_active_users"),
- menuSubItem(text = "Social Media", tabName =
"wikidata_social_media")),
+ menuSubItem(text = "Social Media", tabName =
"wikidata_social_media"),
+ menuSubItem(text = "Mailing Lists", tabName =
"wikidata_mailing_lists")),
menuItem(text = "Content",
menuSubItem(text = "Overview", tabName =
"wikidata_content_overview"),
menuSubItem(text = "Referenced statements", tabName =
"wikidata_content_refstmts"),
@@ -29,44 +30,33 @@
menuSubItem(text = "Statements per item", tabName =
"wikidata_content_statement_item"),
menuSubItem(text = "Labels per item", tabName =
"wikidata_content_labels_item"),
menuSubItem(text = "Descriptions per item", tabName =
"wikidata_content_descriptions_item"),
- menuSubItem(text = "Wiki(m|p)edia links per item", tabName =
"wikidata_content_wikilinks_item")),
- selectInput(inputId = "smoothing_global", label = "Smoothing (Global
Setting)", selectize = TRUE, selected = "day",
- choices = c("No Smoothing" = "day", "Moving Average" =
"moving_avg",
- "Weekly Median" = "week", "Monthly Median" =
"month"))
+ menuSubItem(text = "Wiki(m|p)edia links per item", tabName =
"wikidata_content_wikilinks_item"))
)
)
-
-# Standardised input selector for smoothing
-smooth_select <- function(input_id, label = "Smoothing") {
- return(selectInput(inputId = input_id, label = label, selectize = TRUE,
- selected = "global", choices = c("Use Global Setting" =
"global",
- "No Smoothing" = "day", "Moving Average" = "moving_avg",
- "Weekly Median" = "week", "Monthly Median" = "month")))
-}
#Body elements for the visualisations.
body <- dashboardBody(
tabItems(
tabItem(tabName = "wikidata_edits",
- smooth_select("smoothing_wikidata_edits"),
dygraphOutput("wikidata_edits_plot"),
includeMarkdown("./assets/content/wikidata-edits.md")),
tabItem(tabName = "wikidata_pages",
- smooth_select("smoothing_wikidata_pages"),
dygraphOutput("wikidata_pages_plot"),
includeMarkdown("./assets/content/wikidata-pages.md")),
tabItem(tabName = "wikidata_properties",
- smooth_select("smoothing_wikidata_properties"),
dygraphOutput("wikidata_properties_plot"),
includeMarkdown("./assets/content/wikidata-properties.md")),
tabItem(tabName = "wikidata_active_users",
- smooth_select("smoothing_wikidata_active_users"),
dygraphOutput("wikidata_active_users_plot"),
includeMarkdown("./assets/content/wikidata-active-users.md")),
tabItem(tabName = "wikidata_social_media",
- smooth_select("smoothing_wikidata_social_media"),
dygraphOutput("wikidata_social_media_plot"),
+ htmlOutput("legend_social_media"),
includeMarkdown("./assets/content/wikidata-social-media.md")),
+ tabItem(tabName = "wikidata_mailing_lists",
+ dygraphOutput("wikidata_mailing_lists_plot"),
+ htmlOutput("legend_lists"),
+ includeMarkdown("./assets/content/wikidata_mailing_lists.md")),
tabItem(tabName = "wikidata_content_overview",
dygraphOutput("wikidata_content_overview_plot"),
htmlOutput("legend"),
diff --git a/utils.R b/utils.R
index 396eab5..cb6be95 100644
--- a/utils.R
+++ b/utils.R
@@ -72,19 +72,7 @@
#Create a dygraph using our standard format.
make_dygraph <- function(data, x, y, title, is_single = FALSE, legend_name =
NULL, use_si = TRUE, smoothing = "day") {
- # cat("Making dygraph:", title, "\n"); # Debugging
- if (is_single) {
- data <- smoother(as.data.frame(data[, c(1, 3)]), smooth_level = smoothing)
- data <- xts(data[, 2], data[, 1])
- if (is.null(legend_name)) {
- names(data) <- "events"
- } else {
- names(data) <- legend_name
- }
- } else {
- data %<>% smoother(smooth_level = smoothing)
- data <- xts(data[, -1], order.by = data[, 1])
- }
+ data <- xts(data[, -1], order.by = data[, 1])
return(dygraph(data, main = title, xlab = x, ylab = y) %>%
dySeries("V1", label = y) %>%
dyLegend(width = 400, show = "always") %>%
--
To view, visit https://gerrit.wikimedia.org/r/238739
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c255098a4985efe10c50095f694cb4324e925d2
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/analytics/dashboard
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits