ControlNet / wt-data-project.visualization

Visualization part of wt-data-project.

Home Page:https://wt.controlnet.space

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

You can check this in https://wt.controlnet.space.

Requirements

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()

static_heatmap_default_demo

Display a pie chart of the battle counts for each nation

static.pie.default.battles()

static_pie_default_battles_demo

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")

trend_nations_battles_demo

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)

static_scatter_demo

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)

static_bars_demo

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")

animation_trend_heatmap_demo

About

Visualization part of wt-data-project.

https://wt.controlnet.space

License:GNU Affero General Public License v3.0


Languages

Language:R 100.0%