-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path3_visualize.yml
159 lines (130 loc) · 7.11 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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-daily-proportions-s3copy.ind
- 3_visualize/out/gw-conditions-site-coords-s3copy.ind
- 3_visualize/out/gw-conditions-time-labels-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 `ssologin.sh`
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'))
# MUST BE RUN MANUALLY, AS UPLOADING FILES UPDATES THE BETA SITE
# Upload to Prod (beta bucket) a copy of the timeseries, daily proportions, site coords, and time labels to use on the beta site
visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-peaks-timeseries.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))
visualizations/data/gw-conditions-daily-proportions-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-daily-proportions.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))
visualizations/data/gw-conditions-site-coords-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-site-coords.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))
visualizations/data/gw-conditions-time-labels-beta.csv.ind:
command: s3_put(target_name, '2_process/out/gw-conditions-time-labels.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))
# MUST BE RUN MANUALLY, AS UPLOADING FILES UPDATES THE LIVE SITE
# Upload to Prod (prod bucket) a copy of the timeseries, daily proportions, site coords, and time labels to use on the live site
visualizations/data/gw-conditions-peaks-timeseries-live.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-daily-proportions-live.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-daily-proportions.csv', config_file = I('lib/cfg/s3_config_viz.yml'))
visualizations/data/gw-conditions-site-coords-live.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-time-labels-live.csv.ind:
command: s3_put(target_name, '2_process/out/gw-conditions-time-labels.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 `ssologin.sh`
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'))
gw_conditions_daily_proportions_s3copy_fname:
command: sprintf(
I('gw-conditions/viz-previous-peak-data/gw-conditions-daily-proportions-%s_%s.csv'),
viz_start_date, viz_end_date)
3_visualize/out/gw-conditions-daily-proportions-s3copy.ind:
command: push_s3(
upload_ind = target_name,
local_file = '3_visualize/out/gw-conditions-daily-proportions.csv',
s3_file = gw_conditions_daily_proportions_s3copy_fname,
config_file = I('lib/cfg/s3_config.yml'))
gw_conditions_site_coords_s3copy_fname:
command: sprintf(
I('gw-conditions/viz-previous-peak-data/gw-conditions-site-coords-%s_%s.csv'),
viz_start_date, viz_end_date)
3_visualize/out/gw-conditions-site-coords-s3copy.ind:
command: push_s3(
upload_ind = target_name,
local_file = '3_visualize/out/gw-conditions-site-coords.csv',
s3_file = gw_conditions_site_coords_s3copy_fname,
config_file = I('lib/cfg/s3_config.yml'))
gw_conditions_time_labels_s3copy_fname:
command: sprintf(
I('gw-conditions/viz-previous-peak-data/gw-conditions-time-labels-%s_%s.csv'),
viz_start_date, viz_end_date)
3_visualize/out/gw-conditions-time-labels-s3copy.ind:
command: push_s3(
upload_ind = target_name,
local_file = '2_process/out/gw-conditions-time-labels.csv',
s3_file = gw_conditions_time_labels_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)