Created
June 20, 2016 04:52
-
-
Save renkun-ken/ae0b17402522386ae1f09a24b26cd449 to your computer and use it in GitHub Desktop.
formattable: color bar + color text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(formattable) | |
data <- data.frame(id = 1:10, x = rbinom(10, 100, 0.8)) | |
formattable(data, list(x = formatter("span", | |
style = x ~ style( | |
display = "inline-block", | |
direction = "rtl", | |
"border-radius" = "4px", | |
"padding-right" = "2px", | |
"background-color" = csscolor("lightgray"), | |
width = percent(proportion(x)), | |
color = csscolor(gradient(x, "darkgreen", "red")) | |
)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your demo. It has helped me a lot.