-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_quarto_doc.qmd
88 lines (53 loc) · 1.75 KB
/
sample_quarto_doc.qmd
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
---
title: "Premier League 2023-24 Season Analysis"
author: "Hari Krishna"
format:
dashboard:
orientation: rows
theme: sky
server: shiny
---
```{r warning=FALSE}
#| context: setup
source("R/utils.R")
match_results_data<-read.csv("data/match_results_data.csv")
final_pl_table<-read.csv("data/final_pl_table.csv")
final_pl_table<-sparklines_logic(match_data = match_results_data,final_pl_table = final_pl_table)
```
# {.sidebar}
```{r}
shiny::selectInput('selectteam', 'Select Team',choices=unique(match_results_data$Home))
br()
shiny::selectInput('selectmatch', 'Select Match',choices=NULL)
```
```{r}
#| context: server
observe({
req(input$selectteam)
shiny::updateSelectInput(session,"selectmatch",choices =names(get_match_details(match_results_data,input$selectteam)))
})
output$plot<-renderPlotly({
draw_event_graph(match_url = get_match_details(match_results_data,input$selectteam)[input$selectmatch],data_hex = hex_codes)
}) %>% shiny::bindCache(input$selectmatch)
output$table<-renderReactable({
match_report(match_url = get_match_details(match_results_data,input$selectteam)[input$selectmatch])
}) %>% shiny::bindCache(input$selectmatch)
output$season_stats<-renderReactable({
season_level_stats(final_pl_table)
})
```
# Match Level Stats
```{r}
#| title: "Events vs Time Graph "
shinycssloaders::withSpinner(plotlyOutput('plot',width ='100%',height='100%'),type=2,color.background = "orange")
```
```{r}
#| title: "Match Report Table"
shinycssloaders::withSpinner(reactable::reactableOutput("table"),type=2,color.background = "orange")
```
# Season Level Stats
## Row
```{r}
#| title: "Season Report Table"
shinycssloaders::withSpinner(reactable::reactableOutput("season_stats"),type=2,color.background = "orange")
```