Skip to content

Commit

Permalink
Merge pull request #48 from elmeraa-usgs/sep24_flowtiles
Browse files Browse the repository at this point in the history
September 2024 flowtiles
  • Loading branch information
elmeraa-usgs authored Oct 1, 2024
2 parents 3f115f1 + 470750f commit e574e52
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ list(
# Read in data from gage-flow-conditions pipeline output
tar_target(
dv,
read_csv("https://labs.waterdata.usgs.gov/visualizations/data/flow_conditions_202408.csv", col_types = "cTnnnn")
read_csv("https://labs.waterdata.usgs.gov/visualizations/data/flow_conditions_202409.csv", col_types = "cTnnnn")
),
tar_target(
date_start,
Expand Down Expand Up @@ -270,6 +270,7 @@ list(
tar_target(
intro_question_ig_png,
intro_image(plot_nat_clean = explainer_intro_background, date_start,
font_legend, width = 1080, height = 1080, file_png = "out/intro_question_ig.png")
font_legend, width = 1080, height = 1080, text_size = 19,
file_png = "out/intro_question_ig.png")
)
)
Binary file modified out/explainer_flow_national_ig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified out/flow_cartogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified out/flow_cartogram_ig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified out/flow_national_ig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified out/intro_question_ig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/explainer_prep.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ intro_background <- function(national_data, percentile_bin, pal){
#' @param width width of final png
#' @param height height of final png
#' @param file_png file path for final png
intro_image <- function(plot_nat_clean, date_start, font_legend, width, height, file_png){
#' @param text_size size of text
intro_image <- function(plot_nat_clean, date_start, font_legend, width, height, file_png, text_size){

plot_month <- lubridate::month(date_start, label = TRUE, abbr = FALSE)
plot_margin <- 0.025
Expand All @@ -185,10 +186,11 @@ intro_image <- function(plot_nat_clean, date_start, font_legend, width, height,
height = 1.18, width = 1.18) +
draw_label(sprintf("A look at %s's\nstreamflow across\nthe U.S.", plot_month),
x = 0.05, y = 0.5,
size = 22,
size = text_size,
hjust = 0, vjust = 0.5,
fontfamily = font_legend,
color = "#222222")
color = "#222222",
lineheight = 1.2)

ggsave(file_png, width = width, height = height, dpi = 300, units = c("px"))

Expand Down

0 comments on commit e574e52

Please sign in to comment.