Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gauge() doesn't work well bslib's custom theming #300

Closed
cpsievert opened this issue Feb 9, 2021 · 0 comments · Fixed by #305
Closed

gauge() doesn't work well bslib's custom theming #300

cpsievert opened this issue Feb 9, 2021 · 0 comments · Fixed by #305

Comments

@cpsievert
Copy link
Collaborator

For example, I'd expect the gauge to use a light blue text color and also the Pacifico font:

library(shiny)
library(flexdashboard)
library(bslib)

ui <- fluidPage(
  theme = bs_theme(
    bg = "darkblue", fg = "lightblue",
    base_font = font_google("Pacifico")
  ),
  sliderInput("val", "Set gauge value", value = 37, min = 0, max = 50),
  gaugeOutput(outputId = "gauge")
)

server <- function(input, output) {
  
  sectors <- gaugeSectors(
    success = c(41, 50), 
    warning = c(21, 40), 
    danger = c(0, 20)
  )
  
  output$gauge <- renderGauge(
    gauge(
      input$val, min = 0, max = 50, 
      label = paste("Current value: ", input$val),
      sectors = sectors
    )
  )
  
}

shinyApp(ui = ui, server = server)

Screen Shot 2021-02-09 at 3 09 42 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant