This function crafts the actual tile per se, including the specific aesthetic traits for each tile. This is the simple version where you explicitly state the color.
solo_box(
value = NULL,
txt = NULL,
former = NULL,
size = "md",
icon = NULL,
color = "info",
link = NULL,
units = NULL,
hover = NULL,
textModifier = "h1",
pretty = FALSE,
...
)
The numeric value you want to highlight (the main enchilada)
Optional subtext that should appear under the value
The numeric old value to use for comparison to 'value'
Optional size specified in the bootstrap css classes: "xs","sm","md","lg")
Optional glyphicon that should be displayed from https://getbootstrap.com/docs/3.3/components/ you need only supply the name of thing you want, like "check"... not the full "gyphicon-check"
Optional bootstrap css element that governs the color. https://v4-alpha.getbootstrap.com/utilities/colors/ Choose from: "muted", "primary", "success", "info", "warning", "danger"
Optional hyperlink that should be followed on click
Optional units that should be displayed after Value
Optional tooltip, or text that will show up when a user rests their mouse over the tile.
Optional css category of "large" text. In this case, the icon, value and unit. In this case, title. Default=h1
Optionally allow numbers to become embellished. Accepted values are FALSE (default), or the desired divider (",", ".", " ", etc). If this option is not left as FALSE, rounding is automatically implemented.
Optional additional html elements. For example, if you would like two buttons to fit into a section in a flexdashboard, you could specify style = 'width:100%;height:50%'
b1 <- solo_box(color = "warning", value = 3.57, txt = "B")
b2 <- solo_box(color = "danger", value = 13.7, txt = "Nutritional value")
b3 <- solo_box(color = "success", value = 1, txt = "Yumminess factor")
b4 <- solo_box(value = 3.57, former = 3, txt = "Times apple eaten", icon = "apple")
finisher(title = "straight buttons", divs = b1)
straight buttons
finisher(
title = "with divs",
divs = div_maker(
subtitle = "boom",
textModifier = "h1",
div_maker(subtitle = "Boom", textModifier = "hi", b1, b2, b3)
)
)
with divs
## Or taking advantage of the ability to change the textModifier:
finisher(
title = "h4 modifier",
divs = solo_box(
value = 3, txt = "uh huh",
former = 2, textModifier = "h4"
)
)
h4 modifier