Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
......................................................................


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I9622c4a14cb2c4094574a3e1d1c9d3778d6e418f
---
A global.R
M server.R
M ui.R
M wetzel.Rproj
M www/custom.js
5 files changed, 144 insertions(+), 160 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/global.R b/global.R
new file mode 100644
index 0000000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index f828305..43bad95 100644
--- a/server.R
+++ b/server.R
@@ -4,7 +4,7 @@
 
 # Actual server code.
 shinyServer(function(input, output, session) {
-  
+
   if(Sys.Date() != existing_date){
     read_actions()
     read_users()
@@ -12,14 +12,7 @@
     read_countries()
     existing_date <<- Sys.Date()
   }
-  
-  shinyURL.server(session)
-  
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-    return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
+
   output$tiles_summary_series <- renderDygraph({
     temp <- polloi::data_select(input$tile_summary_automata_check, 
new_tiles_automata, new_tiles_no_automata) %>%
     ddply(.(date), summarize,
@@ -41,52 +34,48 @@
       dyEvent(as.Date("2016-01-08"), "B (enwiki launch)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-01-12"), "C (cache clear)", labelLoc = "bottom")
   })
-  
+
   output$tiles_style_series <- renderDygraph({
     polloi::data_select(input$tile_style_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
     ddply(.(date, style), summarize, `total tiles` = sum(total)) %>%
       tidyr::spread(style, `total tiles`, fill = 0) %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_style_series)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$tiles_style_series_timeframe,
 input$tiles_style_series_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Tiles", "Total tiles by style", 
legend_name = "Style") %>%
       dyLegend(labelsDiv = "tiles_style_series_legend", show = "always") %>%
       dyRangeSelector %>%
       dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$tiles_users_series <- renderDygraph({
     polloi::data_select(input$tile_users_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
       ddply(.(date, style), summarize, `total users` = sum(users)) %>%
       tidyr::spread(style, `total users`, fill = 0) %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_users_series)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$tiles_users_series_timeframe,
 input$tiles_users_series_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Users", "Total users by style") %>%
       dyLegend(labelsDiv = "tiles_users_series_legend", show = "always") %>%
       dyRangeSelector %>%
       dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$zoom_level_selector_container <- renderUI({
     selectInput("zoom_level_selector", "Zoom level",
                 multiple = TRUE, selected = "0", selectize = FALSE, size = 19,
                 choices = 
as.character(sort(unique(new_tiles_no_automata$zoom))))
   })
-  
+
   output$tiles_zoom_series <- renderDygraph({
     polloi::data_select(input$tile_zoom_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
       subset(zoom %in% as.numeric(input$zoom_level_selector)) %>%
       ddply(.(date, zoom), summarize, `total tiles` = sum(total)) %>%
       tidyr::spread(zoom, `total tiles`, fill = 0) %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_zoom_series)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$tiles_zoom_series_timeframe,
 input$tiles_zoom_series_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Tiles", "Total tiles by zoom level") %>%
       dyLegend(labelsDiv = "tiles_zoom_series_legend", show = "always")
   })
-  
+
   output$users_per_platform <- renderDygraph({
     user_data %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_users_per_platform)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$users_per_platform_timeframe,
 input$users_per_platform_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Events", "Unique users by platform, by 
day") %>%
       dyLegend(labelsDiv = "users_per_platform_legend", show = "always") %>%
       dyRangeSelector %>%
@@ -94,60 +83,55 @@
       dyEvent(as.Date("2016-04-15"), "A (Maps EL bug)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-06-17"), "A (Maps EL patch)", labelLoc = "bottom")
   })
-  
+
   output$geohack_feature_usage <- renderDygraph({
     usage_data$GeoHack %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_geohack_feature_usage)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$geohack_feature_usage_timeframe,
 input$geohack_feature_usage_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Events", "Feature usage for GeoHack") %>%
       dyRangeSelector %>%
       dyAxis("y", logscale = input$geohack_feature_usage_logscale) %>%
       dyEvent(as.Date("2016-04-15"), "A (Maps EL bug)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-06-17"), "A (Maps EL patch)", labelLoc = "bottom")
   })
-  
+
   output$wikiminiatlas_feature_usage <- renderDygraph({
     usage_data$WikiMiniAtlas %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_wikiminiatlas_feature_usage)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$wikiminiatlas_feature_usage_timeframe,
 input$wikiminiatlas_feature_usage_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Events", "Feature usage for 
WikiMiniAtlas") %>%
       dyRangeSelector %>%
       dyAxis("y", logscale = input$wikiminiatlas_feature_usage_logscale) %>%
       dyEvent(as.Date("2016-04-15"), "A (Maps EL bug)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-06-17"), "A (Maps EL patch)", labelLoc = "bottom")
   })
-  
+
   output$wikivoyage_feature_usage <- renderDygraph({
     usage_data$Wikivoyage %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_wikivoyage_feature_usage)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$wikivoyage_feature_usage_timeframe,
 input$wikivoyage_feature_usage_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Events", "Feature usage for Wikivoyage") 
%>%
       dyRangeSelector %>%
       dyAxis("y", logscale = input$wikivoyage_feature_usage_logscale) %>%
       dyEvent(as.Date("2016-04-15"), "A (Maps EL bug)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-06-17"), "A (Maps EL patch)", labelLoc = "bottom")
   })
-  
+
   output$wiwosm_feature_usage <- renderDygraph({
     usage_data$WIWOSM %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_wiwosm_feature_usage)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$wiwosm_feature_usage_timeframe,
 input$wiwosm_feature_usage_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Events", "Feature usage for WIWOSM") %>%
       dyRangeSelector %>%
       dyAxis("y", logscale = input$wiwosm_feature_usage_logscale) %>%
       dyEvent(as.Date("2016-04-15"), "A (Maps EL bug)", labelLoc = "bottom") 
%>%
       dyEvent(as.Date("2016-06-17"), "A (Maps EL patch)", labelLoc = "bottom")
   })
-  
-  
+
+
   output$users_by_country <- renderDygraph({
     country_data %>%
       polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_users_by_country)) %>%
-      
polloi::subset_by_date_range(time_frame_range(input$users_by_country_timeframe, 
input$users_by_country_timeframe_daterange)) %>%
       polloi::make_dygraph("Date", "Users (%)", "Geographic breakdown of maps 
users") %>%
       dyRangeSelector(fillColor = "", strokeColor = "")
   })
-  
+
   # Check datasets for missing data and notify user which datasets are missing 
data (if any)
   output$message_menu <- renderMenu({
     notifications <- list(
@@ -160,5 +144,5 @@
     notifications <- notifications[!sapply(notifications, is.null)]
     return(dropdownMenu(type = "notifications", .list = notifications, 
badgeStatus = "warning"))
   })
-  
+
 })
diff --git a/ui.R b/ui.R
index 96d39d9..8d7f581 100644
--- a/ui.R
+++ b/ui.R
@@ -1,136 +1,129 @@
 library(shiny)
 library(shinydashboard)
 library(dygraphs)
-library(shinyURL)
 
-header <- dashboardHeader(title = "Wikimedia Maps", 
dropdownMenuOutput("message_menu"), disable = FALSE)
+function(request) {
+  dashboardPage(
 
-sidebar <- dashboardSidebar(
-  tags$head(
-    tags$link(rel = "stylesheet", type = "text/css", href = "stylesheet.css"),
-    tags$script(src = "custom.js")
-  ),
-  sidebarMenu(
-    menuItem(text = "Tiles",
-             menuSubItem(text = "Summary", tabName = "tiles_summary"),
-             menuSubItem(text = "Tiles by style", tabName = 
"tiles_total_by_style"),
-             menuSubItem(text = "Users by style", tabName = 
"tiles_users_by_style"),
-             menuSubItem(text = "Tiles by zoom level", tabName = 
"tiles_total_by_zoom")),
-    menuItem(text = "Platform usage", tabName = "platform_usage"),
-    menuItem(text = "Feature usage",
-             menuSubItem(text = "GeoHack", tabName = "geohack_usage"),
-             menuSubItem(text = "WikiMiniAtlas", tabName = 
"wikiminiatlas_usage"),
-             menuSubItem(text = "Wikivoyage", tabName = "wikivoyage_usage"),
-             menuSubItem(text = "WIWOSM", tabName = "wiwosm_usage")),
-    menuItem(text = "Geographic breakdown", tabName = "geo_breakdown"),
-    menuItem(text = "Global Settings",
-             selectInput(inputId = "smoothing_global", label = "Smoothing", 
selectize = TRUE, selected = "day",
-                         choices = c("No Smoothing" = "day", "Weekly Median" = 
"week", "Monthly Median" = "month", "Splines" = "gam")),
-             selectInput(inputId = "timeframe_global", label = "Time Frame", 
selectize = TRUE, selected = "",
-                         choices = c("All available data" = "all", "Last 7 
days" = "week", "Last 30 days" = "month",
-                                     "Last 90 days" = "quarter", "Custom" = 
"custom")),
-             conditionalPanel("input.timeframe_global == 'custom'",
-                              dateRangeInput("daterange_global", label = 
"Custom Date Range",
-                                             start = Sys.Date()-11, end = 
Sys.Date()-1, min = "2015-04-14")),
-             icon = icon("cog", lib = "glyphicon")),
-    menuItem(text = "Sharing Options",
-             shinyURL.ui(tinyURL = FALSE),
-             p("Dashboard settings stored in URL.", style = "padding-bottom: 
10px;"),
-             icon = icon("share-alt", lib = "glyphicon"))
-  ),
-  div(icon("info-sign", lib = "glyphicon"), HTML("<strong>Tip</strong>: you 
can drag on the graphs with your mouse to zoom in on a particular date 
range."), style = "padding: 10px; color: white;")
-)
+    dashboardHeader(title = "Wikimedia Maps", 
dropdownMenuOutput("message_menu"), disable = FALSE),
 
-body <- dashboardBody(
-  tabItems(
-    tabItem(tabName = "tiles_summary",
-            fluidRow(
-              column(selectInput("tiles_summary_variable", "Total", c("Users", 
"Tiles")), width = 2),
-              column(polloi::smooth_select("smoothing_tiles_summary_series"), 
width = 3),
-              
column(polloi::timeframe_select("tiles_summary_series_timeframe"), width = 3),
-              
column(polloi::timeframe_daterange("tiles_summary_series_timeframe"), width = 
4)),
-            polloi::automata_select("tile_summary_automata_check"),
-            dygraphOutput("tiles_summary_series"),
-            div(id = "tiles_summary_series_legend", style = "text-align: 
right;"),
-            includeMarkdown("./tab_documentation/tiles_summary.md")),
-    tabItem(tabName = "tiles_total_by_style",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_tiles_style_series"), 
width = 4),
-              column(polloi::timeframe_select("tiles_style_series_timeframe"), 
width = 4),
-              
column(polloi::timeframe_daterange("tiles_style_series_timeframe"), width = 4)),
-            polloi::automata_select("tile_style_automata_check"),
-            dygraphOutput("tiles_style_series"),
-            div(id = "tiles_style_series_legend", style = "text-align: 
right;"),
-            includeMarkdown("./tab_documentation/tiles_total_by_style.md")),
-    tabItem(tabName = "tiles_users_by_style",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_tiles_users_series"), 
width = 4),
-              column(polloi::timeframe_select("tiles_users_series_timeframe"), 
width = 4),
-              
column(polloi::timeframe_daterange("tiles_users_series_timeframe"), width = 4)),
-            polloi::automata_select("tile_users_automata_check"),
-            dygraphOutput("tiles_users_series"),
-            div(id = "tiles_users_series_legend", style = "text-align: 
right;"),
-            includeMarkdown("./tab_documentation/tiles_users_by_style.md")),
-    tabItem(tabName = "tiles_total_by_zoom",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_tiles_zoom_series"), 
width = 4),
-              column(polloi::timeframe_select("tiles_zoom_series_timeframe"), 
width = 4),
-              
column(polloi::timeframe_daterange("tiles_zoom_series_timeframe"), width = 4)),
-            fluidRow(column(uiOutput("zoom_level_selector_container"), width = 
3),
-                     column(dygraphOutput("tiles_zoom_series"), width = 8)),
-            polloi::automata_select("tile_zoom_automata_check"),
-            div(id = "tiles_zoom_series_legend", style = "text-align: right;"),
-            includeMarkdown("./tab_documentation/tiles_total_by_zoom.md")),
-    tabItem(tabName = "platform_usage",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_users_per_platform"), 
width = 3),
-              column(polloi::timeframe_select("users_per_platform_timeframe"), 
width = 3),
-              
column(polloi::timeframe_daterange("users_per_platform_timeframe"), width = 3),
-              column(checkboxInput("users_per_platform_logscale", "Use Log 
scale", FALSE), width = 3)),
-            dygraphOutput("users_per_platform"),
-            div(id = "users_per_platform_legend", style = "text-align: 
right;"),
-            includeMarkdown("./tab_documentation/unique_users.md")),
-    tabItem(tabName = "geohack_usage",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_geohack_feature_usage"), 
width = 3),
-              
column(polloi::timeframe_select("geohack_feature_usage_timeframe"), width = 3),
-              
column(polloi::timeframe_daterange("geohack_feature_usage_timeframe"), width = 
3),
-              column(checkboxInput("geohack_feature_usage_logscale", "Use Log 
scale", FALSE), width = 3)),
-            dygraphOutput("geohack_feature_usage"),
-            includeMarkdown("./tab_documentation/geohack_usage.md")),
-    tabItem(tabName = "wikiminiatlas_usage",
-            fluidRow(
-              
column(polloi::smooth_select("smoothing_wikiminiatlas_feature_usage"), width = 
3),
-              
column(polloi::timeframe_select("wikiminiatlas_feature_usage_timeframe"), width 
= 3),
-              
column(polloi::timeframe_daterange("wikiminiatlas_feature_usage_timeframe"), 
width = 3),
-              column(checkboxInput("wikiminiatlas_feature_usage_logscale", 
"Use Log scale", FALSE), width = 3)),
-            dygraphOutput("wikiminiatlas_feature_usage"),
-            includeMarkdown("./tab_documentation/wikiminiatlas_usage.md")),
-    tabItem(tabName = "wikivoyage_usage",
-            fluidRow(
-              
column(polloi::smooth_select("smoothing_wikivoyage_feature_usage"), width = 3),
-              
column(polloi::timeframe_select("wikivoyage_feature_usage_timeframe"), width = 
3),
-              
column(polloi::timeframe_daterange("wikivoyage_feature_usage_timeframe"), width 
= 3),
-              column(checkboxInput("wikivoyage_feature_usage_logscale", "Use 
Log scale", FALSE), width = 3)),
-            dygraphOutput("wikivoyage_feature_usage"),
-            includeMarkdown("./tab_documentation/wikivoyage_usage.md")),
-    tabItem(tabName = "wiwosm_usage",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_wiwosm_feature_usage"), 
width = 3),
-              
column(polloi::timeframe_select("wiwosm_feature_usage_timeframe"), width = 3),
-              
column(polloi::timeframe_daterange("wiwosm_feature_usage_timeframe"), width = 
3),
-              column(checkboxInput("wiwosm_feature_usage_logscale", "Use Log 
scale", FALSE), width = 3)),
-            dygraphOutput("wiwosm_feature_usage"),
-            includeMarkdown("./tab_documentation/wiwosm_usage.md")),
-    tabItem(tabName = "geo_breakdown",
-            fluidRow(
-              column(polloi::smooth_select("smoothing_users_by_country"), 
width = 4),
-              column(polloi::timeframe_select("users_by_country_timeframe"), 
width = 4),
-              
column(polloi::timeframe_daterange("users_by_country_timeframe"), width = 4)),
-            dygraphOutput("users_by_country"),
-            includeMarkdown("./tab_documentation/geo_breakdown.md"))
-  )
-)
+    dashboardSidebar(
+      tags$head(
+        tags$link(rel = "stylesheet", type = "text/css", href = 
"stylesheet.css"),
+        tags$script(src = "custom.js")
+      ),
+      sidebarMenu(id = "tabs",
+                  menuItem(text = "Tiles",
+                           menuSubItem(text = "Summary", tabName = 
"tiles_summary"),
+                           menuSubItem(text = "Tiles by style", tabName = 
"tiles_total_by_style"),
+                           menuSubItem(text = "Users by style", tabName = 
"tiles_users_by_style"),
+                           menuSubItem(text = "Tiles by zoom level", tabName = 
"tiles_total_by_zoom")),
+                  menuItem(text = "Platform usage", tabName = 
"platform_usage"),
+                  menuItem(text = "Feature usage",
+                           menuSubItem(text = "GeoHack", tabName = 
"geohack_usage"),
+                           menuSubItem(text = "WikiMiniAtlas", tabName = 
"wikiminiatlas_usage"),
+                           menuSubItem(text = "Wikivoyage", tabName = 
"wikivoyage_usage"),
+                           menuSubItem(text = "WIWOSM", tabName = 
"wiwosm_usage")),
+                  menuItem(text = "Geographic breakdown", tabName = 
"geo_breakdown"),
+                  menuItem(text = "Global Settings",
+                           selectInput(inputId = "smoothing_global", label = 
"Smoothing", selectize = TRUE, selected = "day",
+                                       choices = c("No Smoothing" = "day", 
"Weekly Median" = "week", "Monthly Median" = "month", "Splines" = "gam")),
+                           icon = icon("cog", lib = "glyphicon"))
+      ),
+      div(icon("info-sign", lib = "glyphicon"), HTML("<strong>Tip</strong>: 
you can drag on the graphs with your mouse to zoom in on a particular date 
range."), style = "padding: 10px; color: white;"),
+      div(bookmarkButton(), style = "text-align: center;")
+    ),
 
-dashboardPage(header, sidebar, body, skin = "green",
-              title = "Maps Usage Dashboard | Discovery | Engineering | 
Wikimedia Foundation")
+    dashboardBody(
+      tabItems(
+        tabItem(tabName = "tiles_summary",
+                fluidRow(
+                  column(selectInput("tiles_summary_variable", "Total", 
c("Users", "Tiles")), width = 2),
+                  
column(polloi::smooth_select("smoothing_tiles_summary_series"), width = 3),
+                  
column(polloi::timeframe_select("tiles_summary_series_timeframe"), width = 3),
+                  
column(polloi::timeframe_daterange("tiles_summary_series_timeframe"), width = 
4)),
+                polloi::automata_select("tile_summary_automata_check"),
+                dygraphOutput("tiles_summary_series"),
+                div(id = "tiles_summary_series_legend", style = "text-align: 
right;"),
+                includeMarkdown("./tab_documentation/tiles_summary.md")),
+        tabItem(tabName = "tiles_total_by_style",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_tiles_style_series"), width = 4),
+                  
column(polloi::timeframe_select("tiles_style_series_timeframe"), width = 4),
+                  
column(polloi::timeframe_daterange("tiles_style_series_timeframe"), width = 4)),
+                polloi::automata_select("tile_style_automata_check"),
+                dygraphOutput("tiles_style_series"),
+                div(id = "tiles_style_series_legend", style = "text-align: 
right;"),
+                
includeMarkdown("./tab_documentation/tiles_total_by_style.md")),
+        tabItem(tabName = "tiles_users_by_style",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_tiles_users_series"), width = 4),
+                  
column(polloi::timeframe_select("tiles_users_series_timeframe"), width = 4),
+                  
column(polloi::timeframe_daterange("tiles_users_series_timeframe"), width = 4)),
+                polloi::automata_select("tile_users_automata_check"),
+                dygraphOutput("tiles_users_series"),
+                div(id = "tiles_users_series_legend", style = "text-align: 
right;"),
+                
includeMarkdown("./tab_documentation/tiles_users_by_style.md")),
+        tabItem(tabName = "tiles_total_by_zoom",
+                fluidRow(
+                  column(polloi::smooth_select("smoothing_tiles_zoom_series"), 
width = 4),
+                  
column(polloi::timeframe_select("tiles_zoom_series_timeframe"), width = 4),
+                  
column(polloi::timeframe_daterange("tiles_zoom_series_timeframe"), width = 4)),
+                fluidRow(column(uiOutput("zoom_level_selector_container"), 
width = 3),
+                         column(dygraphOutput("tiles_zoom_series"), width = 
8)),
+                polloi::automata_select("tile_zoom_automata_check"),
+                div(id = "tiles_zoom_series_legend", style = "text-align: 
right;"),
+                includeMarkdown("./tab_documentation/tiles_total_by_zoom.md")),
+        tabItem(tabName = "platform_usage",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_users_per_platform"), width = 3),
+                  
column(polloi::timeframe_select("users_per_platform_timeframe"), width = 3),
+                  
column(polloi::timeframe_daterange("users_per_platform_timeframe"), width = 3),
+                  column(checkboxInput("users_per_platform_logscale", "Use Log 
scale", FALSE), width = 3)),
+                dygraphOutput("users_per_platform"),
+                div(id = "users_per_platform_legend", style = "text-align: 
right;"),
+                includeMarkdown("./tab_documentation/unique_users.md")),
+        tabItem(tabName = "geohack_usage",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_geohack_feature_usage"), width = 3),
+                  
column(polloi::timeframe_select("geohack_feature_usage_timeframe"), width = 3),
+                  
column(polloi::timeframe_daterange("geohack_feature_usage_timeframe"), width = 
3),
+                  column(checkboxInput("geohack_feature_usage_logscale", "Use 
Log scale", FALSE), width = 3)),
+                dygraphOutput("geohack_feature_usage"),
+                includeMarkdown("./tab_documentation/geohack_usage.md")),
+        tabItem(tabName = "wikiminiatlas_usage",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_wikiminiatlas_feature_usage"), width = 
3),
+                  
column(polloi::timeframe_select("wikiminiatlas_feature_usage_timeframe"), width 
= 3),
+                  
column(polloi::timeframe_daterange("wikiminiatlas_feature_usage_timeframe"), 
width = 3),
+                  column(checkboxInput("wikiminiatlas_feature_usage_logscale", 
"Use Log scale", FALSE), width = 3)),
+                dygraphOutput("wikiminiatlas_feature_usage"),
+                includeMarkdown("./tab_documentation/wikiminiatlas_usage.md")),
+        tabItem(tabName = "wikivoyage_usage",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_wikivoyage_feature_usage"), width = 3),
+                  
column(polloi::timeframe_select("wikivoyage_feature_usage_timeframe"), width = 
3),
+                  
column(polloi::timeframe_daterange("wikivoyage_feature_usage_timeframe"), width 
= 3),
+                  column(checkboxInput("wikivoyage_feature_usage_logscale", 
"Use Log scale", FALSE), width = 3)),
+                dygraphOutput("wikivoyage_feature_usage"),
+                includeMarkdown("./tab_documentation/wikivoyage_usage.md")),
+        tabItem(tabName = "wiwosm_usage",
+                fluidRow(
+                  
column(polloi::smooth_select("smoothing_wiwosm_feature_usage"), width = 3),
+                  
column(polloi::timeframe_select("wiwosm_feature_usage_timeframe"), width = 3),
+                  
column(polloi::timeframe_daterange("wiwosm_feature_usage_timeframe"), width = 
3),
+                  column(checkboxInput("wiwosm_feature_usage_logscale", "Use 
Log scale", FALSE), width = 3)),
+                dygraphOutput("wiwosm_feature_usage"),
+                includeMarkdown("./tab_documentation/wiwosm_usage.md")),
+        tabItem(tabName = "geo_breakdown",
+                fluidRow(
+                  column(polloi::smooth_select("smoothing_users_by_country"), 
width = 4),
+                  
column(polloi::timeframe_select("users_by_country_timeframe"), width = 4),
+                  
column(polloi::timeframe_daterange("users_by_country_timeframe"), width = 4)),
+                dygraphOutput("users_by_country"),
+                includeMarkdown("./tab_documentation/geo_breakdown.md"))
+      )
+    ),
+
+    skin = "green", title = "Maps Usage Dashboard | Discovery | Engineering | 
Wikimedia Foundation")
+}
diff --git a/wetzel.Rproj b/wetzel.Rproj
index a213108..e83436a 100644
--- a/wetzel.Rproj
+++ b/wetzel.Rproj
@@ -13,3 +13,4 @@
 LaTeX: pdfLaTeX
 
 AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
diff --git a/www/custom.js b/www/custom.js
index f02b367..d229d68 100644
--- a/www/custom.js
+++ b/www/custom.js
@@ -9,5 +9,10 @@
     
     // Reveals the KPI dropdown menu at launch:
     $('ul.sidebar-menu li.treeview').first().addClass('active');
+    
+    // Update the URL in the browser when a tab is clicked on:
+    $('a[href^="#shiny-tab"]').click(function(){
+      window.location.hash = encodeURI($(this).attr('data-value'));
+    })
 
 });

-- 
To view, visit https://gerrit.wikimedia.org/r/311158
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9622c4a14cb2c4094574a3e1d1c9d3778d6e418f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/wetzel
Gerrit-Branch: master
Gerrit-Owner: Bearloga <mpo...@wikimedia.org>
Gerrit-Reviewer: Chelsyx <c...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to