-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yiqiang
committed
May 6, 2018
1 parent
a82f9b1
commit 6b043e1
Showing
13 changed files
with
163 additions
and
52 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
In the Wolrd War II, The Axis powers, also known as the Axis and the Rome–Berlin–Tokyo Axis, were the nations that fought in World War II against the Allied forces. The Axis powers agreed on their opposition to the Allies, but did not completely coordinate their activity. The Axis grew out of the diplomatic efforts of Germany, Italy, and Japan to secure their own specific expansionist interests in the mid-1930s.<br>The Allies of World War II, called the United Nations from the 1 January 1942 declaration, were the countries that together opposed the Axis powers.The leaders of the "Big Three"—the Soviet Union, the United Kingdom, and the United States—controlled Allied strategy.<br><br>In the following Chord Diagram, different colors indicate military alliances. Clicking on one country, the Barplot on the right side will show cities being attacked associated to (may not be in) that country's force. |
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
library(tidyverse) | ||
####Data Preprocessing####0 | ||
setwd("/media/yiqiang/D/USF/622DataViz/final project/finalproject/dataviz/") | ||
## Part 1: parse data to get map data | ||
df <- read_csv("data/operations.csv") | ||
map_data <- df %>% filter(is.na(Country) == FALSE & is.na(`Target Longitude`) == FALSE & is.na(`Takeoff Longitude`) == FALSE) %>% | ||
filter(`Takeoff Latitude` != '4248', `Takeoff Longitude` != 1355) %>% | ||
filter(`Target Longitude` > 0, `Takeoff Longitude` > 0, `Target Latitude` > 0, `Target Longitude` <=360) %>% | ||
mutate(id=1:n()) | ||
map_data$`Mission Date` <- as.Date(anytime::anydate(map_data$`Mission Date`)) | ||
map_data$start_week <- cut(map_data$`Mission Date`, "week") | ||
flight_route <- gcIntermediate(map_data[ , c("Takeoff Longitude", "Takeoff Latitude")], | ||
map_data[ , c("Target Longitude", "Target Latitude")], | ||
n=20, | ||
addStartEnd=TRUE, | ||
sp=TRUE) | ||
write.csv(map_data, file = "data/simplified_data.csv", row.names = FALSE) | ||
save(flight_route, file="data/flight_route.rda") | ||
|
||
## Part 2: parse data to get obs count ts data | ||
Mission <- df %>% select(`Mission Date`, `Mission ID`) %>% | ||
filter(is.na(`Mission Date`) == F) | ||
Mission$`Mission Date` <- as.Date(anytime::anydate(Mission$`Mission Date`)) | ||
Mission$start_month <- cut(Mission$`Mission Date`, "month") | ||
Mission$start_month = as.Date(Mission$start_month) | ||
Mission <- Mission %>% arrange(`Mission Date`) | ||
monthly_ct <- Mission %>% group_by(start_month) %>% summarise('ct' = n()) | ||
write.csv(monthly_ct, file = "data/monthly_obs_count.csv", row.names = FALSE) | ||
|
||
## Part 3: chorddiag data | ||
diag_data <- df %>% select(`Target Country`, Country) %>% group_by(., `Target Country`, Country) %>% | ||
count() %>% filter(., is.na(Country) == FALSE, is.na(`Target Country`) == FALSE, n>100, | ||
`Target Country` != 'UNKNOWN OR NOT INDICATED') | ||
library(igraph) | ||
diag_data <- as.data.frame(diag_data) | ||
diag_data[, 1] <- as.character(diag_data[, 1]) | ||
diag_data[, 2] <- as.character(diag_data[, 2]) | ||
diag_data[, 3] <- as.numeric(diag_data[, 3]) | ||
diag_data <- as.matrix(diag_data) | ||
diag_net <- igraph::graph.edgelist(diag_data[,1:2]) | ||
E(diag_net)$weights <- as.numeric(diag_data[,3]) | ||
ajmatrix <- get.adjacency(diag_net,attr='weights', sparse = FALSE) | ||
Occupied <- toupper(c("Albania", "Belgium", "Czechoslovakia", "Denmark", "Estonia", | ||
"Ethiopia", "France", "Greece", "Luxemburg", "Netherlands", | ||
"Norway", "Philippine Islands", "Poland", "Yugoslavia")) | ||
Axis <- toupper(c("Bulgaria", "Finland", "Germany", "Hungary", "Italy", "Japan", "Romania")) | ||
Allies <- toupper(c("Argentina", "Australia", "Bolivia", "Brazil", "Canada", "China", | ||
"Chile", "Columbia", "Costa Rica", "Cuba", "France", "India", "Iraq", | ||
"Lebanon", "Mexico", "New Zealand", "Paraguay", "South Africa", "Soviet Union", | ||
"Great Britain", "USA")) | ||
Neutral <- toupper(c("Andorra", "Ireland", "Liechtenstein", "Portugal", "Spain", "Sweden", | ||
"Switzerland", "Turkey", "Uruguay", "Vatican City")) | ||
groupColors = c() | ||
for(country in dimnames(ajmatrix)[[1]]){ | ||
if(country %in% Occupied){ | ||
groupColors = c(groupColors, "#636363") | ||
}else if(country %in% Axis){ | ||
groupColors = c(groupColors, "#25338a") | ||
}else if (country %in% Allies){ | ||
groupColors = c(groupColors, "#9ecae1") | ||
}else if (country %in% Neutral){ | ||
groupColors = c(groupColors, "#bdbdbd") | ||
}else{ | ||
groupColors = c(groupColors, "#bdbdbd") | ||
} | ||
} | ||
save(ajmatrix, file = "data/ajmatrix.rda") | ||
save(groupColors, file="data/groupColors.rda") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.