-
+
+
From a8327466af416df6d3ceb3ef049826721207a520 Mon Sep 17 00:00:00 2001
From: Corson-Dosch
Date: Fri, 31 May 2024 10:35:52 -0500
Subject: [PATCH 09/13] set up laptop view
---
src/App.vue | 12 ++++--
src/components/GWL.vue | 91 ++++++++++++++++++++++++++++--------------
2 files changed, 69 insertions(+), 34 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 5c23cfe..e3da04a 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -99,7 +99,10 @@ h2{
font-weight: 700;
@media screen and (max-width: 800px) {
font-size: 2rem;
- }
+ }
+ @media screen and (max-height: 770px) {
+ font-size: 2em;
+ }
@media screen and (max-width: 650px) {
font-size: 1.3em;
}
@@ -109,10 +112,13 @@ h3{
//padding-top: 0.5em;
@media screen and (max-width: 800px) {
font-size: 1.3em;
- }
+ }
+ @media screen and (max-height: 770px) {
+ font-size: 1.25em;
+ }
@media screen and (max-width: 650px) {
font-size: 1em;
- }
+ }
}
h4{
font-size: 1.2em;
diff --git a/src/components/GWL.vue b/src/components/GWL.vue
index cde1649..86726d7 100644
--- a/src/components/GWL.vue
+++ b/src/components/GWL.vue
@@ -718,27 +718,49 @@ section {
"line line"
"text text";
}
-
+
+ @media screen and (max-height: 770px) {
+ grid-template-columns: 10vw 0.6fr 1.25fr;
+ grid-template-rows: max-content;
+ grid-template-areas:
+ "title title map"
+ "button legend map"
+ "line line map"
+ "text text text";
+ }
+ @media screen and (max-width: 600px) {
+ grid-template-columns: 1fr;
+ grid-template-areas:
+ "title"
+ "map"
+ "legend"
+ "button"
+ "line"
+ "text";
+ }
}
-#map-container {
+#map_gwl {
grid-area: map;
+}
+#map-label-container {
+ grid-area: map;
+}
+.map-container {
+ align-self: center;
+}
+.map {
+ max-height: 68vh;
+ max-width: 98vw;
+ width: 100%;
+ height: 100%;
padding: 0rem;
padding-bottom: 0px;
margin-top: 0.5rem;
display: flex;
- justify-content: center;
- align-items: center;
- svg.map {
- max-height: 68vh;
- max-width: 98vw;
- width: 100%;
- height: 100%;
- }
- svg.map.labels {
- position: absolute;
+ @media screen and (max-height: 770px) {
+ max-height: 100vh;
}
}
-
#line-container {
grid-area: line;
width: 100%;
@@ -753,15 +775,13 @@ section {
#legend-container {
grid-area: legend;
width: 100%;
- margin: auto;
- margin-bottom: 1rem;
+ margin: 1rem 0 1rem 0;
justify-content: center;
max-width: 550px;
- align-self: right;
+ align-self: center;
justify-self: start;
svg{
max-width: 550px;
- margin: auto;
align-self: start;
justify-self: start;
overflow: visible;
@@ -780,9 +800,8 @@ section {
grid-area: title;
width: 100%;
max-width: 700px;
- height: auto;
- margin: auto;
- align-items: start;
+ align-self: start;
+ justify-self: center;
h1, h2{
margin-top: 1rem;
}
@@ -799,14 +818,16 @@ section {
}
#button-container {
grid-area: button;
- width: 100%;
- max-width: 700px;
- height: auto;
- min-height: 40px;
- margin: auto;
- margin-bottom: 1rem;
+ margin: 1rem 0 1rem 0;
+ align-self: center;
justify-content: space-evenly;
position: relative;
+ @media screen and (max-height: 770px) {
+ margin: 0.5rem 0 0.5rem 0;
+ }
+ @media screen and (min-width: 551px) {
+ justify-self: center;
+ }
}
.text-content {
margin: 0.5rem auto;
@@ -845,6 +866,9 @@ section {
@media screen and (max-width: 550px) {
font-size: 16px;
}
+ @media screen and (max-height: 770px) {
+ font-size: 0.8rem;
+ }
}
button {
@@ -856,7 +880,10 @@ button {
align-items: center;
box-sizing: border-box;
padding: 1rem 4px;
- margin: 0rem 1rem;;
+ margin: 0rem 1rem;
+ @media screen and (max-height: 770px) {
+ margin: 0.25rem 1rem;
+ }
}
[type=button], [type=reset], [type=submit], button {
-webkit-appearance: button;
@@ -896,11 +923,13 @@ text.legend-label {
stroke-width: 2px;
}
#spacer {
- display: flex;
- justify-content: center;
@media screen and (min-width: 551px) {
- justify-content: end;
- }
+ justify-content: end;
+ }
+ @media screen and (max-width: 650px) {
+ display: flex;
+ justify-content: center;
+ }
}
#vizlab-wordmark {
max-width: 200px;
From c6e590d745e24d948e62a0c6f669208a89796ee0 Mon Sep 17 00:00:00 2001
From: Corson-Dosch
Date: Fri, 31 May 2024 11:06:11 -0500
Subject: [PATCH 10/13] Set up file access for beta site
---
3_visualize.yml | 16 +++++++++++-
lib/cfg/s3_config_viz_beta.yml | 3 +++
src/components/GWL.vue | 26 ++++++++++++++-----
...-conditions-daily-proportions-beta.csv.ind | 2 ++
...w-conditions-peaks-timeseries-beta.csv.ind | 2 ++
.../gw-conditions-site-coords-beta.csv.ind | 2 ++
.../gw-conditions-time-labels-beta.csv.ind | 2 ++
7 files changed, 46 insertions(+), 7 deletions(-)
create mode 100644 lib/cfg/s3_config_viz_beta.yml
create mode 100644 visualizations/data/gw-conditions-daily-proportions-beta.csv.ind
create mode 100644 visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind
create mode 100644 visualizations/data/gw-conditions-site-coords-beta.csv.ind
create mode 100644 visualizations/data/gw-conditions-time-labels-beta.csv.ind
diff --git a/3_visualize.yml b/3_visualize.yml
index 077d11c..24faa25 100644
--- a/3_visualize.yml
+++ b/3_visualize.yml
@@ -75,8 +75,22 @@ targets:
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 a copy of the timeseries, daily proportions, site coords, and time labels to use on 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'))
diff --git a/lib/cfg/s3_config_viz_beta.yml b/lib/cfg/s3_config_viz_beta.yml
new file mode 100644
index 0000000..2183239
--- /dev/null
+++ b/lib/cfg/s3_config_viz_beta.yml
@@ -0,0 +1,3 @@
+profile: 'default'
+
+bucket: 'water-visualizations-beta-website'
diff --git a/src/components/GWL.vue b/src/components/GWL.vue
index 86726d7..db98600 100644
--- a/src/components/GWL.vue
+++ b/src/components/GWL.vue
@@ -157,6 +157,7 @@ export default {
return {
publicPath: process.env.BASE_URL, // this is need for the data files in the public folder, this allows the application to find the files when on different deployment roots
vueTier: process.env.VUE_APP_TIER, // this is used to determine the file path suffix for data files
+ dataUrlPrefix: null,
dataFileSuffix: null,
d3: null,
mobileView: isMobile, // test for mobile
@@ -199,8 +200,21 @@ export default {
}
},
mounted(){
- this.dataFileSuffix = this.vueTier == '' ? '-live' : '' // In the prod site we want to use the '-live' files. These are uploaded manually, to hold off updating the live site until we are ready
- console.log(`vue tier: ${this.vueTier}, suffix: ${this.dataFileSuffix}`)
+ // In the prod site we want to use the '-live' files.
+ // In the beta site we want to use the '-beta' files.
+ // These are uploaded manually, to hold off updating the beta or live site until we are ready
+ switch(this.vueTier) {
+ case '-test build-':
+ this.dataFileSuffix = '';
+ break;
+ case '-beta build-':
+ this.dataFileSuffix = '-beta';
+ break;
+ default:
+ this.dataFileSuffix = '-live';
+ }
+ // The beta site needs to access the data files in the beta bucket on prod
+ this.dataUrlPrefix = this.vueTier == '-beta build-' ? '-beta' : ''
this.d3 = Object.assign({d3Trans, scaleLinear, scaleThreshold, scaleOrdinal, select, selectAll, csv, utcFormat, line, path, axisBottom, axisLeft, format });
// resize
@@ -229,10 +243,10 @@ export default {
// read in data
let promises = [
self.d3.csv(self.publicPath + "quant_peaks.csv", this.d3.autotype), // used to draw legend shapes - color palette needs to be pulled out
- self.d3.csv(`https://labs.waterdata.usgs.gov/visualizations/data/gw-conditions-peaks-timeseries${self.dataFileSuffix}.csv`, this.d3.autotype),
- self.d3.csv(`https://labs.waterdata.usgs.gov/visualizations/data/gw-conditions-site-coords${self.dataFileSuffix}.csv`, this.d3.autotype),
- self.d3.csv(`https://labs.waterdata.usgs.gov/visualizations/data/gw-conditions-daily-proportions${self.dataFileSuffix}.csv`, this.d3.autotype),
- self.d3.csv(`https://labs.waterdata.usgs.gov/visualizations/data/gw-conditions-time-labels${self.dataFileSuffix}.csv`, this.d3.autotype),
+ self.d3.csv(`https://labs${self.dataUrlPrefix}.waterdata.usgs.gov/visualizations/data/gw-conditions-peaks-timeseries${self.dataFileSuffix}.csv`, this.d3.autotype),
+ self.d3.csv(`https://labs${self.dataUrlPrefix}.waterdata.usgs.gov/visualizations/data/gw-conditions-site-coords${self.dataFileSuffix}.csv`, this.d3.autotype),
+ self.d3.csv(`https://labs${self.dataUrlPrefix}.waterdata.usgs.gov/visualizations/data/gw-conditions-daily-proportions${self.dataFileSuffix}.csv`, this.d3.autotype),
+ self.d3.csv(`https://labs${self.dataUrlPrefix}.waterdata.usgs.gov/visualizations/data/gw-conditions-time-labels${self.dataFileSuffix}.csv`, this.d3.autotype),
];
Promise.all(promises).then(self.callback); // once it's loaded
},
diff --git a/visualizations/data/gw-conditions-daily-proportions-beta.csv.ind b/visualizations/data/gw-conditions-daily-proportions-beta.csv.ind
new file mode 100644
index 0000000..ffd34c4
--- /dev/null
+++ b/visualizations/data/gw-conditions-daily-proportions-beta.csv.ind
@@ -0,0 +1,2 @@
+hash: 5d9d05238386e4f818f4d6f1ca051bc7
+
diff --git a/visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind b/visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind
new file mode 100644
index 0000000..721ae77
--- /dev/null
+++ b/visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind
@@ -0,0 +1,2 @@
+hash: 15f470784c897971afd9c7a7f63366b2
+
diff --git a/visualizations/data/gw-conditions-site-coords-beta.csv.ind b/visualizations/data/gw-conditions-site-coords-beta.csv.ind
new file mode 100644
index 0000000..e92e73d
--- /dev/null
+++ b/visualizations/data/gw-conditions-site-coords-beta.csv.ind
@@ -0,0 +1,2 @@
+hash: e2694c1d4d74f9e2ffd76c2f2c11f955
+
diff --git a/visualizations/data/gw-conditions-time-labels-beta.csv.ind b/visualizations/data/gw-conditions-time-labels-beta.csv.ind
new file mode 100644
index 0000000..07e57f5
--- /dev/null
+++ b/visualizations/data/gw-conditions-time-labels-beta.csv.ind
@@ -0,0 +1,2 @@
+hash: d28ab3ba24b2f8f26b0eb7d27eb657ea
+
From c864d519b1c5b335b7cc0a3ac53b726e30c2d406 Mon Sep 17 00:00:00 2001
From: Corson-Dosch
Date: Fri, 31 May 2024 11:09:09 -0500
Subject: [PATCH 11/13] give linechart more space in laptop view
---
src/components/GWL.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/GWL.vue b/src/components/GWL.vue
index db98600..9aaa17f 100644
--- a/src/components/GWL.vue
+++ b/src/components/GWL.vue
@@ -734,7 +734,7 @@ section {
}
@media screen and (max-height: 770px) {
- grid-template-columns: 10vw 0.6fr 1.25fr;
+ grid-template-columns: 10vw 0.75fr 1.25fr;
grid-template-rows: max-content;
grid-template-areas:
"title title map"
From a7b8bea49bc15a9613039a42d9022ced71bcd73c Mon Sep 17 00:00:00 2001
From: Corson-Dosch
Date: Fri, 31 May 2024 11:17:53 -0500
Subject: [PATCH 12/13] Match button and legend grid alignment to current site
---
src/components/GWL.vue | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/components/GWL.vue b/src/components/GWL.vue
index 9aaa17f..3d50b65 100644
--- a/src/components/GWL.vue
+++ b/src/components/GWL.vue
@@ -793,7 +793,7 @@ section {
justify-content: center;
max-width: 550px;
align-self: center;
- justify-self: start;
+ justify-self: center;
svg{
max-width: 550px;
align-self: start;
@@ -836,11 +836,12 @@ section {
align-self: center;
justify-content: space-evenly;
position: relative;
+ @media screen and (min-width: 551px) {
+ justify-self: end;
+ }
@media screen and (max-height: 770px) {
margin: 0.5rem 0 0.5rem 0;
- }
- @media screen and (min-width: 551px) {
- justify-self: center;
+ justify-self: start;
}
}
.text-content {
From 54eac695c4ed44d44a0f7933733869ac2e90059f Mon Sep 17 00:00:00 2001
From: Corson-Dosch
Date: Fri, 31 May 2024 11:54:13 -0500
Subject: [PATCH 13/13] simplify laptop layout
---
src/components/GWL.vue | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/components/GWL.vue b/src/components/GWL.vue
index 3d50b65..927d24a 100644
--- a/src/components/GWL.vue
+++ b/src/components/GWL.vue
@@ -359,7 +359,7 @@ export default {
},
formatDates(dates){
- this.formatTime = this.d3.utcFormat("%b %e, %Y");
+ this.formatTime = this.d3.utcFormat("%B %e, %Y");
this.date_start = this.formatTime(new Date(dates[0]));
this.date_end = this.formatTime(new Date(dates[this.n_days-1]));
@@ -734,13 +734,21 @@ section {
}
@media screen and (max-height: 770px) {
- grid-template-columns: 10vw 0.75fr 1.25fr;
+ grid-template-columns: 15% 35% 50%;
grid-template-rows: max-content;
grid-template-areas:
- "title title map"
- "button legend map"
- "line line map"
+ "title map map"
+ "null map map"
+ "button button legend"
+ "line line line"
"text text text";
+ // grid-template-columns: 10vw 0.75fr 1.25fr;
+ // grid-template-rows: max-content;
+ // grid-template-areas:
+ // "title title map"
+ // "button legend map"
+ // "line line map"
+ // "text text text";
}
@media screen and (max-width: 600px) {
grid-template-columns: 1fr;
@@ -840,8 +848,7 @@ section {
justify-self: end;
}
@media screen and (max-height: 770px) {
- margin: 0.5rem 0 0.5rem 0;
- justify-self: start;
+ justify-self: center;
}
}
.text-content {
@@ -881,10 +888,6 @@ section {
@media screen and (max-width: 550px) {
font-size: 16px;
}
- @media screen and (max-height: 770px) {
- font-size: 0.8rem;
- }
-
}
button {
appearance: auto;
@@ -896,9 +899,6 @@ button {
box-sizing: border-box;
padding: 1rem 4px;
margin: 0rem 1rem;
- @media screen and (max-height: 770px) {
- margin: 0.25rem 1rem;
- }
}
[type=button], [type=reset], [type=submit], button {
-webkit-appearance: button;