ADI

Column

A Geospatial Equity Analysis

Row

Areas of Disproportionate Impact (ADI)

Row

Industry Equity

Applications

Column

Applications

Select intputs to filter the data.

ADI

Column

Map

Data

Equity

ADI vs Non_ADI value boxes

Column

Applications

Filter the data to update the pie charts.

ADI

Filter the data to update the pie charts.

Licenses

Column

License

Select intputs to filter the data.

Licenses

ADI

Column

Map

Data

Equity

Column

Licenses

ADI

Authority

Column

Authority

Select intputs to filter the data.

Entities

Interests

ADI

Select intputs to filter the data.

Column

Map

Data

Equity

Column

Authority

---
title: "Cannabis Reparations"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    theme: cosmo
    vertical_layout: fill
    source: embed
    social: [ "twitter", "facebook" ]
    logo: cannabisreparations1.ico
---

```{r setup, include=FALSE}
library(flexdashboard)# interactive dashboard 
library(readxl) # import excel data set 
library(leaflet) #create interactive maps
library(tidyverse) # load core packages for data visualisation (dplyr:for data manipulation, tidyr:for data tidying, readr:for data import, purrr:for functional programming, tibble:for tibbles, a modern re-imagining of data frames, stringr:for strings, forcats:for factors)
library(DT) #Display data tables
library(crosstalk) # extends htmlwidgets
library(sf) #load shapefiles 
library(RColorBrewer) # color palaette
library(geojsonR) # need for geolines
library(shiny)
library(plyr)
library(plotly)
library(lubridate)
library(ggplot2) 
library(sp)
library(icon)
library(emojifont)
library(geosphere)

```

```{r data, include=FALSE}
# Load Cannabis Data
Applications <- read_csv("Apps.csv")
License <- read_csv("Lic.csv")
Authority_Entities <- read_csv("AE.csv")
Business_Interets <- read_csv("BI.csv")
Geolines <- read_csv("Geolines.csv")

Applications$combo <- paste(Applications$Application_Status, Applications$Priority_Status,Applications$DBE_Category, Applications$License_Type, sep = "-")
Applications$Date_Created <- as.Date(Applications$Date_Created, format = "%m/%d/%y")
License$Date_Created <- as.Date(License$Date_Created, format = "%m/%d/%y")
License$Date_Submitted <- as.Date(License$Date_Submitted, format = "%m/%d/%y")
License$Date_Final_Licensure <- as.Date(License$Date_Final_Licensure, format = "%m/%d/%y")

# Load Shape Data 
ADI_Merged_shape <-st_read("Cannabis_ADI_shape/Cannabis_ADI_shape.shp", stringsAsFactors=FALSE, quiet=TRUE)
ADI_Merged_shape <-st_transform(ADI_Merged_shape,'+proj=longlat +datum=WGS84')

Authority_Entities <- Authority_Entities %>%
  mutate(AutAboxinfo = paste0('Authority Name: ', Full_Name, '
', 'Role: ', Role, '
', 'Ownership: ', Ownership, '
', 'Control: ', Control, '
', 'Business Name: ', Business_Name, '
', 'License Status: ', License_Status, '
', 'Priority Status: ', Priority_Status, '
', 'License Type: ', License_Type, '
', 'DBE Category: ', DBE_Category, '
', 'Business Address: ', Business_Address, '
', 'Total Authority Agents: ', Total_Authority_Agents, '
')) Business_Interets <- Business_Interets %>% mutate(BIboxinfo = paste0('Authority Name: ', Full_Name, '
', 'Role: ', Role, '
', 'Business Name: ', Business_Name, '
', 'License Status: ', License_Status, '
', 'Priority Status: ', Priority_Status, '
', 'License Type: ', License_Type, '
', 'DBE Category: ', DBE_Category, '
', 'Business Address: ', Business_Address, '
', 'Total Authority Agents: ', Total_Authority_Agents, '
')) # Generate geolines data flows <- gcIntermediate(Geolines[,2:3], Geolines[,5:6], sp = TRUE, addStartEnd = TRUE) flows$Business_Name <- Geolines$business.name flows$Total_Agents <- Geolines$total.agents flows$Layer <- Geolines$layer flows$Ownership <- Geolines$ownership flows$Control <- Geolines$control # created shared data for geolines flows_sd <-SharedData$new(flows) sd_df <- SharedData$new(flows@data, group = flows_sd$groupName()) # create hover information for geolines hover <- paste0(flows_sd$data()$Business_Name, " to ", flows_sd$data()$Priority_Status, ': ', flows_sd$data()$DBE_Category, " | ", as.character(flows_sd$data()$Total_Agents)) # Create sharedDataFrames App_sd <-SharedData$new(Applications, group = "Applications") Lic_sd <-SharedData$new(License, group = "Licenses") AE_sd <-SharedData$new(Authority_Entities, group = "Entities") BI_sd <-SharedData$new(Business_Interets, group = "Interests") ADI_sd <- SharedData$new(ADI_Merged_shape, group = "ADI") ADI_sd_df <- SharedData$new(as.data.frame(ADI_Merged_shape), group = ADI_sd$groupName()) ``` ADI {data-icon="fa-cannabis"} ===================================== Column {data-width=300} ----------------------------------------------------------------------- ### A Geospatial Equity Analysis ```{r} # What is a Geospoatioanl Equity Analysis # What varibales are we exploring ``` Row {data-width=400} ----------------------------------------------------------------------- ### Areas of Disproportionate Impact (ADI) ```{r} # Who are they and what are some overview charracsterics ``` Row {data-width=300} ----------------------------------------------------------------------- ### Industry Equity ```{r} # Application Data vs Municupliaty Data # add HTML link that directs folks to the MCCC data catelog ``` Applications {data-icon="fa-cannabis"} ===================================== Column {data-width=200 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Applications > Select intputs to filter the data. ```{r app town filter} filter_select("Business_Town", "Select Town", App_sd, ~Business_Town) ``` ```{r app county filter} filter_select("Business_County", "Select a County", App_sd, ~Business_County) ``` ```{r app prioirty status filter} filter_checkbox("Priority_Status", "Priority Status", App_sd, ~Priority_Status, allLevels = TRUE) ``` ```{r app applicatin status filter} filter_checkbox("Application_Status", "Application Status", App_sd, ~Application_Status, allLevels = TRUE) ``` ```{r app license type filter} filter_select("License_Type","License Type", App_sd, ~License_Type) ``` ```{r app date created filter} ``` ```{r app total applications fitler} filter_slider("Total_Apps", "Total Applications", App_sd, ~Total_Apps, step = 1) ``` ```{r app dbe category filter} filter_select("DBE_Category","DBE Category", App_sd, ~DBE_Category) ``` ```{r app business name filter} filter_select("Business_Name","Search Business Name ", App_sd, ~Business_Name) ``` ### ADI ```{r adi filter} filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C) ``` ```{r aus filter} filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S) ``` ```{r delivery filter} filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A) ``` ```{r social consumption filter} filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P) ``` Column {data-width=650 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Map ```{r app map} appPSpal <- colorFactor(palette = c("#2ca02c", "#bcbd22"), App_sd$Application_Status, na.color = "#808080", alpha = TRUE) leaflet() %>% setView(-71.931180, 42.385453, zoom = 8) %>% addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>% addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>% addPolygons(data = ADI_sd, weight = .4, smoothFactor = 1, fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = .5, no = 0), color = "#878787", fillColor = "#17b502", label = ~Town_1, # name as a hover label group = "ADI") %>% addCircleMarkers(data = App_sd, lng = ~longitude, lat = ~latitude, popup = ~Appboxinfo, fillOpacity = ifelse(test = App_sd$data()$Priority_Status == "Economic Empowerment", yes = 1, no = 0), fillColor = "red", color = ~appPSpal(Application_Status), radius = App_sd$data()$Total_Apps*2.5, group = "Applications") %>% addLegend("bottomleft", pal = appPSpal, values = App_sd$data()$Application_Status, title = "Applications Status", opacity = 1) %>% addLayersControl(overlayGroups = c("ADI","Applications"), baseGroups = c("Dark","Grey", "Applications"), options = layersControlOptions(collapsed = FALSE)) %>% addMeasure() ``` ### Data ```{r app data table} datatable(App_sd, extensions= c('Buttons', "Scroller"), class="compact", width="100%", rownames = FALSE, options=list( dom = 'Blfrtip', deferRender=TRUE, scrollY=300, scroller=TRUE, columnDefs = list(list(visible=FALSE, targets=c(8,9))), buttons = list(I('colvis'), 'csv', 'excel'))) ``` ### Equity ```{r app equity } # Summary break down with static charts and detailed descritpiton explaining what the data is telling us ``` ADI vs Non_ADI value boxes ```{r} ``` Column {data-width=350 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Applications Filter the data to update the pie charts. ```{r app priority status pie} div( div(plot_ly(App_sd, labels = ~ Application_Status, values = ~ Total_Apps, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(App_sd, labels = ~ Priority_Status, values = ~ Total_Apps, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r app lic type dbe pie} div( div(plot_ly(App_sd, labels = ~ License_Type, values = ~ Total_Apps, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F)), div(plot_ly(App_sd, labels = ~ DBE_Category, values = ~ Total_Apps, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F)) ) ``` ```{r app town county pie} div( div(plot_ly(App_sd, labels = ~ Business_Town, values = ~ Total_Apps, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Town",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(App_sd, labels = ~ Business_County, values = ~ Total_Apps, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "County",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ### ADI Filter the data to update the pie charts. ```{r app adi pie} div( div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ Ttl_Ap_A, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Total Applications",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ Mrjn_Arr_1, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Total Marijuana Arrests",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r app adi msa ctat pie} div( div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ M_S_A, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Marijuana Sale Arrest Rate",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ C_T_A_T, type = 'pie', textposition = 'inside', marker = list(colors = c('#bcbd22', '#2ca02c')), textinfo = 'percent', showlegend=F) %>% layout(title = "Cannabis Tax Actual Total",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r app adi pie} ``` Licenses {data-icon="fa-cannabis"} ===================================== Column {data-width=200 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### License Select intputs to filter the data. Licenses ```{r lic town filter} # App Town filter filter_select("Business_Town", "Select Town", Lic_sd, ~Business_Town) ``` ```{r lic county filter} # App County filter filter_select("Business_County", "Select a County", Lic_sd, ~Business_County) ``` ```{r lic prioirty status filter} filter_checkbox("Priority_Status", "Prioirty Status", Lic_sd, ~Priority_Status, allLevels = TRUE) ``` ```{r lic status filter} filter_checkbox("License_Status", "License Status", Lic_sd, ~License_Status, allLevels = TRUE) ``` ```{r lic license type filter} filter_select("License_Type","License Type", Lic_sd, ~License_Type) ``` ```{r lic date created filter} ``` ```{r lic date submitted filter} ``` ```{r lic date approved filter} ``` ```{r lic total licenses fitler} filter_slider("Total_Licenses", "Total Licenses", Lic_sd, ~Total_Licenses, step = 1) ``` ```{r lic dbe category filter} filter_select("DBE_Category","DBE Category", Lic_sd, ~DBE_Category) ``` ```{r lic business name filter} filter_select("Business_Name","Search Business Name ", Lic_sd, ~Business_Name) ``` ### ADI ```{r lic adi filter} filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C) ``` ```{r lic aus filter} filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S) ``` ```{r lic delivery filter} filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A) ``` ```{r lic social consumption filter} filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P) ``` Column {data-width=650 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Map ```{r lic map} LicPSpal <- colorFactor(palette = c("#2ca02c", "#bcbd22", "#1f77b4"), Lic_sd$License_Status, na.color = "#808080", alpha = TRUE) leaflet() %>% setView(-71.931180, 42.385453, zoom = 8) %>% addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>% addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>% addPolygons(data = ADI_sd, weight = .4, smoothFactor = 1, fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = .5, no = 0), color = "#878787", fillColor = "#17b502", label = ~Town_1, # name as a hover label group = "ADI") %>% addCircleMarkers(data = Lic_sd, lng = ~Lon, lat = ~Lat, popup = ~Licboxinfo, fillOpacity = ifelse(test = Lic_sd$data()$Priority_Status == "Economic Empowerment", yes = 1, no = 0), fillColor = "red", color = ~LicPSpal(License_Status), radius = Lic_sd$data()$Total_Licenses*2.5, group = "Licenses") %>% addLegend("bottomleft", pal = LicPSpal, values = Lic_sd$data()$License_Status, title = "License Status", opacity = 1) %>% addLayersControl(overlayGroups = c("ADI","Licenses"), baseGroups = c("Dark","Grey", "Licenses"), options = layersControlOptions(collapsed = FALSE)) %>% addMeasure() ``` ### Data ```{r lic data table} # add HTML link that directs folks to the MCCC data catelog datatable(Lic_sd, extensions= c('Buttons', "Scroller"), class="compact", width="100%", rownames = FALSE, options=list( dom = 'Blfrtip', deferRender=TRUE, scrollY=300, scroller=TRUE, columnDefs = list(list(visible=FALSE, targets=c(8,9))), buttons = list(I('colvis'), 'csv', 'excel'))) ``` ### Equity ```{r lic equity } # Summary break down with static charts and detailed descritpiton explaining what the data is telling us ``` Column {data-width=350 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Licenses ```{r lisc status pie} div( div(plot_ly(Lic_sd, labels = ~ License_Status, values = ~ Total_Licenses, type = 'pie', marker = list(colors = c("#2ca02c", "#bcbd22", "#1f77b4")), textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "License Status",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ Priority_Status, values = ~ Total_Licenses, type = 'pie', textposition = 'inside', marker = list(colors = c("#2ca02c", "#bcbd22", "#1f77b4")), textinfo = 'label+percent', showlegend=F) %>% layout(title = "Priority Status",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ License_Type, values = ~ Total_Licenses, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "License Type",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ DBE_Category, values = ~ Total_Licenses, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "DBE Category", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r lic priority status pie} div( div(plot_ly(Lic_sd, labels = ~ Business_Town, values = ~ Total_Licenses, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Town Licenses",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ Business_Town, values = ~ Application_Fee, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Town Application Fees",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ Business_Town, values = ~ Lic_Fee, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Town License Fees",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) div( div(plot_ly(Lic_sd, labels = ~ Business_County, values = ~ Total_Licenses, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "County Licenses",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ Business_County, values = ~ Application_Fee, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "County Application Fees",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(Lic_sd, labels = ~ Business_County, values = ~ Lic_Fee, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "County License Fees",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ### ADI ```{r adi lic town pie} div( div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ Ttl_Ap_A, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Total Applications",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ Mrjn_Arr_1, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Total Marijuana Arrests",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ M_S_A, type = 'pie', marker = list(colors = c('#bcbd22', '#2ca02c')), textposition = 'inside', textinfo = 'percent', showlegend=F) %>% layout(title = "Marijuana Sale Arrest Rate",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ C_T_A_T, type = 'pie', textposition = 'inside', marker = list(colors = c('#bcbd22', '#2ca02c')), textinfo = 'percent', showlegend=F) %>% layout(title = "Cannabis Tax Actual Total",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r adi lic app fee pie} div( div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ App_F, type = 'pie', textposition = 'inside', marker = list(colors = c('#bcbd22', '#2ca02c')), textinfo = 'percent', showlegend=F) %>% layout(title = "ADI Application Fee",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(ADI_sd_df, labels = ~ Imp_C, values = ~ Lcn_F, type = 'pie', textposition = 'inside', marker = list(colors = c('#bcbd22', '#2ca02c')), textinfo = 'percent', showlegend=F) %>% layout(title = "ADI Licenses Fee",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` Authority {data-icon="fa-cannabis"} ===================================== Column {data-width=200 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Authority Select intputs to filter the data. Entities ```{r ent town filter} filter_select("Business_Town", "Select Town", AE_sd, ~Business_Town) ``` ```{r ent county filter} filter_select("Business_County", "Select a County", AE_sd, ~Business_County) ``` ```{r ent prioirty status filter} filter_checkbox("Priority_Status", "Prioirty Status", AE_sd, ~Priority_Status, allLevels = TRUE) ``` ```{r ent status filter} filter_checkbox("License_Status", "License Status", AE_sd, ~License_Status, allLevels = TRUE) ``` ```{r ent license type filter} filter_select("License_Type","License Type", AE_sd, ~License_Type) ``` ```{r ent total authority fitler} filter_slider("Total_Authority_Agents", "Total Authority Agents", AE_sd, ~Total_Authority_Agents, step = 5) ``` ```{r ent dbe category filter} filter_select("DBE_Category","DBE Category", AE_sd, ~DBE_Category) ``` ```{r ent role filter} filter_select("Role", "Role", AE_sd, ~Role) ``` ```{r ent ownership filter} filter_slider("Ownership", "% Ownership", AE_sd, ~Ownership, step = 10) ``` ```{r ent control filter} filter_slider("Control", "% Controls", AE_sd, ~Control, step = 10) ``` ```{r ent business name filter} filter_select("Business_Name","Business Name", AE_sd, ~Business_Name) ``` Interests ```{r int town filter} filter_select("Business_Town", "Select Town", BI_sd, ~Business_Town) ``` ```{r int county filter} filter_select("Business_County", "Select a County", BI_sd, ~Business_County) ``` ```{r int prioirty status filter} filter_checkbox("Priority_Status", "Prioirty Status", BI_sd, ~Priority_Status, allLevels = TRUE) ``` ```{r int status filter} filter_checkbox("License_Status", "License Status", BI_sd, ~License_Status, allLevels = TRUE) ``` ```{r int license type filter} filter_select("License_Type","License Type", BI_sd, ~License_Type) ``` ```{r int total authority fitler} filter_slider("Total_Authority_Agents", "Total Authority Agents", BI_sd, ~Total_Authority_Agents, step = 5) ``` ```{r int dbe category filter} filter_select("DBE_Category","DBE Category", BI_sd, ~DBE_Category) ``` ```{r int role filter} filter_select("Role", "Role", BI_sd, ~Role) ``` ```{r int business name filter} filter_select("Business_Name","Business Name", BI_sd, ~Business_Name) ``` ### ADI Select intputs to filter the data. ```{r int ent adi filter} filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C) ``` ```{r int ent aus filter} filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S) ``` ```{r int ent delivery filter} filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A) ``` ```{r int ent social consumption filter} filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P) ``` Column {data-width=650 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Map ```{r ent int map} AEPSpal <- colorFactor(palette = 'Spectral', levels=AE_sd$data()$Role, ordered=FALSE) leaflet() %>% setView(-71.931180, 42.385453, zoom = 8) %>% addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>% addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>% addPolygons(data = ADI_sd, weight = .4, smoothFactor = 1, fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = 0.5, no = 0), color = "#878787", fillColor = "#17b502", label = ~Town_1, # name as a hover label group = "ADI") %>% addCircleMarkers(data = AE_sd, lng = ~Lon, lat = ~Lat, popup = ~AutAboxinfo, color = ~AEPSpal(Role), radius = ~AE_sd$data()$Total_Authority_Agents/3, group = "Entities") %>% addCircleMarkers(data = BI_sd, lng = ~Lon, lat = ~Lat, popup = ~BIboxinfo, color = ~AEPSpal(Role), radius = ~BI_sd$data()$Total_Authority_Agents/10, group = "Interests") %>% addPolylines(data = flows_sd, weight = flows_sd$data()$Ownership/10, label = hover, group = "Travel Interests", color="#00b3ff") %>% addPolylines(data = flows_sd, weight = flows_sd$data()$Total_Authority_Agents/10, label = hover, group = "Travel Entities", color="#00b3ff") %>% addCircleMarkers(Geolines$end.latitude, Geolines$end.longitude, color="orange", radius=Geolines$ownership/15, group= "Travel Points") %>% addCircleMarkers(Geolines$start.latitude, Geolines$start.longitude, color="orange", radius=Geolines$control/15, group = "Travel Points") %>% addLegend("bottomleft", pal = AEPSpal, values = AE_sd$data()$Role, title = "Authority Role", opacity = 1) %>% addLayersControl(overlayGroups = c("ADI","Entities", "Interests","Travel Points", "Travel Interests", "Travel Entities"), baseGroups = c("Dark","Grey"), options = layersControlOptions(collapsed = FALSE)) %>% addMeasure() ``` ### Data ```{r ent data table} DT::datatable(AE_sd, rownames = FALSE, class = 'cell-border stripe' , extensions = c('ColReorder','Responsive'), options = list(colReorder = TRUE)) ``` ```{r int data table} DT::datatable(BI_sd, rownames = FALSE, class = 'cell-border stripe' , extensions = c('ColReorder','Responsive'), options = list(colReorder = TRUE)) ``` ### Equity ```{r ent int equity } # Summary break down with static charts and detailed descritpiton explaining what the data is telling us ``` Column {data-width=350 .tabset .tabset-fade .colored} ----------------------------------------------------------------------- ### Authority ```{r ent int lic status pie} div( div(plot_ly(AE_sd, labels = ~ License_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ License_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r ent int lic priority status pie} div( div(plot_ly(AE_sd, labels = ~ Priority_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ Priority_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r ent int lic license type pie} div( div(plot_ly(AE_sd, labels = ~ License_Type, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ License_Type, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r ent int lic dbe category pie} div( div(plot_ly(AE_sd, labels = ~ DBE_Category, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ DBE_Category, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r} div( div(plot_ly(AE_sd, labels = ~ Business_Town, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ Business_Town, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ``` ```{r} div( div(plot_ly(AE_sd, labels = ~ Business_County, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Entitites", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))), div(plot_ly(BI_sd, labels = ~ Business_County, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=F) %>% layout(title = "Interests", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))) ) ```