Skip to content

Commit

Permalink
pushing up draft visuals for webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
romartinez-nycc committed Apr 12, 2024
1 parent 6f360d9 commit 2796543
Show file tree
Hide file tree
Showing 10 changed files with 983 additions and 9 deletions.
18 changes: 9 additions & 9 deletions code/map_correlation.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
library(tidycensus)
library(tigris)
library(tidyverse)
library(sf)
library(ggiraph)
library(patchwork)

# run 01_prepare-data.R first - need school_dist_shp, map_sf
source("code/01_prepare-data.R")

# grap # sbhcs per dis
# graph # sbhcs per dis
ll12_21 <- read_excel("data/input/Local Law 12 School Year 2021-22.xlsx", sheet = "Reports_Data", skip = 1)
ll12_21_merge <- data.frame(school_dis = as.numeric(ll12_21$`Geographic Community School District`),
num_sbhcs = ll12_21$`Total SBHCs`)
Expand Down Expand Up @@ -52,13 +48,15 @@ p_plot <- ggplot(school_dist_shp,
x = "Percent Poverty",
y = "Total School Based Health Centers")

girafe(ggobj = p_plot + p_map, width_svg = 10, height_svg = 5.5) %>%
map_plot <- girafe(ggobj = p_plot + p_map, width_svg = 10, height_svg = 5.5) %>%
girafe_options(opts_zoom(min = 1, max = 8),
opts_selection(
css = "fill:cyan;",
only_shiny = FALSE)
)

htmltools::save_html(map_plot, "visuals/poverty-correlation-map_interactive.html")

# ---- Asthma x SBHCs ----

a_map <- ggplot(NULL) +
Expand Down Expand Up @@ -91,9 +89,11 @@ a_plot <- ggplot(school_dist_shp,
x = "Percent Asthma",
y = "Total School Based Health Centers")

girafe(ggobj = a_plot + a_map, width_svg = 10, height_svg = 5.5) %>%
map_plot <- girafe(ggobj = a_plot + a_map, width_svg = 10, height_svg = 5.5) %>%
girafe_options(opts_zoom(min = 1, max = 8),
opts_selection(
css = "fill:cyan;",
only_shiny = FALSE)
)

htmltools::save_html(map_plot, "visuals/asthma-correlation-map_interactive.html")
19 changes: 19 additions & 0 deletions visuals/asthma-correlation-map_interactive.html

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions visuals/lib/d3-bundle-5.16.0/d3-bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions visuals/lib/d3-lasso-0.0.5/d3-lasso.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions visuals/lib/ggiraphjs-0.4.2/ggiraphjs.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions visuals/lib/ggiraphjs-0.4.2/ggiraphjs.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions visuals/lib/girafe-binding-0.8.3/girafe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HTMLWidgets.widget({
name: 'girafe',
type: 'output',
factory: ggiraphjs.factory(HTMLWidgets.shinyMode)
});
Loading

0 comments on commit 2796543

Please sign in to comment.