├── LICENSE ├── README.md ├── Rstart.R ├── df_net.csv ├── subreddit-1.pdf ├── subreddit-2.pdf ├── subreddit-groups ├── group-001.png ├── group-002.png ├── group-003.png ├── group-004.png ├── group-005.png ├── group-006.png ├── group-007.png ├── group-008.png ├── group-009.png ├── group-010.png ├── group-011.png ├── group-012.png ├── group-013.png ├── group-014.png ├── group-015.png ├── group-016.png ├── group-017.png ├── group-018.png ├── group-019.png ├── group-020.png ├── group-021.png ├── group-022.png ├── group-023.png ├── group-024.png ├── group-025.png ├── group-026.png ├── group-027.png ├── group-028.png ├── group-029.png ├── group-030.png ├── group-031.png ├── group-032.png ├── group-033.png ├── group-034.png ├── group-035.png ├── group-036.png ├── group-037.png ├── group-038.png ├── group-039.png ├── group-040.png ├── group-041.png ├── group-042.png ├── group-043.png ├── group-044.png ├── group-045.png ├── group-046.png ├── group-047.png ├── group-048.png ├── group-049.png ├── group-050.png ├── group-051.png ├── group-052.png ├── group-053.png ├── group-054.png ├── group-055.png ├── group-056.png ├── group-057.png ├── group-058.png ├── group-059.png ├── group-060.png ├── group-061.png ├── group-062.png ├── group-063.png ├── group-064.png ├── group-065.png ├── group-066.png ├── group-067.png ├── group-068.png ├── group-069.png ├── group-070.png ├── group-071.png ├── group-072.png ├── group-073.png ├── group-074.png ├── group-075.png ├── group-076.png ├── group-077.png ├── group-078.png ├── group-079.png ├── group-080.png ├── group-081.png ├── group-082.png ├── group-083.png ├── group-084.png ├── group-085.png ├── group-086.png ├── group-087.png ├── group-088.png ├── group-089.png ├── group-090.png ├── group-091.png ├── group-092.png ├── group-093.png ├── group-094.png ├── group-095.png ├── group-096.png ├── group-097.png ├── group-098.png ├── group-099.png ├── group-100.png ├── group-101.png ├── group-102.png ├── group-103.png ├── group-104.png ├── group-105.png ├── group-106.png ├── group-107.png ├── group-108.png ├── group-109.png ├── group-110.png ├── group-111.png ├── group-112.png ├── group-113.png ├── group-114.png ├── group-115.png ├── group-116.png ├── group-117.png ├── group-118.png ├── group-119.png ├── group-120.png ├── group-121.png ├── group-122.png ├── group-123.png ├── group-124.png ├── group-125.png ├── group-126.png ├── group-127.png ├── group-128.png ├── group-129.png ├── group-130.png ├── group-131.png ├── group-132.png ├── group-133.png ├── group-134.png ├── group-135.png ├── group-136.png ├── group-137.png ├── group-138.png ├── group-139.png ├── group-140.png ├── group-141.png └── group-142.png ├── subreddit_edges.csv └── subreddit_network_pdf.ipynb /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Max Woolf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # reddit-graph 2 | Jupyter notebook + Code for reproducing Reddit Subreddit graphs. This repository is the complement to my blog post [How to Create a Network Graph Visualization of Reddit Subreddits](http://minimaxir.com/2016/05/reddit-graph/). -------------------------------------------------------------------------------- /Rstart.R: -------------------------------------------------------------------------------- 1 | library(readr) 2 | library(dplyr) 3 | library(ggplot2) 4 | library(extrafont) 5 | library(scales) 6 | library(grid) 7 | library(RColorBrewer) 8 | library(digest) 9 | library(readr) 10 | library(stringr) 11 | 12 | 13 | fontFamily <- "Source Sans Pro" 14 | fontTitle <- "Source Sans Pro Semibold" 15 | 16 | color_palette = c("#16a085","#27ae60","#2980b9","#8e44ad","#f39c12","#c0392b","#1abc9c", "#2ecc71", "#3498db", "#9b59b6", "#f1c40f","#e74c3c") 17 | 18 | neutral_colors = function(number) { 19 | return (brewer.pal(11, "RdYlBu")[-c(5:7)][(number %% 8) + 1]) 20 | } 21 | 22 | set1_colors = function(number) { 23 | return (brewer.pal(9, "Set1")[c(-6,-8)][(number %% 7) + 1]) 24 | } 25 | 26 | theme_custom <- function() {theme_bw(base_size = 8) + 27 | theme(panel.background = element_rect(fill="#eaeaea"), 28 | plot.background = element_rect(fill="white"), 29 | panel.grid.minor = element_blank(), 30 | panel.grid.major = element_line(color="#dddddd"), 31 | axis.ticks.x = element_blank(), 32 | axis.ticks.y = element_blank(), 33 | axis.title.x = element_text(family=fontTitle, size=8, vjust=-.3), 34 | axis.title.y = element_text(family=fontTitle, size=8, vjust=1.5), 35 | panel.border = element_rect(color="#cccccc"), 36 | text = element_text(color = "#1a1a1a", family=fontFamily), 37 | plot.margin = unit(c(0.25,0.1,0.1,0.35), "cm"), 38 | plot.title = element_text(family=fontTitle, size=9, vjust=1)) 39 | } 40 | 41 | create_watermark <- function(source = '', filename = '', dark=F) { 42 | 43 | bg_white = "#F0F0F0" 44 | bg_text = '#969696' 45 | 46 | if (dark) { 47 | bg_white = "#000000" 48 | bg_text = '#666666' 49 | } 50 | 51 | watermark <- ggplot(aes(x,y), data=data.frame(x=c(0.5), y=c(0.5))) + geom_point(color = "transparent") + 52 | geom_text(x=0, y=1.25, label="By Max Woolf — minimaxir.com", family="Source Sans Pro", color=bg_text, size=1.75, hjust=0) + 53 | 54 | geom_text(x=5, y=1.25, label="Made using R and ggplot2", family="Source Sans Pro", color=bg_text, size=1.75) + 55 | scale_x_continuous(limits=c(0,10)) + 56 | scale_y_continuous(limits=c(0.5,1.5)) + 57 | annotate("segment", x = 0, xend = 10, y=1.5, yend=1.5, color=bg_text, size=0.1) + 58 | theme_bw() + 59 | theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position = "none", 60 | panel.border = element_blank(), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.title.x = element_blank(), axis.title.y = element_blank(), 61 | axis.ticks = element_blank(), plot.margin = unit(c(0.0,0,-0.4,0), "cm")) + 62 | theme(plot.background=element_rect(fill=bg_white, color=bg_white),panel.background=element_rect(fill=bg_white, color=bg_white)) + 63 | scale_color_manual(values=bg_text) 64 | 65 | if (nchar(source) > 0) {watermark <- watermark + geom_text(x=10, y=1.25, label=paste("Data via",source), family="Source Sans Pro", color=bg_text, size=1.75, hjust=1)} 66 | 67 | return (watermark) 68 | } 69 | 70 | web_Layout <- grid.layout(nrow = 2, ncol = 1, heights = unit(c(2, 71 | 0.125), c("null", "null")), ) 72 | tallweb_Layout <- grid.layout(nrow = 2, ncol = 1, heights = unit(c(3.5, 73 | 0.125), c("null", "null")), ) 74 | video_Layout <- grid.layout(nrow = 1, ncol = 2, widths = unit(c(2, 75 | 1), c("null", "null")), ) 76 | 77 | #grid.show.layout(Layout) 78 | vplayout <- function(...) { 79 | grid.newpage() 80 | pushViewport(viewport(layout = web_Layout)) 81 | } 82 | 83 | talllayout <- function(...) { 84 | grid.newpage() 85 | pushViewport(viewport(layout = tallweb_Layout)) 86 | } 87 | 88 | vidlayout <- function(...) { 89 | grid.newpage() 90 | pushViewport(viewport(layout = video_Layout)) 91 | } 92 | 93 | subplot <- function(x, y) viewport(layout.pos.row = x, 94 | layout.pos.col = y) 95 | 96 | web_plot <- function(a, b) { 97 | vplayout() 98 | print(a, vp = subplot(1, 1)) 99 | print(b, vp = subplot(2, 1)) 100 | } 101 | 102 | tallweb_plot <- function(a, b) { 103 | talllayout() 104 | print(a, vp = subplot(1, 1)) 105 | print(b, vp = subplot(2, 1)) 106 | } 107 | 108 | video_plot <- function(a, b) { 109 | vidlayout() 110 | print(a, vp = subplot(1, 1)) 111 | print(b, vp = subplot(1, 2)) 112 | } 113 | 114 | max_save <- function(plot1, filename, source = '', pdf = FALSE, w=4, h=3, tall=F, dark=F, bg_overide=NA) { 115 | png(paste(filename,"png",sep="."),res=300,units="in",width=w,height=h) 116 | plot.new() 117 | #if (!is.na(bg_overide)) {par(bg = bg_overide)} 118 | ifelse(tall,tallweb_plot(plot1,create_watermark(source, filename, dark)),web_plot(plot1,create_watermark(source, filename, dark))) 119 | dev.off() 120 | 121 | if (pdf) { 122 | quartz(width=w,height=h,dpi=144) 123 | #if (!is.na(bg_overide)) {par(bg = bg_overide)} 124 | web_plot(plot1,create_watermark(source, filename, dark)) 125 | quartz.save(paste(filename,"pdf",sep="."), type = "pdf", device = dev.cur()) 126 | } 127 | } 128 | 129 | video_save <- function(plot1, plot2, filename) { 130 | png(paste(filename,"png",sep="."),res=300,units="in",width=1920/300,height=1080/300) 131 | video_plot(plot1,plot2) 132 | dev.off() 133 | 134 | } 135 | 136 | fte_theme <- function (palate_color = "Greys") { 137 | 138 | #display.brewer.all(n=9,type="seq",exact.n=TRUE) 139 | palate <- brewer.pal(palate_color, n=9) 140 | color.background = palate[2] 141 | color.grid.minor = palate[3] 142 | color.grid.major = palate[3] 143 | color.axis.text = palate[6] 144 | color.axis.title = palate[7] 145 | color.title = palate[9] 146 | #color.title = "#2c3e50" 147 | 148 | font.title <- "Source Sans Pro" 149 | font.axis <- "Open Sans Condensed Bold" 150 | #font.axis <- "M+ 1m regular" 151 | #font.title <- "Arial" 152 | #font.axis <- "Arial" 153 | 154 | 155 | theme_bw(base_size=9) + 156 | # Set the entire chart region to a light gray color 157 | theme(panel.background=element_rect(fill=color.background, color=color.background)) + 158 | theme(plot.background=element_rect(fill=color.background, color=color.background)) + 159 | theme(panel.border=element_rect(color=color.background)) + 160 | # Format the grid 161 | theme(panel.grid.major=element_line(color=color.grid.major,size=.25)) + 162 | theme(panel.grid.minor=element_blank()) + 163 | #scale_x_continuous(minor_breaks=0,breaks=seq(0,100,10),limits=c(0,100)) + 164 | #scale_y_continuous(minor_breaks=0,breaks=seq(0,26,4),limits=c(0,25)) + 165 | theme(axis.ticks=element_blank()) + 166 | # Dispose of the legend 167 | theme(legend.position="none") + 168 | theme(legend.background = element_rect(fill=color.background)) + 169 | theme(legend.text = element_text(size=7,colour=color.axis.title,family=font.axis)) + 170 | # Set title and axis labels, and format these and tick marks 171 | theme(plot.title=element_text(colour=color.title,family=font.title, size=9, vjust=1.25, lineheight=0.1)) + 172 | theme(axis.text.x=element_text(size=7,colour=color.axis.text,family=font.axis)) + 173 | theme(axis.text.y=element_text(size=7,colour=color.axis.text,family=font.axis)) + 174 | theme(axis.title.y=element_text(size=7,colour=color.axis.title,family=font.title, vjust=1.25)) + 175 | theme(axis.title.x=element_text(size=7,colour=color.axis.title,family=font.title, vjust=0)) + 176 | 177 | # Big bold line at y=0 178 | #geom_hline(yintercept=0,size=0.75,colour=palate[9]) + 179 | # Plot margins and finally line annotations 180 | theme(plot.margin = unit(c(0.35, 0.2, 0.15, 0.4), "cm")) + 181 | 182 | theme(strip.background = element_rect(fill=color.background, color=color.background),strip.text=element_text(size=7,colour=color.axis.title,family=font.title)) 183 | 184 | } 185 | -------------------------------------------------------------------------------- /subreddit-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-1.pdf -------------------------------------------------------------------------------- /subreddit-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-2.pdf -------------------------------------------------------------------------------- /subreddit-groups/group-001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-001.png -------------------------------------------------------------------------------- /subreddit-groups/group-002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-002.png -------------------------------------------------------------------------------- /subreddit-groups/group-003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-003.png -------------------------------------------------------------------------------- /subreddit-groups/group-004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-004.png -------------------------------------------------------------------------------- /subreddit-groups/group-005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-005.png -------------------------------------------------------------------------------- /subreddit-groups/group-006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-006.png -------------------------------------------------------------------------------- /subreddit-groups/group-007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-007.png -------------------------------------------------------------------------------- /subreddit-groups/group-008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-008.png -------------------------------------------------------------------------------- /subreddit-groups/group-009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-009.png -------------------------------------------------------------------------------- /subreddit-groups/group-010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-010.png -------------------------------------------------------------------------------- /subreddit-groups/group-011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-011.png -------------------------------------------------------------------------------- /subreddit-groups/group-012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-012.png -------------------------------------------------------------------------------- /subreddit-groups/group-013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-013.png -------------------------------------------------------------------------------- /subreddit-groups/group-014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-014.png -------------------------------------------------------------------------------- /subreddit-groups/group-015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-015.png -------------------------------------------------------------------------------- /subreddit-groups/group-016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-016.png -------------------------------------------------------------------------------- /subreddit-groups/group-017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-017.png -------------------------------------------------------------------------------- /subreddit-groups/group-018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-018.png -------------------------------------------------------------------------------- /subreddit-groups/group-019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-019.png -------------------------------------------------------------------------------- /subreddit-groups/group-020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-020.png -------------------------------------------------------------------------------- /subreddit-groups/group-021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-021.png -------------------------------------------------------------------------------- /subreddit-groups/group-022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-022.png -------------------------------------------------------------------------------- /subreddit-groups/group-023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-023.png -------------------------------------------------------------------------------- /subreddit-groups/group-024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-024.png -------------------------------------------------------------------------------- /subreddit-groups/group-025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-025.png -------------------------------------------------------------------------------- /subreddit-groups/group-026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-026.png -------------------------------------------------------------------------------- /subreddit-groups/group-027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-027.png -------------------------------------------------------------------------------- /subreddit-groups/group-028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-028.png -------------------------------------------------------------------------------- /subreddit-groups/group-029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-029.png -------------------------------------------------------------------------------- /subreddit-groups/group-030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-030.png -------------------------------------------------------------------------------- /subreddit-groups/group-031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-031.png -------------------------------------------------------------------------------- /subreddit-groups/group-032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-032.png -------------------------------------------------------------------------------- /subreddit-groups/group-033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-033.png -------------------------------------------------------------------------------- /subreddit-groups/group-034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-034.png -------------------------------------------------------------------------------- /subreddit-groups/group-035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-035.png -------------------------------------------------------------------------------- /subreddit-groups/group-036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-036.png -------------------------------------------------------------------------------- /subreddit-groups/group-037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-037.png -------------------------------------------------------------------------------- /subreddit-groups/group-038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-038.png -------------------------------------------------------------------------------- /subreddit-groups/group-039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-039.png -------------------------------------------------------------------------------- /subreddit-groups/group-040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-040.png -------------------------------------------------------------------------------- /subreddit-groups/group-041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-041.png -------------------------------------------------------------------------------- /subreddit-groups/group-042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-042.png -------------------------------------------------------------------------------- /subreddit-groups/group-043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-043.png -------------------------------------------------------------------------------- /subreddit-groups/group-044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-044.png -------------------------------------------------------------------------------- /subreddit-groups/group-045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-045.png -------------------------------------------------------------------------------- /subreddit-groups/group-046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-046.png -------------------------------------------------------------------------------- /subreddit-groups/group-047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-047.png -------------------------------------------------------------------------------- /subreddit-groups/group-048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-048.png -------------------------------------------------------------------------------- /subreddit-groups/group-049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-049.png -------------------------------------------------------------------------------- /subreddit-groups/group-050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-050.png -------------------------------------------------------------------------------- /subreddit-groups/group-051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-051.png -------------------------------------------------------------------------------- /subreddit-groups/group-052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-052.png -------------------------------------------------------------------------------- /subreddit-groups/group-053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-053.png -------------------------------------------------------------------------------- /subreddit-groups/group-054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-054.png -------------------------------------------------------------------------------- /subreddit-groups/group-055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-055.png -------------------------------------------------------------------------------- /subreddit-groups/group-056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-056.png -------------------------------------------------------------------------------- /subreddit-groups/group-057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-057.png -------------------------------------------------------------------------------- /subreddit-groups/group-058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-058.png -------------------------------------------------------------------------------- /subreddit-groups/group-059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-059.png -------------------------------------------------------------------------------- /subreddit-groups/group-060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-060.png -------------------------------------------------------------------------------- /subreddit-groups/group-061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-061.png -------------------------------------------------------------------------------- /subreddit-groups/group-062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-062.png -------------------------------------------------------------------------------- /subreddit-groups/group-063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-063.png -------------------------------------------------------------------------------- /subreddit-groups/group-064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-064.png -------------------------------------------------------------------------------- /subreddit-groups/group-065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-065.png -------------------------------------------------------------------------------- /subreddit-groups/group-066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-066.png -------------------------------------------------------------------------------- /subreddit-groups/group-067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-067.png -------------------------------------------------------------------------------- /subreddit-groups/group-068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-068.png -------------------------------------------------------------------------------- /subreddit-groups/group-069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-069.png -------------------------------------------------------------------------------- /subreddit-groups/group-070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-070.png -------------------------------------------------------------------------------- /subreddit-groups/group-071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-071.png -------------------------------------------------------------------------------- /subreddit-groups/group-072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-072.png -------------------------------------------------------------------------------- /subreddit-groups/group-073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-073.png -------------------------------------------------------------------------------- /subreddit-groups/group-074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-074.png -------------------------------------------------------------------------------- /subreddit-groups/group-075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-075.png -------------------------------------------------------------------------------- /subreddit-groups/group-076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-076.png -------------------------------------------------------------------------------- /subreddit-groups/group-077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-077.png -------------------------------------------------------------------------------- /subreddit-groups/group-078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-078.png -------------------------------------------------------------------------------- /subreddit-groups/group-079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-079.png -------------------------------------------------------------------------------- /subreddit-groups/group-080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-080.png -------------------------------------------------------------------------------- /subreddit-groups/group-081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-081.png -------------------------------------------------------------------------------- /subreddit-groups/group-082.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-082.png -------------------------------------------------------------------------------- /subreddit-groups/group-083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-083.png -------------------------------------------------------------------------------- /subreddit-groups/group-084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-084.png -------------------------------------------------------------------------------- /subreddit-groups/group-085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-085.png -------------------------------------------------------------------------------- /subreddit-groups/group-086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-086.png -------------------------------------------------------------------------------- /subreddit-groups/group-087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-087.png -------------------------------------------------------------------------------- /subreddit-groups/group-088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-088.png -------------------------------------------------------------------------------- /subreddit-groups/group-089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-089.png -------------------------------------------------------------------------------- /subreddit-groups/group-090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-090.png -------------------------------------------------------------------------------- /subreddit-groups/group-091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-091.png -------------------------------------------------------------------------------- /subreddit-groups/group-092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-092.png -------------------------------------------------------------------------------- /subreddit-groups/group-093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-093.png -------------------------------------------------------------------------------- /subreddit-groups/group-094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-094.png -------------------------------------------------------------------------------- /subreddit-groups/group-095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-095.png -------------------------------------------------------------------------------- /subreddit-groups/group-096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-096.png -------------------------------------------------------------------------------- /subreddit-groups/group-097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-097.png -------------------------------------------------------------------------------- /subreddit-groups/group-098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-098.png -------------------------------------------------------------------------------- /subreddit-groups/group-099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-099.png -------------------------------------------------------------------------------- /subreddit-groups/group-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-100.png -------------------------------------------------------------------------------- /subreddit-groups/group-101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-101.png -------------------------------------------------------------------------------- /subreddit-groups/group-102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-102.png -------------------------------------------------------------------------------- /subreddit-groups/group-103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-103.png -------------------------------------------------------------------------------- /subreddit-groups/group-104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-104.png -------------------------------------------------------------------------------- /subreddit-groups/group-105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-105.png -------------------------------------------------------------------------------- /subreddit-groups/group-106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-106.png -------------------------------------------------------------------------------- /subreddit-groups/group-107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-107.png -------------------------------------------------------------------------------- /subreddit-groups/group-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-108.png -------------------------------------------------------------------------------- /subreddit-groups/group-109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-109.png -------------------------------------------------------------------------------- /subreddit-groups/group-110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-110.png -------------------------------------------------------------------------------- /subreddit-groups/group-111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-111.png -------------------------------------------------------------------------------- /subreddit-groups/group-112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-112.png -------------------------------------------------------------------------------- /subreddit-groups/group-113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-113.png -------------------------------------------------------------------------------- /subreddit-groups/group-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-114.png -------------------------------------------------------------------------------- /subreddit-groups/group-115.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-115.png -------------------------------------------------------------------------------- /subreddit-groups/group-116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-116.png -------------------------------------------------------------------------------- /subreddit-groups/group-117.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-117.png -------------------------------------------------------------------------------- /subreddit-groups/group-118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-118.png -------------------------------------------------------------------------------- /subreddit-groups/group-119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-119.png -------------------------------------------------------------------------------- /subreddit-groups/group-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-120.png -------------------------------------------------------------------------------- /subreddit-groups/group-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-121.png -------------------------------------------------------------------------------- /subreddit-groups/group-122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-122.png -------------------------------------------------------------------------------- /subreddit-groups/group-123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-123.png -------------------------------------------------------------------------------- /subreddit-groups/group-124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-124.png -------------------------------------------------------------------------------- /subreddit-groups/group-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-125.png -------------------------------------------------------------------------------- /subreddit-groups/group-126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-126.png -------------------------------------------------------------------------------- /subreddit-groups/group-127.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-127.png -------------------------------------------------------------------------------- /subreddit-groups/group-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-128.png -------------------------------------------------------------------------------- /subreddit-groups/group-129.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-129.png -------------------------------------------------------------------------------- /subreddit-groups/group-130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-130.png -------------------------------------------------------------------------------- /subreddit-groups/group-131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-131.png -------------------------------------------------------------------------------- /subreddit-groups/group-132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-132.png -------------------------------------------------------------------------------- /subreddit-groups/group-133.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-133.png -------------------------------------------------------------------------------- /subreddit-groups/group-134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-134.png -------------------------------------------------------------------------------- /subreddit-groups/group-135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-135.png -------------------------------------------------------------------------------- /subreddit-groups/group-136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-136.png -------------------------------------------------------------------------------- /subreddit-groups/group-137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-137.png -------------------------------------------------------------------------------- /subreddit-groups/group-138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-138.png -------------------------------------------------------------------------------- /subreddit-groups/group-139.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-139.png -------------------------------------------------------------------------------- /subreddit-groups/group-140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-140.png -------------------------------------------------------------------------------- /subreddit-groups/group-141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-141.png -------------------------------------------------------------------------------- /subreddit-groups/group-142.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minimaxir/reddit-graph/576b4e4cd8b45fc2841e226fea336baf834af976/subreddit-groups/group-142.png -------------------------------------------------------------------------------- /subreddit_network_pdf.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# How to Create a Network Graph Visualization of Reddit Subreddits\n", 8 | "\n", 9 | "by Max Woolf (@minimaxir)\n", 10 | "\n", 11 | "*This notebook is licensed under the MIT License. If you use the code or data visualization designs contained within this notebook, it would be greatly appreciated if proper attribution is given back to this notebook and/or myself. Thanks! :)*" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 1, 17 | "metadata": { 18 | "collapsed": false 19 | }, 20 | "outputs": [ 21 | { 22 | "name": "stderr", 23 | "output_type": "stream", 24 | "text": [ 25 | "\n", 26 | "Attaching package: ‘dplyr’\n", 27 | "\n", 28 | "The following objects are masked from ‘package:stats’:\n", 29 | "\n", 30 | " filter, lag\n", 31 | "\n", 32 | "The following objects are masked from ‘package:base’:\n", 33 | "\n", 34 | " intersect, setdiff, setequal, union\n", 35 | "\n", 36 | "Registering fonts with R\n", 37 | "\n", 38 | "Attaching package: ‘scales’\n", 39 | "\n", 40 | "The following objects are masked from ‘package:readr’:\n", 41 | "\n", 42 | " col_factor, col_numeric\n", 43 | "\n", 44 | "sna: Tools for Social Network Analysis\n", 45 | "Version 2.3-2 created on 2014-01-13.\n", 46 | "copyright (c) 2005, Carter T. Butts, University of California-Irvine\n", 47 | " For citation information, type citation(\"sna\").\n", 48 | " Type help(package=\"sna\") to get started.\n", 49 | "\n", 50 | "\n", 51 | "Attaching package: ‘igraph’\n", 52 | "\n", 53 | "The following objects are masked from ‘package:sna’:\n", 54 | "\n", 55 | " %c%, betweenness, bonpow, closeness, components, degree,\n", 56 | " dyad.census, evcent, hierarchy, is.connected, neighborhood,\n", 57 | " triad.census\n", 58 | "\n", 59 | "The following object is masked from ‘package:stringr’:\n", 60 | "\n", 61 | " %>%\n", 62 | "\n", 63 | "The following objects are masked from ‘package:dplyr’:\n", 64 | "\n", 65 | " %>%, as_data_frame, groups, union\n", 66 | "\n", 67 | "The following objects are masked from ‘package:stats’:\n", 68 | "\n", 69 | " decompose, spectrum\n", 70 | "\n", 71 | "The following object is masked from ‘package:base’:\n", 72 | "\n", 73 | " union\n", 74 | "\n" 75 | ] 76 | }, 77 | { 78 | "data": { 79 | "text/plain": [ 80 | "R version 3.3.0 (2016-05-03)\n", 81 | "Platform: x86_64-apple-darwin13.4.0 (64-bit)\n", 82 | "Running under: OS X 10.11.4 (El Capitan)\n", 83 | "\n", 84 | "locale:\n", 85 | "[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\n", 86 | "\n", 87 | "attached base packages:\n", 88 | "[1] grid stats graphics grDevices utils datasets methods \n", 89 | "[8] base \n", 90 | "\n", 91 | "other attached packages:\n", 92 | " [1] rsvg_0.5 intergraph_2.0-2 igraph_1.0.1 svglite_1.1.0 \n", 93 | " [5] ggnetwork_0.5.1 sna_2.3-2 stringr_1.0.0 digest_0.6.9 \n", 94 | " [9] RColorBrewer_1.1-2 scales_0.4.0 extrafont_0.17 ggplot2_2.1.0 \n", 95 | "[13] dplyr_0.4.3 readr_0.2.2 \n", 96 | "\n", 97 | "loaded via a namespace (and not attached):\n", 98 | " [1] Rcpp_0.12.4 plyr_1.8.3 base64enc_0.1-3 tools_3.3.0 \n", 99 | " [5] uuid_0.1-2 jsonlite_0.9.19 evaluate_0.9 gtable_0.2.0 \n", 100 | " [9] IRdisplay_0.3 DBI_0.4 IRkernel_0.5 ggrepel_0.5 \n", 101 | "[13] parallel_3.3.0 rzmq_0.7.7 Rttf2pt1_1.3.3 repr_0.4 \n", 102 | "[17] gdtools_0.0.7 R6_2.1.2 extrafontdb_1.0 magrittr_1.5 \n", 103 | "[21] assertthat_0.1 colorspace_1.2-6 stringi_1.0-1 network_1.13.0 \n", 104 | "[25] munsell_0.4.3 " 105 | ] 106 | }, 107 | "execution_count": 1, 108 | "metadata": {}, 109 | "output_type": "execute_result" 110 | } 111 | ], 112 | "source": [ 113 | "source(\"Rstart.R\")\n", 114 | "\n", 115 | "library(sna)\n", 116 | "library(ggnetwork)\n", 117 | "library(svglite)\n", 118 | "library(igraph)\n", 119 | "library(intergraph) # convert igraph to network\n", 120 | "library(rsvg) # convert svg to pdf\n", 121 | "\n", 122 | "sessionInfo()" 123 | ] 124 | }, 125 | { 126 | "cell_type": "markdown", 127 | "metadata": {}, 128 | "source": [ 129 | "Load edgelist into R and preprocess." 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": 2, 135 | "metadata": { 136 | "collapsed": false, 137 | "scrolled": true 138 | }, 139 | "outputs": [ 140 | { 141 | "name": "stdout", 142 | "output_type": "stream", 143 | "text": [ 144 | "Source: local data frame [6 x 3]\n", 145 | "\n", 146 | " Source Target Weight\n", 147 | " (chr) (chr) (int)\n", 148 | "1 10cloverfieldlane askreddit 228\n", 149 | "2 1200isplenty askreddit 244\n", 150 | "3 1200isplenty loseit 228\n", 151 | "4 2007scape adviceanimals 248\n", 152 | "5 2007scape askreddit 1514\n", 153 | "6 2007scape funny 372\n" 154 | ] 155 | } 156 | ], 157 | "source": [ 158 | "file_name <- \"subreddit_edges.csv\"\n", 159 | "\n", 160 | "df <- read_csv(file_name) %>% arrange(Source, Target)\n", 161 | "print(head(df))" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 3, 167 | "metadata": { 168 | "collapsed": false 169 | }, 170 | "outputs": [ 171 | { 172 | "name": "stdout", 173 | "output_type": "stream", 174 | "text": [ 175 | "Source: local data frame [6 x 4]\n", 176 | "\n", 177 | " Source Target Weight connectDefault\n", 178 | " (chr) (chr) (int) (lgl)\n", 179 | "1 worldnews youtubehaiku 298 TRUE\n", 180 | "2 wow woweconomy 308 FALSE\n", 181 | "3 wow wowservers 344 FALSE\n", 182 | "4 wow wtf 654 FALSE\n", 183 | "5 wtf xboxone 539 FALSE\n", 184 | "6 wtf youtubehaiku 349 FALSE\n" 185 | ] 186 | } 187 | ], 188 | "source": [ 189 | "defaults <- c(\"announcements\",\"art\",\"askreddit\",\"askscience\",\"aww\",\"blog\",\n", 190 | " \"books\",\"creepy\",\"dataisbeautiful\",\"diy\",\"documentaries\",\"earthporn\",\n", 191 | " \"explainlikeimfive\",\"fitness\",\"food\",\"funny\",\"futurology\",\"gadgets\",\n", 192 | " \"gaming\",\"getmotivated\",\"gifs\",\"history\",\"iama\",\"internetisbeautiful\",\n", 193 | " \"jokes\",\"lifeprotips\",\"listentothis\",\"mildlyinteresting\",\"movies\",\"music\",\n", 194 | " \"news\",\"nosleep\",\"nottheonion\",\"oldschoolcool\",\"personalfinance\",\n", 195 | " \"philosophy\",\"photoshopbattles\",\"pics\",\"science\",\"showerthoughts\",\n", 196 | " \"space\",\"sports\",\"television\",\"tifu\",\"todayilearned\",\"twoxchromosomes\",\"upliftingnews\",\n", 197 | " \"videos\",\"worldnews\",\"writingprompts\")\n", 198 | "\n", 199 | "df <- df %>% mutate(connectDefault = ifelse(Source %in% defaults | Target %in% defaults, T, F))\n", 200 | "print(tail(df))" 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": 4, 206 | "metadata": { 207 | "collapsed": false, 208 | "scrolled": true 209 | }, 210 | "outputs": [ 211 | { 212 | "name": "stdout", 213 | "output_type": "stream", 214 | "text": [ 215 | "IGRAPH UN-- 1131 7498 -- \n", 216 | "+ attr: name (v/c), Weight (e/n), connectDefault (e/l)\n", 217 | "+ edges (vertex names):\n", 218 | " [1] 10cloverfieldlane--askreddit 1200isplenty --askreddit \n", 219 | " [3] 1200isplenty --loseit 2007scape --adviceanimals \n", 220 | " [5] 2007scape --askreddit 2007scape --funny \n", 221 | " [7] 2007scape --gaming 2007scape --gifs \n", 222 | " [9] 2007scape --globaloffensive 2007scape --ice_poseidon \n", 223 | "[11] 2007scape --leagueoflegends 2007scape --pcmasterrace \n", 224 | "[13] 2007scape --pics 2007scape --politics \n", 225 | "[15] 2007scape --runescape 2007scape --the_donald \n", 226 | "+ ... omitted several edges\n" 227 | ] 228 | } 229 | ], 230 | "source": [ 231 | "net <- graph.data.frame(df, directed=F)\n", 232 | "\n", 233 | "print(net)" 234 | ] 235 | }, 236 | { 237 | "cell_type": "markdown", 238 | "metadata": {}, 239 | "source": [ 240 | "Calculate degree, and remove nodes with only 1 or 2 neighbors for graphing simplicity." 241 | ] 242 | }, 243 | { 244 | "cell_type": "code", 245 | "execution_count": 5, 246 | "metadata": { 247 | "collapsed": false, 248 | "scrolled": false 249 | }, 250 | "outputs": [ 251 | { 252 | "name": "stdout", 253 | "output_type": "stream", 254 | "text": [ 255 | "IGRAPH UN-- 517 6732 -- \n", 256 | "+ attr: name (v/c), degree (v/n), Weight (e/n), connectDefault (e/l)\n", 257 | "+ edges (vertex names):\n", 258 | " [1] 2007scape--adviceanimals 2007scape--askreddit \n", 259 | " [3] 2007scape--funny 2007scape--gaming \n", 260 | " [5] 2007scape--gifs 2007scape--globaloffensive\n", 261 | " [7] 2007scape--leagueoflegends 2007scape--pcmasterrace \n", 262 | " [9] 2007scape--pics 2007scape--politics \n", 263 | "[11] 2007scape--runescape 2007scape--the_donald \n", 264 | "[13] 2007scape--todayilearned 2007scape--videos \n", 265 | "[15] 2007scape--worldnews 2007scape--wtf \n", 266 | "+ ... omitted several edges\n" 267 | ] 268 | } 269 | ], 270 | "source": [ 271 | "V(net)$degree <- centralization.degree(net)$res\n", 272 | "net <- igraph::delete.vertices(net, V(net)[degree < 3])\n", 273 | "\n", 274 | "print(net)" 275 | ] 276 | }, 277 | { 278 | "cell_type": "markdown", 279 | "metadata": {}, 280 | "source": [ 281 | "Add more summary statistics to the nodes." 282 | ] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "execution_count": 6, 287 | "metadata": { 288 | "collapsed": false 289 | }, 290 | "outputs": [ 291 | { 292 | "name": "stdout", 293 | "output_type": "stream", 294 | "text": [ 295 | " V.net..name V.net..degree V.net..centrality V.net..group V.net..defaultnode\n", 296 | "1 2007scape 17 0.013282501 6 FALSE\n", 297 | "2 3ds 18 0.007731622 10 FALSE\n", 298 | "3 49ers 3 0.001340047 33 FALSE\n", 299 | "4 4chan 62 0.055411772 5 FALSE\n", 300 | "5 advice 4 0.005108509 7 FALSE\n", 301 | "6 adviceanimals 226 0.449733804 5 FALSE\n" 302 | ] 303 | } 304 | ], 305 | "source": [ 306 | "V(net)$group <- membership(cluster_walktrap(net, weights=E(net)$Weight))\n", 307 | "V(net)$centrality <- eigen_centrality(net, weights=E(net)$Weight)$vector\n", 308 | "V(net)$defaultnode <- V(net)$name %in% defaults\n", 309 | "\n", 310 | "print(head(data.frame(V(net)$name, V(net)$degree, V(net)$centrality, V(net)$group, V(net)$defaultnode)))" 311 | ] 312 | }, 313 | { 314 | "cell_type": "markdown", 315 | "metadata": {}, 316 | "source": [ 317 | "## Adding colors\n", 318 | "\n", 319 | "Long string of code to generate color palette and assign to nodes and edges. Generate a color for a group from solid ColorBrewer colors." 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 7, 325 | "metadata": { 326 | "collapsed": false 327 | }, 328 | "outputs": [ 329 | { 330 | "name": "stdout", 331 | "output_type": "stream", 332 | "text": [ 333 | " group colors\n", 334 | "1 1 #54278F\n", 335 | "2 2 #54278F\n", 336 | "3 3 #EF3B2C\n", 337 | "4 4 #6A51A3\n", 338 | "5 5 #006D2C\n", 339 | "6 6 #41AB5D\n" 340 | ] 341 | } 342 | ], 343 | "source": [ 344 | "color_pool <- c(brewer.pal(9, \"Blues\")[6:9],\n", 345 | " brewer.pal(9, \"Reds\")[6:9],\n", 346 | " brewer.pal(9, \"Greens\")[6:9],\n", 347 | " brewer.pal(9, \"Purples\")[6:9])\n", 348 | "\n", 349 | "n_colors <- max(V(net)$group)\n", 350 | "set.seed(42)\n", 351 | "palette <- data.frame(group=1:n_colors, colors=sample(color_pool, n_colors, replace=T), stringsAsFactors=FALSE)\n", 352 | "\n", 353 | "V(net)$colornode <- palette[V(net)$group, 2]\n", 354 | " \n", 355 | "print(head(palette))" 356 | ] 357 | }, 358 | { 359 | "cell_type": "markdown", 360 | "metadata": {}, 361 | "source": [ 362 | "Prepare data frame for merging. (to find edges with are in the same group)" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": 8, 368 | "metadata": { 369 | "collapsed": false, 370 | "scrolled": true 371 | }, 372 | "outputs": [ 373 | { 374 | "name": "stdout", 375 | "output_type": "stream", 376 | "text": [ 377 | "Source: local data frame [6 x 2]\n", 378 | "\n", 379 | " X1 X2\n", 380 | " (chr) (chr)\n", 381 | "1 2007scape adviceanimals\n", 382 | "2 2007scape askreddit\n", 383 | "3 2007scape funny\n", 384 | "4 2007scape gaming\n", 385 | "5 2007scape gifs\n", 386 | "6 2007scape globaloffensive\n", 387 | "Source: local data frame [6 x 3]\n", 388 | "\n", 389 | " name color group\n", 390 | " (chr) (chr) (dbl)\n", 391 | "1 2007scape #41AB5D 6\n", 392 | "2 3ds #00441B 10\n", 393 | "3 49ers #A50F15 33\n", 394 | "4 4chan #006D2C 5\n", 395 | "5 advice #00441B 7\n", 396 | "6 adviceanimals #006D2C 5\n" 397 | ] 398 | } 399 | ], 400 | "source": [ 401 | "# http://stackoverflow.com/questions/21243965/igraph-get-edge-from-to-value\n", 402 | "\n", 403 | "df_edges <- tbl_df(data.frame(get.edgelist(net), stringsAsFactors=FALSE))\n", 404 | "df_vertices <- tbl_df(data.frame(name=V(net)$name, color=V(net)$colornode, group=V(net)$group, stringsAsFactors=FALSE))\n", 405 | "\n", 406 | "print(head(df_edges))\n", 407 | "print(head(df_vertices))" 408 | ] 409 | }, 410 | { 411 | "cell_type": "code", 412 | "execution_count": 9, 413 | "metadata": { 414 | "collapsed": false 415 | }, 416 | "outputs": [ 417 | { 418 | "name": "stdout", 419 | "output_type": "stream", 420 | "text": [ 421 | "Source: local data frame [6 x 6]\n", 422 | "\n", 423 | " X1 X2 color.x group.x color.y group.y\n", 424 | " (chr) (chr) (chr) (dbl) (chr) (dbl)\n", 425 | "1 2007scape adviceanimals #41AB5D 6 #006D2C 5\n", 426 | "2 2007scape askreddit #41AB5D 6 #006D2C 5\n", 427 | "3 2007scape funny #41AB5D 6 #006D2C 5\n", 428 | "4 2007scape gaming #41AB5D 6 #08519C 8\n", 429 | "5 2007scape gifs #41AB5D 6 #006D2C 5\n", 430 | "6 2007scape globaloffensive #41AB5D 6 #41AB5D 6\n" 431 | ] 432 | } 433 | ], 434 | "source": [ 435 | "default_edge_color <- \"#cccccc\"\n", 436 | "\n", 437 | "df_edges <- df_edges %>% left_join(df_vertices, by=c(\"X1\"=\"name\")) %>% left_join(df_vertices, by=c(\"X2\"=\"name\"))\n", 438 | "E(net)$coloredge <- ifelse(df_edges$group.x==df_edges$group.y, df_edges$color.x, default_edge_color)\n", 439 | "\n", 440 | "print(head(df_edges))" 441 | ] 442 | }, 443 | { 444 | "cell_type": "markdown", 445 | "metadata": {}, 446 | "source": [ 447 | "Build the network layout. 50,000 iterations is enough for layout convergence." 448 | ] 449 | }, 450 | { 451 | "cell_type": "code", 452 | "execution_count": 10, 453 | "metadata": { 454 | "collapsed": false, 455 | "scrolled": true 456 | }, 457 | "outputs": [ 458 | { 459 | "name": "stderr", 460 | "output_type": "stream", 461 | "text": [ 462 | "Loading required package: network\n", 463 | "network: Classes for Relational Data\n", 464 | "Version 1.13.0 created on 2015-08-31.\n", 465 | "copyright (c) 2005, Carter T. Butts, University of California-Irvine\n", 466 | " Mark S. Handcock, University of California -- Los Angeles\n", 467 | " David R. Hunter, Penn State University\n", 468 | " Martina Morris, University of Washington\n", 469 | " Skye Bender-deMoll, University of Washington\n", 470 | " For citation information, type citation(\"network\").\n", 471 | " Type help(\"network-package\") to get started.\n", 472 | "\n", 473 | "\n", 474 | "Attaching package: ‘network’\n", 475 | "\n", 476 | "The following objects are masked from ‘package:igraph’:\n", 477 | "\n", 478 | " %c%, %s%, add.edges, add.vertices, delete.edges, delete.vertices,\n", 479 | " get.edge.attribute, get.edges, get.vertex.attribute, is.bipartite,\n", 480 | " is.directed, list.edge.attributes, list.vertex.attributes,\n", 481 | " set.edge.attribute, set.vertex.attribute\n", 482 | "\n", 483 | "The following object is masked from ‘package:sna’:\n", 484 | "\n", 485 | " %c%\n", 486 | "\n" 487 | ] 488 | }, 489 | { 490 | "name": "stdout", 491 | "output_type": "stream", 492 | "text": [ 493 | " x y centrality colornode defaultnode degree group na.x\n", 494 | "1 0.2893745 0.4687382 0.013282501 #41AB5D FALSE 17 6 FALSE\n", 495 | "2 0.3214649 0.3795588 0.007731622 #00441B FALSE 18 10 FALSE\n", 496 | "3 0.7652908 0.2848083 0.001340047 #A50F15 FALSE 3 33 FALSE\n", 497 | "4 0.4980805 0.4638789 0.055411772 #006D2C FALSE 62 5 FALSE\n", 498 | "5 0.7857507 0.6293891 0.005108509 #00441B FALSE 4 7 FALSE\n", 499 | "6 0.4729610 0.5305755 0.449733804 #006D2C FALSE 226 5 FALSE\n", 500 | " vertex.names xend yend coloredge connectDefault na.y Weight\n", 501 | "1 2007scape 0.2893745 0.4687382 NA NA NA\n", 502 | "2 3ds 0.3214649 0.3795588 NA NA NA\n", 503 | "3 49ers 0.7652908 0.2848083 NA NA NA\n", 504 | "4 4chan 0.4980805 0.4638789 NA NA NA\n", 505 | "5 advice 0.7857507 0.6293891 NA NA NA\n", 506 | "6 adviceanimals 0.4729610 0.5305755 NA NA NA\n" 507 | ] 508 | } 509 | ], 510 | "source": [ 511 | "df_net <- ggnetwork(net, layout = \"fruchtermanreingold\", weights=\"Weight\", niter=50000)\n", 512 | "\n", 513 | "write.csv(df_net, \"df_net.csv\", row.names=F)\n", 514 | "print(head(df_net))" 515 | ] 516 | }, 517 | { 518 | "cell_type": "code", 519 | "execution_count": 11, 520 | "metadata": { 521 | "collapsed": false, 522 | "scrolled": false 523 | }, 524 | "outputs": [ 525 | { 526 | "name": "stdout", 527 | "output_type": "stream", 528 | "text": [ 529 | " x y centrality colornode defaultnode degree group na.x\n", 530 | "20 0.2610215 0.6775423 0.00457658 #006D2C TRUE 6 5 FALSE\n", 531 | "25 0.4901913 0.4970370 1.00000000 #006D2C TRUE 887 5 FALSE\n", 532 | "26 0.4174736 0.6233355 0.01409392 #006D2C TRUE 18 5 FALSE\n", 533 | "39 0.5055989 0.5204532 0.21326200 #006D2C TRUE 116 5 FALSE\n", 534 | "63 0.6083284 0.5272011 0.03790249 #006D2C TRUE 37 5 FALSE\n", 535 | "108 0.5682124 0.5922601 0.03120117 #006D2C TRUE 29 5 FALSE\n", 536 | " vertex.names xend yend coloredge connectDefault na.y Weight\n", 537 | "20 art 0.2610215 0.6775423 NA NA NA\n", 538 | "25 askreddit 0.4901913 0.4970370 NA NA NA\n", 539 | "26 askscience 0.4174736 0.6233355 NA NA NA\n", 540 | "39 aww 0.5055989 0.5204532 NA NA NA\n", 541 | "63 books 0.6083284 0.5272011 NA NA NA\n", 542 | "108 creepy 0.5682124 0.5922601 NA NA NA\n" 543 | ] 544 | } 545 | ], 546 | "source": [ 547 | "df_net_defaults = df_net[which(df_net$default),]\n", 548 | "print(head(df_net_defaults))" 549 | ] 550 | }, 551 | { 552 | "cell_type": "markdown", 553 | "metadata": {}, 554 | "source": [ 555 | "We will color the nodes whether or not they are a default subreddit (orange if default, blue otherwise) and color the lines accordingly (orange if either end is a default subreddit, blue otherwise)." 556 | ] 557 | }, 558 | { 559 | "cell_type": "code", 560 | "execution_count": 21, 561 | "metadata": { 562 | "collapsed": false 563 | }, 564 | "outputs": [ 565 | { 566 | "data": { 567 | "text/html": [ 568 | "pdf: 2" 569 | ], 570 | "text/latex": [ 571 | "\\textbf{pdf:} 2" 572 | ], 573 | "text/markdown": [ 574 | "**pdf:** 2" 575 | ], 576 | "text/plain": [ 577 | "pdf \n", 578 | " 2 " 579 | ] 580 | }, 581 | "execution_count": 21, 582 | "metadata": {}, 583 | "output_type": "execute_result" 584 | } 585 | ], 586 | "source": [ 587 | "default_colors=c(\"#3498db\", \"#e67e22\")\n", 588 | "default_labels=c(\"Not Default\", \"Default\")\n", 589 | "\n", 590 | "svglite(\"subreddit-1.svg\", width=10, height=8) \n", 591 | " ggplot(df_net, aes(x = x, y = y, xend = xend, yend = yend, size = centrality)) +\n", 592 | " geom_edges(aes(color = connectDefault), size=0.05) +\n", 593 | " geom_nodes(aes(fill = defaultnode), shape = 21, stroke=0.2, color=\"black\") +\n", 594 | " geom_nodelabel_repel(data=df_net, aes(color = defaultnode, label = vertex.names),\n", 595 | " fontface = \"bold\", size=0.5, box.padding = unit(0.05, \"lines\"),\n", 596 | " label.padding= unit(0.1, \"lines\"), segment.size=0.1, label.size=0.2) +\n", 597 | " scale_color_manual(values=default_colors, labels=default_labels, guide=F) +\n", 598 | " scale_fill_manual(values=default_colors, labels=default_labels) +\n", 599 | " ggtitle(\"Network Graph of Reddit Subreddits (by @minimaxir)\") +\n", 600 | " scale_size(range=c(0.1, 4)) + \n", 601 | " theme_blank()\n", 602 | "dev.off()\n", 603 | "\n", 604 | "rsvg_pdf(\"subreddit-1.svg\", \"subreddit-1.pdf\")" 605 | ] 606 | }, 607 | { 608 | "cell_type": "markdown", 609 | "metadata": {}, 610 | "source": [ 611 | "Color by group: if an edge links to a node of the same group, the edge is colored that group. Otherwise, the edge is colored gray. " 612 | ] 613 | }, 614 | { 615 | "cell_type": "code", 616 | "execution_count": 22, 617 | "metadata": { 618 | "collapsed": false 619 | }, 620 | "outputs": [ 621 | { 622 | "data": { 623 | "text/html": [ 624 | "pdf: 2" 625 | ], 626 | "text/latex": [ 627 | "\\textbf{pdf:} 2" 628 | ], 629 | "text/markdown": [ 630 | "**pdf:** 2" 631 | ], 632 | "text/plain": [ 633 | "pdf \n", 634 | " 2 " 635 | ] 636 | }, 637 | "execution_count": 22, 638 | "metadata": {}, 639 | "output_type": "execute_result" 640 | } 641 | ], 642 | "source": [ 643 | "svglite(\"subreddit-2.svg\", width=10, height=8) \n", 644 | " ggplot(df_net, aes(x = x, y = y, xend = xend, yend = yend, size = centrality)) +\n", 645 | " geom_edges(aes(color = coloredge), size=0.05) +\n", 646 | " geom_nodes(aes(fill = colornode), shape = 21, stroke=0.2, color=\"black\") +\n", 647 | " geom_nodelabel_repel(data=df_net, aes(color = colornode, label = vertex.names),\n", 648 | " fontface = \"bold\", size=0.5,\n", 649 | " box.padding = unit(0.05, \"lines\"), label.padding= unit(0.1, \"lines\"), segment.size=0.1, label.size=0.2) +\n", 650 | " scale_color_identity(\"colornode\", guide=F) +\n", 651 | " scale_fill_identity(\"colornode\", guide=F) +\n", 652 | " scale_size(range=c(0.2, 3), guide=F) +\n", 653 | " ggtitle(\"Network Graph of Reddit Subreddits (by @minimaxir)\") +\n", 654 | " theme_blank()\n", 655 | "dev.off()\n", 656 | "\n", 657 | "rsvg_pdf(\"subreddit-2.svg\", \"subreddit-2.pdf\")" 658 | ] 659 | }, 660 | { 661 | "cell_type": "markdown", 662 | "metadata": {}, 663 | "source": [ 664 | "For the subgroups, use a function that prints a visualization of the subgraph for *each* group. Since the groups are in random order, sort out the important ones later.\n", 665 | "\n", 666 | "NB: Since output is a PNG with fixed dimensions and not a SVG, the style parameters of graph aestetics must be changed." 667 | ] 668 | }, 669 | { 670 | "cell_type": "code", 671 | "execution_count": 23, 672 | "metadata": { 673 | "collapsed": false 674 | }, 675 | "outputs": [], 676 | "source": [ 677 | "subreddit_graph_subset <- function(group_number) {\n", 678 | "\n", 679 | "df_network <- df_net[which(df_net$group==group_number),]\n", 680 | "\n", 681 | "plot <- \n", 682 | " ggplot(df_network, aes(x = x, y = y, xend = xend, yend = yend, size = centrality)) +\n", 683 | " geom_edges(data=df_network[which(df_network$coloredge!=default_edge_color),], aes(color = coloredge), size=0.05) +\n", 684 | " geom_nodes(aes(fill = colornode), shape = 21, stroke=0.5, color=\"black\") +\n", 685 | " geom_nodelabel_repel(data=df_network, aes(color = colornode, label = vertex.names),\n", 686 | " fontface = \"bold\", family=\"Open Sans Condensed\", size=1.5,\n", 687 | " box.padding = unit(0.10, \"lines\"), label.padding= unit(0.1, \"lines\"), segment.size=0.1, label.size=0.5, label.r=unit(0.15, \"lines\")) +\n", 688 | " scale_color_identity(\"colornode\", guide=F) +\n", 689 | " scale_fill_identity(\"colornode\", guide=F) +\n", 690 | " scale_size(range=c(0.2, 6), guide=F) +\n", 691 | " ggtitle(sprintf(\"Network Subgraph of Group %s Subreddits\",group_number)) +\n", 692 | " theme_blank(base_size=7, base_family=\"Source Sans Pro\")\n", 693 | " \n", 694 | "ggsave(sprintf(\"subreddit-groups/group-%03d.png\", group_number), plot, width=4, height=3, dpi=300)\n", 695 | "\n", 696 | "}" 697 | ] 698 | }, 699 | { 700 | "cell_type": "code", 701 | "execution_count": 24, 702 | "metadata": { 703 | "collapsed": false 704 | }, 705 | "outputs": [], 706 | "source": [ 707 | "x <- lapply(1:max(V(net)$group), subreddit_graph_subset)" 708 | ] 709 | }, 710 | { 711 | "cell_type": "markdown", 712 | "metadata": { 713 | "collapsed": true 714 | }, 715 | "source": [ 716 | "# The MIT License (MIT)\n", 717 | "\n", 718 | "Copyright (c) 2016 Max Woolf\n", 719 | "\n", 720 | "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n", 721 | "\n", 722 | "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n", 723 | "\n", 724 | "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." 725 | ] 726 | } 727 | ], 728 | "metadata": { 729 | "kernelspec": { 730 | "display_name": "R", 731 | "language": "R", 732 | "name": "ir" 733 | }, 734 | "language_info": { 735 | "codemirror_mode": "r", 736 | "file_extension": ".r", 737 | "mimetype": "text/x-r-source", 738 | "name": "R", 739 | "pygments_lexer": "r", 740 | "version": "3.3.0" 741 | } 742 | }, 743 | "nbformat": 4, 744 | "nbformat_minor": 0 745 | } 746 | --------------------------------------------------------------------------------