-
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MK065DF5XP"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', 'G-MK065DF5XP'); | ||
</script> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
|
@@ -11,18 +20,18 @@ | |
<%= VUE_APP_TITLE %> | ||
</title> | ||
<meta name="title" content="U.S. Groundwater Conditions"> | ||
<meta name="description" content=""> | ||
<meta name="description" content="The low down on flow down low"> | ||
<!-- Open Graph / Facebook --> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:url" content="https://labs.waterdata.usgs.gov/visualizations/gw-conditions/index.html#/"> | ||
<meta property="og:title" content="U.S. Groundwater Conditions"> | ||
<meta property="og:description" content=""> | ||
<meta property="og:description" content="The low down on flow down low"> | ||
<meta property="og:image" content="https://labs.waterdata.usgs.gov/visualizations/gw-conditions/SnowToFlowMetacard.jpg"> | ||
<!-- Twitter --> | ||
<meta property="twitter:card" content="summary_large_image"> | ||
<meta property="twitter:url" content="https://labs.waterdata.usgs.gov/visualizations/gw-conditions/index.html#/"> | ||
<meta property="twitter:title" content="U.S. Groundwater Conditions"> | ||
<meta property="twitter:description" content=""> | ||
<meta property="twitter:description" content="The low down on flow down low"> | ||
<meta property="twitter:image" content="https://labs.waterdata.usgs.gov/visualizations/gw-conditions/social-tag-cards-1-1.jpg"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<script type='application/ld+json'> | ||
|
@@ -33,7 +42,7 @@ | |
"datePublished": "FILL THIS OUT", | ||
"contributor": [ | ||
{ "@type": "Person", | ||
"name": "Colleen Nell", | ||
"name": "Cee Nell", | ||
"email": "[email protected]", | ||
"affiliation": { "@type": "Organization", "legalName": "U.S. Geological Survey" } | ||
}, | ||
|
@@ -46,7 +55,7 @@ | |
}, | ||
"audience": { "@context": "http://schema.org", "@type": "Audience", "audienceType": "General public"}, | ||
"publisher": { "@context": "http://schema.org", "@type": "Organization", "legalName": "U.S. Geological Survey" }, | ||
"keywords": "water, data viz, data visualization, groundwater" } | ||
"keywords": "water, data viz, data visualization, groundwater, animation, map" } | ||
</script> | ||
</head> | ||
<body> | ||
|
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.