@@ -9,11 +9,17 @@ library(lubridate)
99library(reactable )
1010library(ggplot2 )
1111library(plotly )
12+ library(shinycssloaders )
1213
1314shinyOptions(
1415 cache = cachem :: cache_disk(" ./app_cache/cache/" , max_age = 60 * 60 )
1516)
1617
18+ options(
19+ spinner.type = 1 ,
20+ spinner.color = " #7494b1"
21+ )
22+
1723source(" get_usage.R" )
1824source(" integrations.R" )
1925
@@ -38,7 +44,7 @@ bar_chart <- function(
3844 value ,
3945 max_val ,
4046 height = " 1rem" ,
41- fill = " #00bfc4 " ,
47+ fill = " #7494b1 " ,
4248 background = NULL
4349) {
4450 width <- paste0(value * 100 / max_val , " %" )
@@ -201,7 +207,7 @@ ui <- function(request) {
201207 div(
202208 id = " multi_content_table" ,
203209 textOutput(" summary_text" ),
204- reactableOutput(" content_usage_table" )
210+ withSpinner( reactableOutput(" content_usage_table" ) )
205211 ),
206212
207213 # The single-content detail view is displayed when an item is selected,
@@ -229,7 +235,11 @@ ui <- function(request) {
229235 " Daily Visits" ,
230236 div(
231237 style = " height: 300px" ,
232- plotlyOutput(" daily_visits_plot" , height = " 100%" , width = " 100%" )
238+ withSpinner(plotlyOutput(
239+ " daily_visits_plot" ,
240+ height = " 100%" ,
241+ width = " 100%"
242+ ))
233243 )
234244 ),
235245 tabPanel(
@@ -250,11 +260,11 @@ ui <- function(request) {
250260 " Click a row to show only that user's visits."
251261 )
252262 ),
253- reactableOutput(" aggregated_visits" )
263+ withSpinner( reactableOutput(" aggregated_visits" ) )
254264 ),
255265 tabPanel(
256266 " List of Visits" ,
257- reactableOutput(" all_visits" )
267+ withSpinner( reactableOutput(" all_visits" ) )
258268 )
259269 )
260270 )
@@ -1145,7 +1155,10 @@ server <- function(input, output, session) {
11451155
11461156 height_px <- n_users * row_height + label_buffer + toolbar_buffer
11471157
1148- plotlyOutput(" visit_timeline_plot" , height = paste0(height_px , " px" ))
1158+ withSpinner(plotlyOutput(
1159+ " visit_timeline_plot" ,
1160+ height = paste0(height_px , " px" )
1161+ ))
11491162 })
11501163
11511164 # Global UI elements ----
0 commit comments