jbkunst / blog-old-distill

Data, Code and Visualization, old version using distill
http://jkunst.com/blog/
10 stars 4 forks source link

Data, Code and Visualization: valueBoxes and Sparklines #4

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Data, Code and Visualization: valueBoxes and Sparklines

http://jkunst.com/blog/posts/2020-06-26-valuebox-and-sparklines/

flachboard commented 3 years ago

Thank you for this! I'm excited to try it out in my app!

Sir-Chibi commented 2 years ago

It seems like its not possible to control width? Seems like it hard codes width to 4 even if i change it to 12

jbkunst commented 2 years ago

Hi @Sir-Chibi

  1. Is not hardcoded, the default value is 4 if the value is not given (function(..., width = 4)).
  2. This behavior works only in small screens (sm) due the line paste0("col-sm-", width). This is the original behavior of the original shiny::valueBox function.

If you want change, you can try change paste0("col-sm-", width) with paste0("col-", width) using as https://getbootstrap.com/docs/4.0/layout/grid/#grid-options.

Kind regards

tnguyenqh commented 1 year ago

This is so beautiful. I will apply these techniques to my company's boring dashboard

mubashirqasim commented 1 year ago

Hi Joshua,

Great work on 04-shinydashboard-n-spakrlines. Loved it!

I am having hard time making these widgets compatible with shiny apps outside shinydashboard. It will be great if these widgets become compatible with bslib somehow.

For instance, the widgets are not behaving in the following UI configuration. Any suggestions are much appreciated.

llibrary(bslib) # Control bs_theme & additional bs rules bs_add_rules ui <- bootstrapPage( theme = bs_theme(version = 5, bootswatch = "cerulean"), fluidRow( valueBoxOutput("vbox"), valueBoxOutput("vbox2"), valueBoxOutput("vbox3") ) )