Spaces:
Running
Running
improved valueBoxes
Browse files
app/app.R
CHANGED
@@ -273,11 +273,13 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
273 |
h3(strong(textOutput(outputId = "text_payout"))),
|
274 |
|
275 |
fluidRow(
|
276 |
-
|
277 |
-
valueBoxOutput("payout_confirmed", width =
|
278 |
-
valueBoxOutput("payout_pending", width =
|
279 |
-
valueBoxOutput("payout_total", width =
|
280 |
-
valueBoxOutput("
|
|
|
|
|
281 |
),
|
282 |
|
283 |
br(),
|
@@ -527,32 +529,42 @@ server <- function(input, output) {
|
|
527 |
|
528 |
output$payout_confirmed <- renderValueBox({
|
529 |
valueBox(value = round(sum(react_d_filter()[resolved == TRUE, ]$payout, na.rm = T), 2),
|
530 |
-
subtitle = "
|
531 |
-
|
532 |
-
color = "green")
|
533 |
})
|
534 |
|
535 |
output$payout_pending <- renderValueBox({
|
536 |
valueBox(value = round(sum(react_d_filter()[resolved == FALSE, ]$payout, na.rm = T), 2),
|
537 |
subtitle = "Pending",
|
538 |
-
icon = icon("clock"),
|
539 |
color = "yellow")
|
540 |
})
|
541 |
|
542 |
output$payout_total <- renderValueBox({
|
543 |
valueBox(value = round(sum(react_d_filter()$payout, na.rm = T), 2),
|
544 |
-
subtitle = "
|
545 |
-
|
546 |
-
color = "aqua")
|
547 |
})
|
548 |
|
549 |
-
output$
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
color = "light-blue")
|
554 |
})
|
555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
|
557 |
# ============================================================================
|
558 |
# Reactive: Payout Charts
|
|
|
273 |
h3(strong(textOutput(outputId = "text_payout"))),
|
274 |
|
275 |
fluidRow(
|
276 |
+
class = "text-center",
|
277 |
+
valueBoxOutput("payout_confirmed", width = 2),
|
278 |
+
valueBoxOutput("payout_pending", width = 2),
|
279 |
+
valueBoxOutput("payout_total", width = 2),
|
280 |
+
valueBoxOutput("payout_n_round", width = 2),
|
281 |
+
valueBoxOutput("payout_average", width = 2),
|
282 |
+
valueBoxOutput("payout_avg_ror", width = 2)
|
283 |
),
|
284 |
|
285 |
br(),
|
|
|
529 |
|
530 |
output$payout_confirmed <- renderValueBox({
|
531 |
valueBox(value = round(sum(react_d_filter()[resolved == TRUE, ]$payout, na.rm = T), 2),
|
532 |
+
subtitle = "Realised",
|
533 |
+
color = "olive")
|
|
|
534 |
})
|
535 |
|
536 |
output$payout_pending <- renderValueBox({
|
537 |
valueBox(value = round(sum(react_d_filter()[resolved == FALSE, ]$payout, na.rm = T), 2),
|
538 |
subtitle = "Pending",
|
|
|
539 |
color = "yellow")
|
540 |
})
|
541 |
|
542 |
output$payout_total <- renderValueBox({
|
543 |
valueBox(value = round(sum(react_d_filter()$payout, na.rm = T), 2),
|
544 |
+
subtitle = "Realised + Pending",
|
545 |
+
color = "light-blue")
|
|
|
546 |
})
|
547 |
|
548 |
+
output$payout_n_round <- renderValueBox({
|
549 |
+
# Use rounds with stake > 0 only
|
550 |
+
valueBox(value = nrow(react_d_payout_summary()[total_stake > 0, ]),
|
551 |
+
subtitle = "Staked Rounds",
|
552 |
color = "light-blue")
|
553 |
})
|
554 |
|
555 |
+
output$payout_average <- renderValueBox({
|
556 |
+
# Use rounds with stake > 0 only
|
557 |
+
valueBox(value = round(mean(react_d_payout_summary()[total_stake > 0, ]$total_payout, na.rm = T), 2),
|
558 |
+
subtitle = "Avg. Round Payout",
|
559 |
+
color = "light-blue")
|
560 |
+
})
|
561 |
+
|
562 |
+
output$payout_avg_ror <- renderValueBox({
|
563 |
+
# Use rounds with stake > 0 only
|
564 |
+
valueBox(value = paste(round(mean(react_d_payout_summary()[total_stake > 0, ]$rate_of_return), 2), "%"),
|
565 |
+
subtitle = "Avg. Round ROR",
|
566 |
+
color = "light-blue")
|
567 |
+
})
|
568 |
|
569 |
# ============================================================================
|
570 |
# Reactive: Payout Charts
|