-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathui.R
More file actions
1165 lines (1140 loc) · 67.8 KB
/
Copy pathui.R
File metadata and controls
1165 lines (1140 loc) · 67.8 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ui <- function(req) {
tagList( # Added functionality for not losing your settings
# shinythemes::themeSelector(), # user-defined theme
# Java to prompt the students to click a button
# Java script https://community.rstudio.com/t/keeping-track-of-idle-time-during-app-usage/1735
tags$script("
(function() {
var timeoutWarningMsecs = 12 * 60 * 1000;
var idleTimer;
function onTimeout() {
alert('Warning: Session is about to time out! Please click a button to prevent losing progress.');
}
function startIdleTimer() {
if (idleTimer) clearTimeout(idleTimer);
idleTimer = setTimeout(onTimeout, timeoutWarningMsecs);
}
$(document).on('shiny:message shiny:inputchanged', startIdleTimer);
})();"),
tags$style(type = "text/css", "text-align: justify"),
tags$head(tags$link(rel = "shortcut icon", href = "macroeddi_ico_green.ico")), # Add icon for web bookmarks
tags$head(includeHTML(("google-analytics.html"))),
tags$header(
introBox(
img(src = "eddie_banner_2020_test.png", height = 100,
width = 1544, top = 5),
data.step = 1,
data.intro = help_text["welcome", 1]
)
),
fluidPage(
column(11,
br(),
p(tags$b("Teaching materials associated with this module can be found at ",
tags$a(href="https://serc.carleton.edu/eddie/teaching_materials/modules/module10.html",
"https://serc.carleton.edu/eddie/teaching_materials/modules/module10.html.",target = "_blank"))),
h2(tags$b("Module 10: Exploring Tradeoffs in Water Quality Management Using Environmental Data"))
),
column(1, align = "right",
br(),
introBox(
actionButton("help", label = "Help", icon = icon("question-circle"))
)
)
),
navbarPage(position = "static-top", id = "maintab",
tags$header(
fluidRow(
)
),
# 1. Introduction ----
tabPanel(introBox(tab_names["mtab1", 2],
data.step = 2,
data.intro = help_text["tab_nav1", 1]
),
value = "mtab1",
introjsUI(), # must include in UI
withMathJax(), # NEEDS to be here for rendering eqn's in data.table
tags$style(".btn-file {
background-color:#98CAB2;
border-color: #2E4F84;
}
.progress-bar {
background-color: #2E4F84;
}"),
# Change progress bar color
tags$style(paste0("
.irs-grid-text { font-size: 10pt; }
.irs-bar,
.irs-bar-edge,
.irs-single,
.irs-grid-pol {
background: ", slider_col, ";
border-color: ", slider_col, ";
}")),
includeCSS("www/slider_cols.css"),
tags$style(HTML("
.irs-bar {
border-color: transparent;
background-color: transparent;
}
#first {
border: 4px double red;
}
#13a_graz {
margin-bottom: 10px;
}
#bla_border {
border: 2px solid black;
}
#bla_border2 {
border: 1px solid black;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
#txt_j {
text-align: justify;
}
#txt_c {
text-align: center;
}
#txt_l {
text-align: left;
}
#ackn {
color: gray;
font-size: 12px
}
#pheno img {
transition:transform 0.25s ease;
max-width: 100%; width: 100%; height: auto
}
#nextBtn1:hover {
background-color: yellow;
}
#dl_btn {
width:290px
}
#pheno:hover img{
-webkit-transform:scale(1.5);
transform:scale(1.5);
}
#wh_link a {
color: #FFFFFF
}
#q6_tab {
'border':'1px solid #ddd'
}
.box.box-solid.box-primary>.box-header {
}
.box.box-solid.box-primary{
background:#C1E4E2
}
.box.box-solid.box-success{
background: #F5F094;
}
.box.box-solid.box-info{
background: #DDE4E1;
}
.box.box-solid.box-warning>.box-header {
}
.box.box-solid.box-warning{
background:#D6AB9C
}
")),
introBox(
fluidRow(
column(6,
#* Module text ====
introBox(data.step = 10,
data.intro = help_text["thank_you", 1],
h2("Exploring Tradeoffs in Water Quality Management Using Environmental Data")
),
h3("Focal question"),
h4(tags$b(tags$i("How can we use environmental data to inform our understanding of the tradeoffs involved in water management decision-making?"))),
h3("Summary"),
p("Many water management decisions come with tradeoffs. One important example of such a decision is the use of chlorine in the drinking water treatment process. Chlorination is an important disinfection step in water treatment and is needed to protect water consumers from harmful pathogens (such as bacteria). However, when there are high amounts of organic matter in the raw water, chlorination can result in the formation of potentially cancer-causing disinfection byproducts. Environmental sensor data on water quality conditions, such as measurements of organic matter in drinking water reservoirs, can help inform water management decision-making and reduce the risk of unintended consequences due to use of chlorine in water treatment."),
p("In this module, you will explore organic matter data collected from drinking water reservoirs and learn how to interpret these data to inform your decision-making about chlorination during drinking water treatment."),
h3("Learning Outcomes"),
tags$line(),
tags$ul(
tags$li(id = "txt_j", module_text["LO1", ]),
tags$li(id = "txt_j", module_text["LO2", ]),
tags$li(id = "txt_j", module_text["LO3", ]),
tags$li(id = "txt_j", module_text["LO4", ])
)
),
column(6,
br(), br(), br(),
img(src = "mod10_conceptual_figure.png", height = "100%",
width = "100%")
)
)
),
hr(),
fluidRow(
column(11,
introBox(data.step = 4, data.intro = help_text["workflow", 1],
h3("Workflow for this module")
),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow1", ]))))),
br(),br(),br(),
fluidRow(
column(12, align = "center",
introBox(data.step = 5, data.intro = help_text["videos", 1],
wellPanel(
HTML('<iframe width="1100" height="825" src="https://www.youtube.com/embed/E2eqHv0ZI54?si=LxQXvqmp57XNfnY-" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
)
)
)
),
br(),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow2", ]))))),
br(),br(),br(),br(),br(),
fluidRow(
column(12, align = "center",
wellPanel(
HTML('<iframe width="1100" height="825" src="https://www.youtube.com/embed/Qj_LyQHQ9vw?si=r_-rLka1PYfj2eOt" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
)
)
),
br(),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow3", ]))))),
br(),br(),br(),
fluidRow(
#** Choose site ----
column(4,
h4("Site Names"),
p("Select a site in the table to highlight on the map"),
conditionalPanel("input.row_num > 25",
selectizeInput("row_num", "Select row",
choices = 1:nrow(sites_df),
options = list(
placeholder = 'Please select a row',
onInitialize = I('function() { this.setValue(""); }'))
)
),
DTOutput("table01", fill = TRUE)
),
#** Site map ----
column(4,
h4("Map of Virginia Reservoir LTREB sites"),
wellPanel(
leafletOutput("ltrebmap")
)
),
#** Site photo ----
column(4,
h4("Site photo"),
wellPanel(
imageOutput("site_photo"),
htmlOutput("site_photo_credit"),
p(id = "txt_j", module_text["site_photo", ])
)
)
),
br(),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow4", ]))))),
br(),br(),br(),br(),
tags$style(type="text/css", "#stud_dl {background-color:#98CAB2;color: white}"),
wellPanel(
fluidRow(
column(6, align = "center", offset = 3,
downloadButton(outputId = "stud_dl", label = "Download Student Handout")
)
)
),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow5", ]))))),
br(),br(),br(),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow6", ]))))),
br(),br(),br(),
box(id = "box1", width = 12, status = "success", solidHeader = TRUE,
fluidRow(
column(11, offset = 1, h4(tags$b(module_text["workflow7", ]))))),
br(),br(),br()
)
),
hr(),
fluidRow(
column(4,
h3("Introductory presentation"),
p(tags$i("Click through the slides to review some of the main points from the introductory presentation to help you answer the questions below.")),
p(tags$b("What are disinfection byproducts?")),
tags$ul(
tags$li(module_text["dbp_definition", ])
),
p(tags$b(" How do disinfection byproducts form?")),
tags$ul(
tags$li(module_text["dbp_formation", ])
),
p(tags$b("How can environmental data help us avoid the formation of disinfection byproducts?")),
tags$ul(
tags$li(module_text["environmental_data", ])
),
),
column(8, offset = 0, align = "center",
h3("Key Slides",
align = "center"),
h5("Click the arrows to navigate through the slides", align = "center"),
wellPanel(
introBox(data.step = 6, data.intro = help_text["slides", 1],
slickROutput("slides", width = "700px", height = "525px")
)
)
)
),
hr(),
fluidRow(
column(10, align = "left",
box(id = "box1", width = 10, status = "primary",
solidHeader = TRUE,
fluidRow(
column(8, offset = 1,
h3("Let's begin..."),
p(id = "txt_j", "Open your Canvas quiz or Word document. Then, answer the following questions in the Canvas quiz or Word document."),
introBox(
h3(tags$b("Think about it!")),
p(tags$b(quest["q1", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q1a", ]),
tags$li(id = "txt_j", quest["q1b", ]),
tags$li(id = "txt_j", quest["q1c", ]),
),
p(tags$b(quest["q2", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q2a", ]),
tags$li(id = "txt_j", quest["q2b", ]),
tags$li(id = "txt_j", quest["q2c", ])
),
p(tags$b(quest["q3", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q3a", ]),
tags$li(id = "txt_j", quest["q3b", ]),
tags$li(id = "txt_j", quest["q3c", ]),
tags$li(id = "txt_j", quest["q3d", ])
),
data.step = 8, data.intro = help_text["questions", 1]
)
)
)
)
)
),
hr(),
fluidRow(
column(6,
h3("Data sources"),
p(HTML(paste0('This module will introduce how to use high-frequency water quality data to inform drinking water management using data from ', a(href = "https://www.ltreb-reservoirs.org/", "Virginia Reservoirs LTREB sites",target = "_blank"), ", which are drinking water supply reservoirs located in southwest Virginia and owned and operated by the Western Virginia Water Authority.")))
),
column(6, align = "center",
a(
href = "https://www.ltreb-reservoirs.org/",
img(src = "ltreb.png", title = "Virginia Reservoirs LTREB logo", height = "80%",
width = "80%"), target = "_blank"
),
a(
href = "https://www.westernvawater.org/",
img(src = "wvwa.png", title = "Western Virginia Water Authority logo", height = "80%",
width = "80%"), target = "_blank"
)
)
)
),
# 2. Activity A ----
tabPanel(title = tab_names["mtab2", 2], value = "mtab2",
img(src = "eddie_banner_2020_test.png", height = 100,
width = 1544, top = 5),
fluidRow(
column(12,
wellPanel(style = paste0("background: ", obj_bg),
h2("Activity A - Explore how disinfection byproducts can be formed during chlorination"),
p(module_text["act_A", ])
)
),
column(12,
box(id = "box1", width = 10, status = "success",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
introBox(
h3("Objective 1: Understand factors affecting DBP formation and drinking water thresholds for DBPs"))
)
)
)
)
),
fluidRow(
column(12, align = "center",
h3("Disinfection byproduct formation and regulatory thresholds",
align = "center"),
p(tags$i("Watch the video and click through the slides below to understand what disinfection byproducts are and their regulatory thresholds. Then, answer the questions below.")),
wellPanel(
HTML('<iframe width="1100" height="825" src="https://www.youtube.com/embed/60Su5k3OWhk?si=Q2isXW1_IFMXBkXQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
)
)
),
fluidRow(
column(4,
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1, align = "left",
h4("Questions"),
p(tags$b(quest["q4", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q4a", ]),
tags$li(id = "txt_j", quest["q4b", ]),
tags$li(id = "txt_j", quest["q4c", ]),
tags$li(id = "txt_j", quest["q4d", ]),
tags$li(id = "txt_j", quest["q4e", ])
),
p(tags$b(quest["q5", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q5a", ]),
tags$li(id = "txt_j", quest["q5b", ]),
tags$li(id = "txt_j", quest["q5c", ])
),
p(tags$b(quest["q6", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q6a", ]),
tags$li(id = "txt_j", quest["q6b", ]),
tags$li(id = "txt_j", quest["q6c", ])
)
)
)
)
),
column(8, offset = 0, align = "center",
h4("You can click the arrows to navigate through the video presentation slides", align = "center"),
wellPanel(
slickROutput("dbp_formation_thresholds_slides", width = "700px", height = "525px")
)
)
),
hr(),
fluidRow(
column(12,
box(id = "box1", width = 10, status = "success",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
introBox(
h3("Objective 2: Explore tradeoffs in chlorination vs. DBP formation"))
)
)
)
)
),
fluidRow(
column(12, align = "center",
h3("Tradeoffs between chlorination vs. formation of DBPs",
align = "center"),
p(tags$i("Watch the video and click through the slides to understand tradeoffs operators may encounter between removing harmful microbes from drinking water and risking formation of DBPs.")),
wellPanel(
HTML('<iframe width="1100" height="825" src="https://www.youtube.com/embed/JBnVkGkrkNs?si=m7Z2VoW2VKPVgcvi" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'),
)
)
),
fluidRow(
column(4,
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1, align = "left",
h4("Questions"),
p(tags$b(quest["q7", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q7a", ]),
tags$li(id = "txt_j", quest["q7b", ]),
tags$li(id = "txt_j", quest["q7c", ]),
tags$li(id = "txt_j", quest["q7d", ])
),
p(tags$b(quest["q8", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q8a", ]),
tags$li(id = "txt_j", quest["q8b", ]),
tags$li(id = "txt_j", quest["q8c", ])
),
p(tags$b(quest["q9", 1])),
p(tags$b(quest["q10", 1]))
)
)
)
),
column(8, offset = 0, align = "center",
h4("You can click the arrows to navigate through the video presentation slides", align = "center"),
wellPanel(
slickROutput("dbp_tradeoffs_slides", width = "700px", height = "525px")
)
)
),
fluidRow(
column(12,
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(4, offset = 1,
h4("Questions"),
p(tags$b(quest["q11", 1])),
p(tags$b(quest["q12", 1])),
p(tags$b(quest["q13", 1])),
p(tags$i("Hint: Follow the steps in the slide to the right and the video to solve the problem. Round your calculations to the nearest hundredth.")),
tags$ul(
tags$li(id = "txt_j", quest["q13a", ]),
tags$li(id = "txt_j", quest["q13b", ]),
tags$li(id = "txt_j", quest["q13c", ])
),
p(tags$b(quest["q14", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q14a", ]),
tags$li(id = "txt_j", quest["q14b", ]),
tags$li(id = "txt_j", quest["q14c", ]),
tags$li(id = "txt_j", quest["q14d", ])
)
),
column(7,
br(),br(),
img(src = "calculate_breakpoint_chlorination.png", height = "80%",
width = "80%"),
br(),br()
)
)
)
)
),
hr(),
fluidRow(
column(12,
h2("Next step"),
h4("You will select a focal reservoir, visualize raw water quality data from that reservoir, and learn how these data can be related to DBP formation risk."),
)
)
),
# 6. Activity B ----
tabPanel(title = tab_names["mtab3", 2], value = "mtab3",
img(src = "eddie_banner_2020_test.png", height = 100,
width = 1544, top = 5),
fluidRow(
column(12,
wellPanel(style = paste0("background: ", obj_bg),
h2("Activity B - Explore environmental data that can indicate the presence of DBP precursors"),
p(module_text["act_B", ])
)
),
column(12,
box(id = "box1", width = 10, status = "success",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
introBox(
h3("Objective 3: Select and learn about a focal drinking water reservoir"))
)
)
)
)
),
hr(),
fluidRow(
#** LTREB Intro ----
column(6,
box(id = "box12", width = 12, status = "warning",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h3("You have chosen to work with"),
wellPanel(
htmlOutput("site_name")
),
p("You will learn about the characteristics and uses of this reservoir and explore high-frequency water quality data collected there.")
)
)
),
fluidRow(
column(12,
p("")
)
),
fluidRow(
column(12,
wellPanel(
h4(tags$b("About Site")),
textOutput("site_info")
)
)
)
),
column(6,
h4("Site photo"),
wellPanel(
imageOutput("site_photo1"),
htmlOutput("site_photo_credit1"),
p(id = "txt_j", module_text["site_photo", ])
)
)
),
hr(),
fluidRow(
column(12, align = "left",
box(id = "box3", width = 10, status = "primary",
solidHeader = TRUE,
fluidRow(
column(5, offset = 1,
h3("Questions"),
p(tags$b(quest["q15", 1])),
p(tags$b(quest["q16", 1])),
p(tags$b(quest["q17", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q17a", ]),
tags$li(id = "txt_j", quest["q17b", ]),
tags$li(id = "txt_j", quest["q17c", ]),
tags$li(id = "txt_j", quest["q17d", ])
)
),
column(5,
h3(""),
p(tags$b(quest["q18", 1])),
p(tags$b(quest["q19", 1]))
)
)
)
)
),
hr(),
fluidRow(
column(12,
box(id = "box1", width = 10, status = "success",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
introBox(
h3("Objective 4: View and interpret organic matter data from your focal reservoir"))
)
)
)
)
),
hr(),
fluidRow(
column(12,
h3(tags$i("Now we will visualize high-frequency data from your chosen reservoir and explore how these data can be related to potential DBP precursors.")))
),
fluidRow(
column(12, align = "center",
h3("Using fluorescent dissolved organic matter as an indicator of DBP precursors",
align = "center"),
p(tags$i("Watch the video and click through the slides to understand how fDOM data relate to possible DBP formation. The information in the presentation is also summarized in text below to help you answer the questions.")),
wellPanel(
HTML('<iframe width="1100" height="825" src="https://www.youtube.com/embed/Y0-iBD_HqI4?si=19BrCLy8AHWh7Y_L" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'),
)
)
),
fluidRow(
column(4,
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h4("Questions"),
p(tags$b(quest["q20", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q20a", ]),
tags$li(id = "txt_j", quest["q20b", ]),
tags$li(id = "txt_j", quest["q20c", ]),
tags$li(id = "txt_j", quest["q20d", ])
),
p(tags$b(quest["q21", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q21a", ]),
tags$li(id = "txt_j", quest["q21b", ]),
tags$li(id = "txt_j", quest["q21c", ]),
tags$li(id = "txt_j", quest["q21d", ])
),
p(tags$b(quest["q22", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q22a", ]),
tags$li(id = "txt_j", quest["q22b", ]),
tags$li(id = "txt_j", quest["q22c", ]),
tags$li(id = "txt_j", quest["q22d", ])
)
)
)
)
),
column(8, offset = 0,
h4("You can click the arrows to navigate through the video presentation slides", align = "center"),
wellPanel(
slickROutput("fdom_slides", width = "700px", height = "525px")
),
p(tags$b("What is fDOM?")),
tags$ul(
tags$li(module_text["fDOM", ])
),
p(tags$b("How do we measure fDOM?")),
tags$ul(
tags$li(module_text["fDOM_measure", ])
),
p(tags$b("How is fDOM related to DBPs?")),
tags$ul(
tags$li(module_text["fDOM_DBPs", ])
)
)
),
hr(),
fluidRow(
column(4,
h3("A note on reading and interpreting graphs"),
p("Please watch the video on the right for a refresher course on reading and interpreting graphs. This may help you to answer the questions about water temperature data as well as other questions throughout the module.")
),
column(8, align = "center",
h4("Video: Reading and interpreting graphs"),
HTML('<iframe width="700" height="525" src="https://www.youtube.com/embed/3Bl5J5lIk6o?si=Uy1kTJkoVFtGj_YV" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
)
),
hr(),
fluidRow(
column(4,
h3("Plot fDOM data"),
p("Click the button below to plot fDOM data at your chosen reservoir site."),
actionButton("plot_fDOM", "Plot high-frequency fDOM data"),
br(),br(),
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h4("Questions"),
p(tags$b(quest["q23", 1])),
p(tags$b(quest["q24", 1])),
p(tags$b(quest["q25", 1]))
)
)
)
),
column(8,
wellPanel(
introBox(data.step = 7, data.intro = help_text["plots", 1],
plotlyOutput("fDOM_plot")
)
)
)
),
hr(),
fluidRow(
column(6,
h3("Converting fDOM to TOC"),
p("While fDOM and TOC are not exactly the same, we can use statistics to make a relationship that converts fDOM (in quinine sulfate units) to TOC (in milligrams per liter). With this relationship, fDOM data can help us detect the presence of potential DBP precursors and assess DBP formation risk based on the concentration of TOC."),
p("We have developed a relationship between fDOM (QSU) and TOC (mg/L) for your focal reservoir."),
p("This allows us to assess the possible levels of DBP precursors in the raw water in terms of TOC."),
p("You can input an fDOM reading in QSU into the box below, click 'Convert', and see the corresponding TOC level in mg/L."),
numericInput(
"fdom",
"fDOM (QSU)",
value = NULL,
min = 0.1,
max = 30,
step = 0.1
),
actionButton("convert_fDOM", "Convert fDOM to TOC"),
br(),br(),
wellPanel(
textOutput("toc_out")
),
br(),br(),
h4(tags$b("Hints for completing Q.27!")),
p(tags$i("1. Use the converter to convert the fDOM value given in Q.27 to TOC.")),
p(tags$i("2. Find the row in Table 2 that corresponds to the TOC level you receive from the converter.")),
p(tags$i("3. Find the column in Table 2 that corresponds to the raw (source) water alkalinity value given in Q.27.")),
p(tags$i("4. Use the row from step 2 and the column from step 3 to find the percent of TOC that is required to be removed from the reservoir.")),
p(tags$i("5. Calculate how much TOC must be removed in mg/L by multiplying the TOC value you received from the converter by the percent in the table.")),
p(tags$i("(For example, 3 mg/L TOC x 50% = 1.5 mg/L TOC.)"))
),
column(6,
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h4("Questions"),
p(tags$b(quest["q26", 1])),
p("Q27. The U.S. Environmental Protection Agency (US EPA) has a rule regarding removal of TOC from drinking water during treatment (see table below). The percentage of TOC that must be removed during treatment depends on the amount of TOC in the raw water (see the first column of the table), as well as the raw water alkalinity (second, third, and fourth columns of the table). Use the fDOM-to-TOC converter to determine how much TOC should be removed from a ",tags$u("hypothetical")," reservoir with an fDOM concentration of 40 QSU and a raw water alkalinity of 50 mg/L. Report your answer in mg/L of TOC to the nearest tenth (e.g., 2.1)."),
img(src = "EPA_TOC_rule.png", height = "100%",
width = "100%"),
p("Table reproduced from US EPA 816-F-01-014: Stage 1 Disinfectants and Disinfection Byproducts Rule"),
p(tags$a(href="https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf",
"https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf", target = "_blank")),
br(),br(),
p("After completing Q.27, if you would like to learn more about how the EPA and Virginia Department of Health (VDH) regulate TOC, you may visit the Virginia law website and download and read the EPA rule linked below."),
h4("A. Read the ",tags$a(href="https://law.lis.virginia.gov/admincode/title12/agency5/chapter590/section411","Virginia administrative code", target = "_blank")," relating to DBPs"),
h4("B. Download and read the U.S. EPA Stage 1 Disinfectants and Disinfection Byproducts Rule"),
tags$style(type="text/css", "#rule_dl {background-color:#98CAB2;color: white}"),
wellPanel(
fluidRow(
column(6, align = "center", offset = 3,
downloadButton(outputId = "rule_dl", label = "Download EPA Rule")
)
)
)
)
)
)
)
),
hr(),
fluidRow(
column(12,
h2("Next step"),
h4("You will complete a case study and use high-frequency fDOM data to make water treatment decisions to minimize the risk of DBP formation."),
)
)
),
# 7. Activity C ----
tabPanel(title = tab_names["mtab4", 2], value = "mtab4",
img(src = "eddie_banner_2020_test.png", height = 100,
width = 1544, top = 5),
fluidRow(
column(12,
wellPanel(style = paste0("background: ", obj_bg),
h2("Activity C - Use environmental data to inform water treatment decisions"),
p(module_text["act_C", ])
)
),
column(12,
box(id = "box1", width = 10, status = "success",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
introBox(
h3("Objective 5: Use fluorescent dissolved organic matter data to make water treatment decisions"))
)
)
)
)
),
hr(),
fluidRow(
column(6,
box(id = "box12", width = 12, status = "warning",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h3("Water treatment scenario"),
h4("Decide: should I increase my coagulation time to prevent potential DBP formation during treatment?"),
p("You are operating a reservoir water treatment plant that has experienced high levels of TOC in the filtered water in the past. While there have not been DBPs detected at the treatment plant or in the distribution system to date, your supervisor is concerned about the risk of DBP formation due to high TOC levels that are sometimes observed in both the raw and filtered water."),
p("Because TOC samples are only taken once per month, your supervisor recommends that you monitor the daily fDOM data collected from the raw water to determine whether an increase in coagulation time is needed to mitigate the risk of DBP formation."),
h4("Your objective is to determine whether to increase coagulation time to ensure you meet the regulatory limit for TOC in the filtered water (and therefore hopefully avoid formation of DBPs)."),
p("Previous operators at this reservoir have found that raw water concentrations ",tags$b("> 10 mg/L")," of TOC have often led to exceedance of TOC guidelines in the filtered water."),
p("View the fDOM data during three different times of the year (winter, spring, and summer) and use the fDOM to TOC converter to decide whether you should increase coagulation time to reduce DBP formation risk.")
)
)
)
),
column(6,
img(src = "SHRtreatmentPlant.png", height = "90%", id = "bla_border",
width = "90%", tags$style("border: solid 2px black;")),
p(tags$em("Spring Hollow Water Treatment Facility, Roanoke County, VA")),
p(tags$em("Photo credit: Western Virginia Water Authority"))
)
),
hr(),
fluidRow(
column(6,
h3("Use the fDOM to TOC converter and the required removal of TOC table to help you make management decisions"),
p("We have developed a relationship between fDOM (QSU) and TOC (mg/L) for the case study reservoir for this activity. This is the same kind of converter we used in Activity B, but uses data from the case study reservoir for Activity C."),
p("This allows us to assess the possible levels of DBP precursors in the raw water in terms of TOC."),
p("You can input an fDOM reading in QSU into the box below, click 'Convert', and see the corresponding TOC level in mg/L."),
p("Then, you can use the table to determine how much TOC should be removed from your reservoir. For this activity, ",tags$b("you can assume that your reservoir always has an alkalinity of < 60 mg/L.")),
p("Use the converters and tables below each time series plot to help you make management decisions."),
numericInput(
"fdom1",
"fDOM (QSU)",
value = NULL,
min = 0.1,
max = 30,
step = 0.1
),
actionButton("convert_fDOM1", "Convert fDOM to TOC"),
br(),br(),
wellPanel(
textOutput("toc_out1")
)
),
column(6,
img(src = "EPA_TOC_rule.png", height = "100%",
width = "100%"),
p("Table reproduced from US EPA 816-F-01-014: Stage 1 Disinfectants and Disinfection Byproducts Rule"),
p(tags$a(href="https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf",
"https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf", target = "_blank")),
br(),br()
)
),
hr(),
fluidRow(
column(4,
h3("Management decision #1: Winter data"),
p("Examine the previous month of fDOM data from the raw water in your reservoir on the right. Then answer the questions below."),
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h4("Questions"),
p(tags$b(quest["q28", 1])),
p(tags$b(quest["q29", 1])),
p(tags$i("Hint: recall that for this activity, you can assume the alkalinity of the reeservoir is always < 60 mg/L.")),
p(tags$b(quest["q30", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q30a", ]),
tags$li(id = "txt_j", quest["q30b", ]),
tags$li(id = "txt_j", quest["q30c", ]),
tags$li(id = "txt_j", quest["q30d", ])
),
p(tags$b(quest["q31", 1])),
p("Optional exercise: Reflect on why you made this decision. What information did you use to arrive at your final choice?")
)
)
)
),
column(8,
wellPanel(
plotlyOutput("fDOM_plot_dec")
),
fluidRow(
column(6,
p("You can input an fDOM reading in QSU into the box below, click 'Convert', and see the corresponding TOC level in mg/L."),
numericInput(
"fdom2",
"fDOM (QSU)",
value = NULL,
min = 0.1,
max = 30,
step = 0.1
),
actionButton("convert_fDOM2", "Convert fDOM to TOC"),
br(),br(),
wellPanel(
textOutput("toc_out2")
)
),
column(6,
img(src = "EPA_TOC_rule.png", height = "100%",
width = "100%"),
p("Table reproduced from US EPA 816-F-01-014: Stage 1 Disinfectants and Disinfection Byproducts Rule"),
p(tags$a(href="https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf",
"https://www.vdh.virginia.gov/content/uploads/sites/14/2024/08/Stage-1-Disinfection-By-products-fact-sheet.pdf", target = "_blank")),
br(),br()
)
)
)
),
hr(),
fluidRow(
column(4,
h3("Management decision #2: Spring data"),
p("Flash forward from the winter to the spring. It is now March-April. Examine the previous month of fDOM data from the raw water in your reservoir on the right. Then answer the questions below."),
box(id = "box12", width = 12, status = "primary",
solidHeader = TRUE,
fluidRow(
column(10, offset = 1,
h4("Questions"),
p(tags$b(quest["q32", 1])),
p(tags$b(quest["q33", 1])),
p(tags$i("Hint: recall that for this activity, you can assume the alkalinity of the reeservoir is always < 60 mg/L.")),
p(tags$b(quest["q34", 1])),
tags$ul(
tags$li(id = "txt_j", quest["q34a", ]),
tags$li(id = "txt_j", quest["q34b", ]),
tags$li(id = "txt_j", quest["q34c", ]),
tags$li(id = "txt_j", quest["q34d", ])
),
p(tags$b(quest["q35", 1])),
p("Optional exercise: Reflect on why you made this decision. What information did you use to arrive at your final choice?")
)
)
)
),
column(8,
wellPanel(
plotlyOutput("fDOM_plot_var")
),
fluidRow(
column(6,
p("You can input an fDOM reading in QSU into the box below, click 'Convert', and see the corresponding TOC level in mg/L."),
numericInput(
"fdom3",
"fDOM (QSU)",
value = NULL,
min = 0.1,
max = 30,
step = 0.1
),
actionButton("convert_fDOM3", "Convert fDOM to TOC"),
br(),br(),