Skip to content

Commit e574e52

Browse files
authored
Merge pull request #48 from elmeraa-usgs/sep24_flowtiles
September 2024 flowtiles
2 parents 3f115f1 + 470750f commit e574e52

File tree

7 files changed

+8
-5
lines changed

7 files changed

+8
-5
lines changed

_targets.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ list(
3333
# Read in data from gage-flow-conditions pipeline output
3434
tar_target(
3535
dv,
36-
read_csv("https://labs.waterdata.usgs.gov/visualizations/data/flow_conditions_202408.csv", col_types = "cTnnnn")
36+
read_csv("https://labs.waterdata.usgs.gov/visualizations/data/flow_conditions_202409.csv", col_types = "cTnnnn")
3737
),
3838
tar_target(
3939
date_start,
@@ -270,6 +270,7 @@ list(
270270
tar_target(
271271
intro_question_ig_png,
272272
intro_image(plot_nat_clean = explainer_intro_background, date_start,
273-
font_legend, width = 1080, height = 1080, file_png = "out/intro_question_ig.png")
273+
font_legend, width = 1080, height = 1080, text_size = 19,
274+
file_png = "out/intro_question_ig.png")
274275
)
275276
)

out/explainer_flow_national_ig.png

2.47 KB
Loading

out/flow_cartogram.png

-20.3 KB
Loading

out/flow_cartogram_ig.png

-22.5 KB
Loading

out/flow_national_ig.png

1.98 KB
Loading

out/intro_question_ig.png

682 Bytes
Loading

src/explainer_prep.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ intro_background <- function(national_data, percentile_bin, pal){
160160
#' @param width width of final png
161161
#' @param height height of final png
162162
#' @param file_png file path for final png
163-
intro_image <- function(plot_nat_clean, date_start, font_legend, width, height, file_png){
163+
#' @param text_size size of text
164+
intro_image <- function(plot_nat_clean, date_start, font_legend, width, height, file_png, text_size){
164165

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

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

0 commit comments

Comments
 (0)