I'm pretty new to Shiny and am developing a demo application for an individual retirement account management tool. The app uses several R functions I wrote and several data inputs which load up with the app. The functions produce several basic portfolio performance values that I'm showing in reactive value/info boxes. The app works, except no colors are displayed in any of the boxes. A sample of the ui and server side code for the relevant app tab. This is probably clumsy code and a simple problem, but I've searched and havent found a similar thread yet. If anyone can tell me why no color shows up in these that would be great.
ui <-
tagList(
navbarPage(title = "sigma401k - Tactical Asset Allocation for Your 401(k)", theme = shinythemes::shinytheme("yeti"),
tabsetPanel(id = "sigma401k",
#skip to tab with info/value boxes
#tab 3 ---------------------------------------------------------------------------------------
tabPanel(title = "Simulated Performance with sigma401k",
fluidRow(
column(8, tags$h3("Hypothetical Performance of Your Portfolio With sigma401k"), offset=4)),
fluidRow(class="blankRow1", tags$head(tags$style(".blankRow1{height:50px;}"))),
###removed some rows for brevity###
fluidRow(
column(3, valueBoxOutput("annual.plan.returns", width = 300)),
column(3, valueBoxOutput("annual.sigma.returns", width = 300))
),
fluidRow(
column(3, infoBoxOutput("risk.profile")),
column(3, valueBoxOutput("
plan.sd", width = 300),offset = 1),
column(3, valueBoxOutput("
sigma.sd", width = 300))
),
fluidRow(
column(3, valueBoxOutput("plan.best.year", width = 300),offset = 4),
column(3, valueBoxOutput("sigma.best.year", width = 300))
),
fluidRow(
column(3, valueBoxOutput("plan.worst.year", width = 300),offset = 4),
column(3, valueBoxOutput("sigma.worst.year", width = 300))
),
fluidRow(
column(3, valueBoxOutput("plan.drawdown", width = 300),offset = 4),
column(3, valueBoxOutput("sigma.drawdown", width = 300))
),
output$risk.profile <- renderInfoBox({
infoBox(client.risk())})
output$annual.sigma.returns <- renderValueBox({
valueBox(sigma.return.fun(),
"Annual Return with sigma401k",
color = "aqua",
width = NULL)
})
output$annual.plan.returns <- renderValueBox({
valueBox(plan.return.fun(),
"Annual Return Based on Your Current Holdings",
color = "red",
width = NULL)
})
output$ending.plan.value <- renderInfoBox({input$start.backtest
infoBox("With your current mix of investments, the portfolio value would have
grown to", paste("$",format(plan.final.value, big.mark=","),sep=""))
})
output$ending.sigma.value <- renderInfoBox({input$rerun | input$start.backtest
infoBox(ending.sigma())
})
output$difference <- renderValueBox({
valueBox(paste0(difference.fun(), " (",diff.pct(),"%)",sep=""),
"Difference", color = "green",
icon = icon("line-chart", "fa-4x"),
width = NULL)
})
output$
plan.sd <- renderValueBox({input$start.backtest
"Your portfolio's annualized volatility", color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$
sigma.sd <- renderValueBox({input$rerun | input$start.backtest
"sigma401k's annualized volatility", color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$plan.best.year <- renderValueBox({input$start.backtest
valueBox(plan.best(),
paste0("Best Annual Return (", client.best.year,")", sep = ""), color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$sigma.best.year <- renderValueBox({input$rerun | input$start.backtest
valueBox(sigma.best(),
paste0("Best Annual Return (", best.year.index,")", sep = ""), color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$plan.worst.year <- renderValueBox({input$start.backtest
valueBox(plan.worst(),
paste0("Your Portfolio's Worst Year (", client.worst.year,")", sep = ""), color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$sigma.worst.year <- renderValueBox({input$rerun | input$start.backtest
valueBox(sigma.worst(),
paste0("sigma401k's Worst Annual Return (", worst.year.index,")", sep = ""), color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$plan.drawdown <- renderValueBox({input$start.backtest
valueBox(plan.draw(),
"Your Portfolio's Worst Drawdown (Peak to Trough)", color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})
output$sigma.drawdown <- renderValueBox({input$rerun | input$start.backtest
valueBox(sigma.draw(),
"sigma401k's Worst Drawdown", color = "green",
icon = icon("barchart", "fa-3x"),
width = NULL)
})