WT-DATA-PROJECT.VISUALIZATION
This repo is the visualization part of wt-data-project.
Repository | Info |
---|---|
wt-data-project.data |
|
wt-data-project.web |
|
wt-data-project.visualization |
|
Data
The data is in this repo.
To use this visualization repo, you need create a directory like this. The data
directory contains everything in
the wt-data-project.data
repo, and the visualization
directory contains everything in this repo.
wt-data-project (as working directory)
├─data
│ ├─joined
│ ├─ts
│ └─wk
└─visualization
Web
A web-based visualization repo is in WIP.
https://wt.controlnet.space.
You can check this inRequirements
This repo is written by R 4.0.2. Please download R interpreter to use.
Please use code below to install 3rd-party packages.
install.packages("<package name>")
- dplyr
- reshape2
- ggplot2
- data.table
- gganimate
- gifski
- ggsci
Example
Please use main.R
to run functions below.
source("visualization/utils.R")
source("visualization/static_plot.R")
source("visualization/time_animation.R")
source("visualization/time_trend.R")
# add everything you want
# for example
static.heatmap.default.ground_vehicles.win_rate()
There are some default functions for easy use.
Display the win rates/battles of ground vehicles/aviation for each BR range and nation.
static.heatmap.default.ground_vehicles.win_rate()
static.heatmap.default.ground_vehicles.battles()
static.heatmap.default.aviation.win_rate()
static.heatmap.default.aviation.battles()
Display a pie chart of the battle counts for each nation
static.pie.default.battles()
Except the default functions, there are more functions you can use for visualizations with specified arguments.
For example, you can visualize the trend of battles counts with the code below.
trend.nations.battles(class.sample = "Ground_vehicles", y = "rb_battles_sum")
Also, you can plot each vehicle as a scatter.
static.scatter(date.sample = "2020-08-13", class.sample = "Ground_vehicles",
x = "rb_ground_frags_per_death", y = "rb_win_rate", size = "rb_battles",
x.limits = NULL, y.limits = NULL, colors = NULL)
With the code below, it is a bar chart for a nation in one specific date.
static.bars(nation.sample = "USA",
date.sample = "2020-08-13",
class.sample = c("Aviation", "Ground_vehicles"),
y = "rb_win_rate", y.limits = NULL)
Also, you can make gif animation with these codes below.
animation.trend.heatmap(class.sample = "Ground_vehicles", fill = "rb_win_rate",
fill.limits = c(0, 100),
colors = c(white, black, red, yellow, green, black, black),
colors.pos = c(0, 0.05, 0.4, 0.5, 0.6, 0.95, 1.0)) %>% animation.render
# if you need save as a file
anim_save(filename = "out.gif")