forked from DOI-USGS/gw-conditions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3_visualize.yml
94 lines (77 loc) · 3.56 KB
/
3_visualize.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
target_default: 3_visualize
packages:
- dplyr
- sf
- xml2
- jsonlite
- data.table
- stringr
sources:
- 3_visualize/src/build_peaks_svg.R
- 3_visualize/src/svg_utils_general.R
- 3_visualize/src/svg_utils_mapping.R
- 3_visualize/src/svg_utils_paths.R
- 3_visualize/src/svg_utils_vue.R
- 3_visualize/src/sf_utils_shift.R
- 3_visualize/src/push_s3.R
targets:
3_visualize:
depends:
- visualizations/data/gw-conditions-peaks-map.svg.ind
- visualizations/data/gw-conditions-site-coords.csv.ind
- visualizations/data/gw-conditions-peaks-timeseries.csv.ind
- visualizations/data/gw-conditions-daily-proportions.csv.ind
- src/assets/gw-conditions-peaks-map.svg # Currently a temporary fix!
- 3_visualize/out/gw-conditions-peaks-timeseries-s3copy.ind
3_visualize/out/gw-conditions-peaks-map.svg:
command: build_peaks_svg(
target_name,
svg_width = svg_width,
svg_height = svg_height,
digits = 3,
aria_title,
aria_desc)
depends:
- '2_process/out/nws_states.shp'
3_visualize/out/gw-conditions-peaks-timeseries.csv:
command: gwl_to_peak(
target_name,
gw_anomaly_data_w_colors)
3_visualize/out/gw-conditions-site-coords.csv:
command: get_site_coords(
target_name,
sites_sf = gw_sites_sf_shifted)
3_visualize/out/gw-conditions-daily-proportions.csv:
command: site_prop_timeseries(target_name,
gw_anomaly_data_w_colors)
##-- Now push the data needed by Vue to S3 --##
# These data end up on the Prod VPC with `us-west-2`
# You must login separately using `saml2aws login`
visualizations/data/gw-conditions-peaks-map.svg.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-peaks-map.svg', config_file = I('lib/cfg/s3_config_viz.yml'))
visualizations/data/gw-conditions-peaks-timeseries.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-peaks-timeseries.csv', config_file = I('lib/cfg/s3_config_viz.yml'))
visualizations/data/gw-conditions-site-coords.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-site-coords.csv', config_file = I('lib/cfg/s3_config_viz.yml'))
visualizations/data/gw-conditions-daily-proportions.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-daily-proportions.csv', config_file = I('lib/cfg/s3_config_viz.yml'))
# We want to keep a copy of each time window we use, but don't want to have to keep changing the
# filename that is used by the Vue code manually. So, we are uploading a copy of the data for
# the current viz time window and naming based on the dates.
# This data ends up on the Dev VPC with `us-west-2`; you must login separately using `saml2aws login`
gw_conditions_peaks_timeseries_s3copy_fname:
command: sprintf(
I('gw-conditions/viz-previous-peak-data/gw-conditions-peaks-timeseries-%s_%s.csv'),
viz_start_date, viz_end_date)
3_visualize/out/gw-conditions-peaks-timeseries-s3copy.ind:
command: push_s3(
upload_ind = target_name,
local_file = '3_visualize/out/gw-conditions-peaks-timeseries.csv',
s3_file = gw_conditions_peaks_timeseries_s3copy_fname,
config_file = I('lib/cfg/s3_config.yml'))
# TEMPORARY FIX #
# Currently, we can't inject SVG directly from a URL. So,
# moving the SVG file to `assets` for now. Delete when we can
# do this from S3 (and also delete the file from assets/)
src/assets/gw-conditions-peaks-map.svg:
command: file.copy(to = target_name, from = '3_visualize/out/gw-conditions-peaks-map.svg', overwrite = TRUE)