-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
118 lines (100 loc) · 2.66 KB
/
app.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
library(shiny)
library(bslib)
library(brackets)
library(r2social)
library(shiny.telemetry)
# Data
source("global.R")
# Tracking
telemetry <- Telemetry$new() # 1. Initialize telemetry with default options
# App
ui <- page_fluid(
use_telemetry(),
titlePanel(title=div(tags$a(href='https://linktr.ee/estacion_r',
tags$img(src='https://pbs.twimg.com/profile_banners/1214735980172845056/1716430021/600x200',
height = 105, width = 300)), align = "center")),
theme = bs_theme(
primary = "#191919",
bg = "white",
fg = "#405BFF",
secondary = "#EAFF38",
success = "#405BFF",
base_font = font_google("Ubuntu")
),
# Redes sociales
r2social.scripts(),
shareButton(link = "https://estacionr.shinyapps.io/shiny_copa_america/",
position = "inline", plain = F,
text = "¿Querés saber cómo viene la Copa América? Revisá esta aplicación, actualizate y compartó los últimos resultados del torneo",
bg.col = "#EAFF38",
x = T,
facebook = T,
linkedin = T,
tiktok = T,
whatsapp = T,
telegram = T
),
# Paneles de la app
navset_underline(
# Calendario
nav_panel(
title = "Calendario",
br(),
fluidRow(
calendarOutput("my_calendar")
)
),
# Resultados
nav_panel(
title = "Resultados",
br(),
br(),
bracketsViewerOutput("c_america"),
br(),
textOutput("clicked_match2")
)
)
)
server <- function(input, output, session) {
telemetry$start_session() # 3. Minimal setup to track events
# Calendario
output$my_calendar <- renderCalendar({
calendar(
navigation = TRUE,
navOpts = navigation_options(
today_label = "Hoy",
class = "bttn-stretch bttn-sm bttn-warning",
color = "#50535C",
fmt_date = format("MM/YYYY"),
sep_date = "-"
)
) %>%
cal_schedules(
df_calendario
) %>%
cal_month_options(
startDayOfWeek = 1,
daynames =
#c("Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab"),
c("D", "L", "M", "M", "J", "V", "S"),
narrowWeekend = TRUE,
isAlways6Week = F
) %>%
cal_props(
id = 123,
color = "#405BFF", #cian
bgColor = "white",
borderColor = "#EAFF38" #rosa
)
})
# Resultados
output$c_america <- renderBracketsViewer({
bracketsViewer(
data = df_copa_america
)
})
output$clicked_match2 <- renderText({
input$soccer_match_click
})
}
shinyApp(ui = ui, server = server)