All Projects → bearloga → wmf-allhands18

bearloga / wmf-allhands18

Licence: other
Data visualization literacy workshop for Wikimedia Foundation's All Hands 2018 staff conference

Programming Languages

HTML
75241 projects

Plotting the Course Through Charted Waters

Heat maps, stacked area plots, mosaic plots, choropleths – oh my! There are so many different ways to visually convey relationships and patterns in data! While there are many tutorials on making them, there are very few for learning to read and understand them. In this workshop on data visualization literacy, you'll learn to recognize many popular types of charts and how to glean insights from them.

To be given at Wikimedia Foundation's All Hands 2018's third workshop session (3:15P-4:00P) in the Cypress room.

Setup

This workshop uses the learnr and rmarkdown packages from RStudio to create an interactive web application (which should automatically send you to either mirror 1, mirror 2, or mirror 3) and a static web page.

install.packages(c("tidyverse", "devtools", "learnr"))
# Visualizations
devtools::install_github("tidyverse/ggplot2")
install.packages(c("cowplot", "waffle", "RColorBrewer", "mixtools"))
# Data
install.packages("pageviews")

Load Balancing

The workshop can be deployed to shinyapps.io but we are hosting it using Wikimedia Cloud Services VMs running Shiny Server (see this post for details).

There is a separate VM that acts as a portal and sends users to the different servers so that we don't have a single overloaded Shiny server. We are using the following web proxies configured in Horizon:

Hostname Backend instance Backend port Backend IP Role
dataviz-literacy shinyserv-lb 3838 10.68.19.61 Portal
dataviz-lit-01 shinyserv-01 3838 10.68.19.31 App server
dataviz-lit-02 shinyserv-02 3838 10.68.17.173 App server
dataviz-lit-03 shinyserv-03 3838 10.68.19.32 App server

We edited /etc/nginx/sites-available/default to have the following configuration based on recommendations in this article:

map $http_upgrade $connection_upgrade {
     default upgrade;
     ''      close;
}
upstream datavizlit {
    # some kind of session affinity might be required if shiny-r isn't stateless
    # (either cookie or ip_hash)
    # sticky cookie srv_id expires=1h domain=.dataviz-literacy.wmflabs.org path=/;
    # ip_hash;
    server 10.68.19.31:3838;
    server 10.68.17.173:3838;
    server 10.68.19.32:3838;
}
server {
    listen 3838;
    location / {
        proxy_pass http://datavizlit;
        # websocket require HTTP 1.1
        proxy_http_version 1.1;
        proxy_redirect off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        # proxy_read_timeout 1d;
        proxy_buffering off;
    }
}

We are also using nginx-full which includes support for websockets.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].