-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from ceenell/time-chart
plug timeline into pipeline
- Loading branch information
Showing
16 changed files
with
662 additions
and
7,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
|
||
build_peaks_svg <- function(out_file, data_in, sites_sf, svg_width, svg_height) { | ||
build_peaks_svg <- function(out_file, svg_width, svg_height) { | ||
|
||
svg_root <- init_svg(viewbox_dims = c(0, 0, svg_width=svg_width, svg_height=svg_height)) | ||
|
||
add_background_map(svg_root, svg_width = svg_width, outline_states = FALSE) | ||
|
||
# Add spark line within group per site | ||
|
||
# TODO: THIS ONLY WORKS FOR A SINGLE DAY RIGHT NOW. I CHOSE OCT 31, 2019 | ||
# TODO: Blanket removing any path with an NA in it. There is a smarter way | ||
# to do this but will come back to that. | ||
data_in <- data_in %>% | ||
filter(Date == as.Date("2019-10-31")) %>% | ||
filter(!grepl("NA", path)) | ||
|
||
sites <- sites_sf %>% pull(site_no) %>% unique | ||
for(s in sites) { | ||
site_coords_svg <- sites_sf %>% | ||
filter(site_no == s) %>% | ||
convert_coords_to_svg(svg_width = svg_width, view_bbox = st_bbox(generate_usa_map_data())) | ||
|
||
gw_data_s <- data_in %>% filter(site_no == s) | ||
|
||
# Spark lines centered at GW location | ||
svg_root %>% | ||
add_grp(grp_nm = s, trans_x = site_coords_svg$x, | ||
trans_y = site_coords_svg$y) %>% | ||
xml_add_child("path", | ||
class = sprintf('gwl_%s', s), | ||
style = sprintf("stroke: none; fill: %s; fill-opacity: 50%%", gw_data_s$color), | ||
d = gw_data_s$path) | ||
|
||
} | ||
|
||
xml2::write_xml(svg_root, file = out_file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
color,peak_mid,quant,path_quant | ||
#7E1900,5,Verylow,M-10 0 C -10 0 0 45 10 0 Z | ||
#C1A53A,17.5,Low,M-10 0 C -10 0 0 32 10 0 Z | ||
#8fce83,50,Normal,M-10 0 C -10 0 0 15 10 0 Z | ||
#8fce83,50,Normal,M-10 0 C -10 0 0 -15 10 0 Z | ||
#479BC5,82.5,High,M-10 0 C -10 0 0 -32 10 0 Z | ||
#1A3399,95,Veryhigh,M-10 0 C -10 0 0 -45 10 0 Z | ||
peak_mid,quant,path_quant | ||
5,Verylow,M-10 0 C -10 0 0 45 10 0 Z | ||
17.5,Low,M-10 0 C -10 0 0 32 10 0 Z | ||
50,Normal,M-10 0 C -10 0 0 15 10 0 C 10 0 0 -15 -10 0 Z | ||
82.5,High,M-10 0 C -10 0 0 -32 10 0 Z | ||
95,Veryhigh,M-10 0 C -10 0 0 -45 10 0 Z |
Oops, something went wrong.