-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
61 lines (47 loc) · 1.76 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: "NASA Astronauts"
output:
flexdashboard::flex_dashboard:
storyboard: true
theme: cosmo
social: [ "twitter", "facebook", "menu" ]
source_code: "https://github.com/retowyss/dataisbeautiful-2018-11"
---
```{r setup, include=FALSE}
library(flexdashboard)
library(readr)
library(visNetwork)
library(plotly)
library(tidyverse)
edges <- read_csv("data/edges.csv")
nodes <- read_csv("data/nodes.csv")
```
### Astronaut Mission Network
```{r}
visNetwork(nodes, edges, height = "100%", width = "100%") %>%
visOptions(highlightNearest = TRUE, autoResize = T) %>%
visIgraphLayout(layout = "layout_with_fr") %>%
visInteraction(navigationButtons = TRUE) %>%
visOptions(highlightNearest = list(enabled = T, hover = T),
nodesIdSelection = T)
```
***
This is the Astronaut Mission Network. Astronauts are nodes and missions are edges. The color indicates the selection year (lighter is more recent, see the Astronauts by Selection Year tab). The node size is scaled to the cummulative number of flight hours, wheras the thickness of an edge is scaled on the number of common missions.
### Astronaut Mission Network (Circle)
```{r}
visNetwork(nodes, edges, height = "100%", width = "100%") %>%
visOptions(highlightNearest = TRUE, autoResize = T) %>%
visIgraphLayout(layout = "layout_in_circle") %>%
visInteraction(navigationButtons = TRUE) %>%
visOptions(highlightNearest = list(enabled = T, hover = T),
nodesIdSelection = T)
```
***
Same as the previous tab but arranged in a circle.
### Number of Astronauts Selected by Year
```{r}
nodes %>%
mutate(group = factor(group, levels = unique(group))) %>%
plot_ly(x = ~ group, color = ~ group, colors = ~ color) %>%
layout(showlegend = FALSE, xaxis = list(title = ""))
```