---
title: "Refugee Analysis"
author: "Pulkit Seth"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
social: menu
source_code: embed
vertical_layout: scroll
theme: cosmo
---
```{r setup, include=FALSE}
library(flexdashboard)
library(rworldmap)
library(RColorBrewer)
library(ggplot2)
library(plotly)
library(dygraphs)
library(readxl)
data2 <- read.csv('D:/Google Drive Sync/Harrisburg University/CourseWork/Trimester 3/Data Visualization/Dashboard assignment/Dashboard project/data.csv')
tso = ts(data2)
Refugees <- read_excel("D:/Google Drive Sync/Harrisburg University/CourseWork/Trimester 3/Data Visualization/Dashboard assignment/Dashboard project/Refugees.xlsx")
AsylumSeekers <- read_excel("D:/Google Drive Sync/Harrisburg University/CourseWork/Trimester 3/Data Visualization/Dashboard assignment/Dashboard project/AsylumSeekers.xlsx")
##Refugee <- read_excel("~/Desktop/Refugee.xlsx")
```
Dashboard {data-orientation=rows data-icon="fa-bar-chart"}
=====================================
## Row 1 {data-height=100}
### Forcibly displaced People
```{r}
valueBox("65.6 M")
```
### Stateless People
```{r}
valueBox("10 M", color="rgb(200,100,100)")
```
### Countries
```{r}
valueBox("130",color="rgb(26,110,204)")
```
## Row 2 {data-height=150}
### Number of refugees vs total Displaced people
```{r}
rate = sum(data2$Value)
gauge(22500000, min = 0, max = 65600000, gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))
```
### Refugee Settled among the total number of refugees
```{r}
rate = sum(data2$Value)
gauge(189300, min = 0, max = 22500000, gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))
```
### Returned Refugees
```{r}
rate = sum(data2$Value)
gauge(1376145, min = 0, max = 65600000, gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))
```
## Coulmn 1 {.tabset data-height=400}
### Timeseries for Asylum seekers over the years
```{r}
dygraph(tso, group = "Year",main="Asylum seekers Till Date") %>% dySeries() %>% dyRangeSelector()
```
### Asylum seekers from the top 3 countries of origin
```{r}
data <- data.frame(AsylumSeekers$Year, AsylumSeekers$Syria, AsylumSeekers$Afghanistan, AsylumSeekers$Somalia)
q <- plot_ly(AsylumSeekers, x = ~Year, y = ~AsylumSeekers$Syria, name = 'Syria', type = 'scatter', mode = 'lines+markers') %>%
add_trace(y = ~AsylumSeekers$Afghanistan, name = 'Afghanistan', mode = 'lines+markers') %>%
add_trace(y = ~AsylumSeekers$Somalia, name = 'Somalia', mode = 'lines+markers')%>%
layout(
title = "Total Pending Asylum Seekers",
xaxis = list(title = "Year Range"),
yaxis = list(title = "Asylum Seekers")
)
q
```