-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
840 lines (742 loc) · 33.3 KB
/
ui.R
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
# #### UI -----
# ui shiny ----
ui <- dashboardPage(
dashboardHeader(
title = div("Cancer Survival", style = "text-align: left;"), # Align title to the left
titleWidth = 250 # Adjust the width as needed
),
## menu ----
dashboardSidebar(
sidebarMenu(
menuItem(
text = "Background",
tabName = "background",
icon = shiny::icon("book")
),
menuItem(
text = "Database Snapshot",
tabName = "dbs",
icon = shiny::icon("database"),
menuSubItem(
text = "Snapshot",
tabName = "snapshotcdm"
)
),
menuItem(
text = "Cohorts",
tabName = "cohorts",
icon = shiny::icon("person"),
menuSubItem(
text = "Cohort concepts",
tabName = "cohort_concepts"
),
menuSubItem(
text = "Cohort Attrition Table",
tabName = "cohort_attrition"
),
menuSubItem(
text = "Cohort Attrition Figures",
tabName = "cohort_attr_fig"
)
),
menuItem(
text = "Characteristics",
tabName = "char",
icon = shiny::icon("hospital-user"),
menuSubItem(
text = "Demographics",
tabName = "demographics"
)
),
menuItem(
text = "Overall Survival",
tabName = "os",
icon = shiny::icon("line-chart")
,
menuSubItem(
text = "Survival Plots",
tabName = "survival_results"
),
menuSubItem(
text = "Summary Survival Plots",
tabName = "summary_plots"
),
menuSubItem(
text = "Risk Table",
tabName = "risk_results"
),
menuSubItem(
text = "Survival Estimates",
tabName = "stats_results"
)
),
menuItem(
text = "Data Partners",
tabName = "dp",
icon = shiny::icon("users-viewfinder"),
menuSubItem(
text = "Data Partners",
tabName = "test"
)
),
# Logo HDS
tags$div(
style = "position: relative; margin-top: 20px; text-align: center; margin-bottom: 0;",
a(img(
src = "EHDEN_Logo_JPG.jpg", # Replace with the correct file name and extension
height = "60px", # Adjust the height as needed
width = "auto" # Let the width adjust proportionally
),
href = "https://www.ehden.eu/",
target = "_blank"
)
) ,
# Logo HDS
tags$div(
style = "position: relative; margin-top: 20px; text-align: center; margin-bottom: 0;",
a(img(
src = "Logo_HDS.png", # Replace with the correct file name and extension
height = "80px", # Adjust the height as needed
width = "auto" # Let the width adjust proportionally
),
href = "https://www.ndorms.ox.ac.uk/research/research-groups/Musculoskeletal-Pharmacoepidemiology",
target = "_blank"
)
) ,
# Logo UOXD
tags$div(
style = "position: relative; margin-top: -20px; text-align: center; margin-bottom: 0;",
a(img(
src = "logoOxford.png", # Replace with the correct file name and extension
height = "100px", # Adjust the height as needed
width = "auto" # Let the width adjust proportionally
),
href = "https://www.ndorms.ox.ac.uk/research/research-groups/Musculoskeletal-Pharmacoepidemiology",
target = "_blank"
)
)
)
),
## body ----
dashboardBody(
use_theme(mytheme),
tabItems(
# background ------
tabItem(
tabName = "background",
h3("Characterising Comorbidities, Medication Use, and Survival in Eight Incident Cancers Across Europe: A Multinational Network Cohort Study of 1.7 Million Patients"),
tags$h4(tags$strong("Please note, the results presented here should be considered as
preliminary and subject to change.")),
tags$h5(
"This app is a companion to the study focussing trends in comorbidities, concomitant treatments, and overall survival for eight cancers (Breast, Colorectal, Lung, Liver, Stomach, Head & Neck, Prostate, and Pancreas) for a variety of different electronic health records and cancer registries across Europe (Spain, Netherlands, Norway, Finland, Portugal, Estonia, Switzerland, and the United Kingdom)."
),
tags$h5(
tags$span("Background:", style = "font-weight: bold;"),
"Real-world evidence provides valuable insights into cancer burden, presentation, and variations in care. This study examines patient characteristics and overall survival for breast, pancreatic, prostate, colorectal, lung, stomach, liver, and head and neck cancers using data from 11 electronic health records and cancer registries from eight European countries, mapped to the Observational Medical Outcomes Partnership Common Data Model (OMOP-CDM)."
),
tags$h5(
tags$span("Methods:", style = "font-weight: bold;"),
"Patients aged 18 years or older with a primary cancer diagnosis between January 1st, 2000, and December 31st, 2019, were included. Patients were followed from cancer diagnosis until death, database exit, or study end. Mortality data was sourced from linked national death registries for most databases. Patient characteristics, including sex, age, comorbidities, and medication use, were summarised. Age-standardised overall survival at one, five, and ten years were calculated using the Kaplan-Meier method and stratified by cancer type, age group and sex."
),
tags$h5(
tags$span("Findings:", style = "font-weight: bold;"),
"There were 1,796,278 eligible cancer patients included with most diagnoses in individuals aged 60-79 years. Top comorbidities and medications were relatively consistent across databases, with certain variations observed by cancer type, possibly indicative of early cancer signs. For instance, anaemia was frequent in colorectal (9%-23%) and stomach cancers (10%-34%), while chronic obstructive pulmonary disease (18%-34%) and pneumonia (15%-33%) were common in lung cancer patients. Breast and prostate cancers had the highest one, five and ten-year overall survival, and pancreatic cancer showed the lowest survival in all databases. Slight variations in cancer survival estimates were observed across data sources and countries."
),
tags$h5(
tags$span("Interpretation:", style = "font-weight: bold;"),
"Integrating varied real-world data sources, utilizing the standardized OMOP-CDM structure, facilitates federated analyses and may offer promising avenues to enhance our understanding of cancer outcomes, including prodromes, which are often recorded in routinely collected healthcare data before cancer onset."
),
tags$h5(
tags$span("Funding:" , style = "font-weight: bold;"),
"This research was funded by the European Health Data and Evidence Network (EHDEN) (grant number 806968), and the Oxford NIHR Biomedical Research Centre."
),
tags$h5("The results of this study are published in the following preprint and journal:"
),
tags$ol(
tags$li(strong("Preprint"),"(",tags$a(href="https://www.ndorms.ox.ac.uk/research/research-groups/Musculoskeletal-Pharmacoepidemiology","Paper Link"),")" )),
tags$ol(
tags$li(strong("Journal Article"),"(",tags$a(href="https://www.ndorms.ox.ac.uk/research/research-groups/Musculoskeletal-Pharmacoepidemiology","Paper Link"),")" )),
tags$h5("The analysis code used to generate these results can be found",
tags$a(href="https://github.com/oxford-pharmacoepi/CancerSurvivalWp2Analysis", "here"),
".The cohort diagnostics including the clinical codelists for each cancer can be found",
tags$a(href="https://dpa-pde-oxford.shinyapps.io/CancerExtrapolationDiagnostics/", "here")
),
tags$h5("Any questions regarding this shiny app or the study please contact",
tags$a(href="mailto:danielle.newby@ndorms.ox.ac.uk", "Danielle Newby"), "or the corresponding author",
tags$a(href="mailto:tduarte@idiapjgol.org", "Talita Duarte Salles")
),
tags$hr()
),
# cdm snapshot ------
tabItem(
tags$h5("Snapshot of the cdm from database"),
tabName = "snapshotcdm",
htmlOutput('tbl_cdm_snaphot'),
tags$hr(),
div(
style = "display:inline-block",
downloadButton(
outputId = "gt_cdm_snaphot_word",
label = "Download table as word"
),
style = "display:inline-block; float:right"
)
) ,
tabItem(
tabName = "test",
h4("Thanks go to all the Data Partners and collaborators who participated in this study"),
fluidRow(
column(width = 3, div(class = "logo-container", img(src = "logoOxford.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "idiap.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "nice.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "CPRD.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "sidiap.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "iknl.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "crnorway.svg", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "hus.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "huvm.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "gcr.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "eci.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "uoe.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "imasis.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "imasis1.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "ulsm.jpeg", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "ulsra.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "ulsedv.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "ulsge.jpeg", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "ipci.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "erasmus.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "odysseus.png", height = "100px"))),
column(width = 3, div(class = "logo-container", img(src = "utartu.png", height = "100px")))
),
tags$style(HTML("
.logo-container {
display: flex;
justify-content: center;
align-items: center;
height: 120px; /* Adjusted height to include margin space */
margin: 10px 0; /* Adds space above and below each logo */
}
.logo-container img {
max-height: 100px;
max-width: 90%;
}
"))
),
tabItem(
tabName = "demographics",
tags$h5("The patient characteristics for the study populations are presented below:"),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "demographics_database_selector",
label = "Database",
choices = unique(tableone_whole$cdm_name),
selected = unique(tableone_whole$cdm_name),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "demographics_cohort_selector",
label = "Cancer",
choices = unique(tableone_whole$group_level),
selected = "cohort_name",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "demographics_selector",
label = "Demographics",
choices = unique(tableone_whole$strata_level),
selected = "Overall",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "width: 80vh; height: 5vh;", # Set width to 100% for responsive design
checkboxInput("show_cond_meds", "Include Comorbidities & Medications", value = FALSE)
),
# tags$hr(),
gt_output("gt_patient_characteristics") %>%
withSpinner() ,
div(style="display:inline-block",
downloadButton(
outputId = "gt_patient_characteristics_word",
label = "Download table as word"
),
style="display:inline-block; float:right") ,
# ) ,
div(style="display:inline-block",
downloadButton(
outputId = "gt_patient_characteristics_csv",
label = "Download table as csv"
),
style="display:inline-block; float:right")
) ,
tabItem(
tabName = "stats_results",
tags$h5("Survival results containing one, five and ten year survival, restricted mean survival and median survival for each database are presented below:"),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "surv_est_database_name_selector",
label = "Database",
choices = unique(med_surv_km_sex_age$Database),
selected = unique(med_surv_km_sex_age$Database),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "surv_est_cohort_name_selector",
label = "Cancer",
choices = unique(survival_km$Cancer),
selected = "Breast",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "surv_est_sex_selector",
label = "Sex",
choices = unique(survival_km$Sex),
selected = "Both",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "surv_est_age_selector",
label = "Age",
choices = unique(med_surv_km_sex_age$Age),
selected = "All",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
DTOutput("dt_surv_est"),
div(style="display:inline-block",
downloadButton(
outputId = "gt_surv_est_word",
label = "Download table as word"
),
style="display:inline-block; float:right")
),
tabItem(
tabName = "risk_results",
tags$h5("The risk table showing the numbers at risk are presented below:"),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "risk_table_database_name_selector",
label = "Database",
choices = unique(survival_risk_table$Database),
selected = unique(survival_risk_table$Database),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "risk_table_cohort_name_selector",
label = "Cancer",
choices = unique(survival_risk_table$Cancer),
selected = "Breast",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "risk_table_sex_selector",
label = "Sex",
choices = unique(survival_risk_table$Sex),
selected = "Both",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "risk_table_age_selector",
label = "Age",
choices = unique(survival_risk_table$Age),
selected = "All",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
htmlOutput('dt_risk_table'),
div(style="display:inline-block",
downloadButton(
outputId = "gt_risk_table_word",
label = "Download table as word"
),
style="display:inline-block; float:right")
),
tabItem(
tabName = "cohort_attr_fig",
tags$h5("Attrition Diagrams for study populations:"),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "attrition_database_name_selector1",
label = "Database",
choices = unique(attritioncdm$Database),
selected = unique(attritioncdm$Database)[1],
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = FALSE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "attrition_cohort_name_selector1",
label = "Cancer",
choices = unique(attritioncdm$Cancer),
selected = "Breast",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = FALSE
)
),
div(
style = "width: 80%; height: 90%;", # Set width to 100% for responsive design
grVizOutput("attrition_diagram", width = "400px", height = "100%") %>%
withSpinner(),
h4("Download Figure"),
div("Width:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block;",
textInput("attrition_download_width", "", 600, width = "50px")
),
div("pixels", style = "display: inline-block; margin-right: 25px;"),
downloadButton("cohort_attrition_download_figure", "Download plot")
)
),
# cohort definition ------
tabItem(
tabName = "cohort_concepts",
pickerInput(
inputId = "cohort_set_input",
label = "Cohort Set",
choices = unique(cohort_set$cohort_name),
selected = unique(cohort_set$cohort_name)[1],
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = FALSE
),
tabsetPanel(
type = "tabs",
tabPanel(
"Cohort definition",
uiOutput("markdown")
),
tabPanel(
"JSON",
h4(),
rclipboardSetup(),
uiOutput("clip"),
verbatimTextOutput("verb"),
) ,
tabPanel(
"Concept sets",
htmlOutput('tbl_concept_sets'),
div(style="display:inline-block",
downloadButton(
outputId = "dt_concept_sets_word",
label = "Download table as word"
),
style="display:inline-block; float:right")
),
)
),
tabItem(
tags$h5("The cohort attrition showing how the final study populations were obtained are presented below:"),
tabName = "cohort_attrition",
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "attrition_database_name_selector",
label = "Database",
choices = unique(attritioncdm$Database),
selected = unique(attritioncdm$Database)[1],
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "attrition_cohort_name_selector",
label = "Study cohort",
choices = unique(attritioncdm$Cancer),
selected = "Breast",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
htmlOutput('dt_attrition'),
div(style="display:inline-block",
downloadButton(
outputId = "gt_attrition_word",
label = "Download table as word"
),
style="display:inline-block; float:right")
),
tabItem(
tabName = "summary_plots",
tags$h5("Plots of summary survival statistics for the study are presented below:"),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survivalsum_database_selector",
label = "Database",
choices = unique(med_surv_km_sex_age$Database),
selected = unique(med_surv_km_sex_age$Database),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survivalsum_cohort_name_selector",
label = "Cancer",
choices = unique(med_surv_km_sex_age$Cancer),
selected = unique(med_surv_km_sex_age$Cancer),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survivalsum_sex_selector",
label = "Sex",
choices = unique(med_surv_km_sex_age$Sex),
selected = "Both",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survivalsum_age_selector",
label = "Age",
choices = unique(med_surv_km_sex_age$Age),
selected = "All",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survivalsum_variable_selector",
label = "Summary Statistic",
choices = unique(med_surv_km_sex_age$Variable),
selected = "One Year Survival",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = FALSE
)
),
div(style="display: inline-block;vertical-align:top; width: 150px;",
pickerInput(inputId = "survsum_plot_facet",
label = "Facet by",
choices = c("Cancer",
"Database",
"Sex",
"Age"
),
selected = c("Cancer" ),
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"),
multiple = TRUE)
),
div(style="display: inline-block;vertical-align:top; width: 150px;",
pickerInput(inputId = "survsum_plot_group",
label = "Colour by",
choices = c("Sex",
"Age",
"Cancer",
"Database"),
selected = c("Cancer"),
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"),
multiple = TRUE)
),
div(
style = "width: 80%; height: 90%;", # Set width to 100% for responsive design
plotOutput("survivalPlotSum",
height = "800px"
) %>%
withSpinner(),
h4("Download Figure"),
div("Height:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block;",
textInput("survivalsum_download_height", "", 30, width = "50px")
),
div("cm", style = "display: inline-block; margin-right: 25px;"),
div("Width:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block;",
textInput("survivalsum_download_width", "", 35, width = "50px")
),
div("cm", style = "display: inline-block; margin-right: 25px;"),
div("dpi:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block; margin-right:",
textInput("survivalsum_download_dpi", "", 600, width = "50px")
),
downloadButton("survivalsum_download_plot", "Download plot")
)
) ,
tabItem(
tabName = "survival_results",
tags$h5("The Kaplan-Meier survival plots are presented below. We present the crude and age standardized KM curves. We calculated age-standardised survival estimates for all ages combined for both sexes and for using the direct method using",
tags$a(href = "https://www.sciencedirect.com/science/article/pii/S0959804904005283", "ICSS weightings"),
"We were unable to estimate age survival for some countries due to the small number of cases in some age and cancer-specific strata, so they are not presented as results."),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survival_database_selector",
label = "Database",
choices = unique(survival_km$Database),
selected = unique(survival_km$Database),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survival_cohort_name_selector",
label = "Cancer",
choices = unique(survival_km$Cancer),
selected = "Breast",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survival_sex_selector",
label = "Sex",
choices = unique(survival_km$Sex),
selected = "Both",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survival_age_selector",
label = "Age",
choices = unique(survival_km$Age),
selected = "All",
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
pickerInput(
inputId = "survival_type_selector",
label = "Database Type",
choices = unique(survival_km$database_type),
selected = unique(survival_km$database_type),
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3"),
multiple = TRUE
)
),
div(style="display: inline-block;vertical-align:top; width: 150px;",
pickerInput(inputId = "surv_plot_facet",
label = "Facet by",
choices = c("Cancer",
"Database",
"Sex",
"Age",
"database_type"
),
selected = c("Cancer" ),
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"),
multiple = TRUE,)
),
div(style="display: inline-block;vertical-align:top; width: 150px;",
pickerInput(inputId = "surv_plot_group",
label = "Colour by",
choices = c("Sex",
"Age",
"Cancer",
"Database"),
selected = c("Database"),
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"),
multiple = TRUE,)
),
div(
style = "width: 80vh; height: 5vh;", # Set width to 100% for responsive design
checkboxInput("show_ci", "Show Confidence Intervals", value = FALSE)
),
div(
style = "width: 100%;", # Use percentage to make it responsive within the column
numericInput("facet_ncol", "Number of Facets Columns:", value = 2, min = 1, max = 10, step = 1)
),
div(
style = "width: 80%; height: 90%;", # Set width to 100% for responsive design
plotOutput("survivalPlot",
height = "800px"
) %>%
withSpinner(),
h4("Download Figure"),
div("Height:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block;",
textInput("survival_download_height", "", 30, width = "50px")
),
div("cm", style = "display: inline-block; margin-right: 25px;"),
div("Width:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block;",
textInput("survival_download_width", "", 35, width = "50px")
),
div("cm", style = "display: inline-block; margin-right: 25px;"),
div("dpi:", style = "display: inline-block; font-weight: bold; margin-right: 5px;"),
div(
style = "display: inline-block; margin-right:",
textInput("survival_download_dpi", "", 600, width = "50px")
),
downloadButton("survival_download_plot", "Download plot")
)
)
)
)
)