This is a simple color palette display widget built with htmlwidgets to use in R HTML applications (R Markdown documents, Shiny apps).
It is a very simple widget. In fact, this is my first widget and my first R package as well!!
I wrote this for the following reasons:
- To learn htmlwidgets.
- To learn React.
- To learn how to write R packages (thanks hadley!).
- To use it in my project app for the Developing Data Products class on coursera.
To be honest, I don't expect to be posting this on CRAN, so for now install
it in the devtools
way:
install.packages("devtools") # if you don't already have devtools installed
devtools::install_github("sigriston/palettewidget")
Easy peasy! Just pass a color palette:
library(palettewidget)
palettewidget(c("#ff0000", "#00ff00", "#0000ff"))
Or, if you want to see the corresponding HTML/CSS color names:
library(palettewidget)
palettewidget(c("#ff0000", "#00ff00", "#0000ff"),
displayNames = TRUE) # should display "red", "lime", "blue"
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
0.0.1: Initial version.
Actual palette widget written by Thiago Sigrist.
Uses the following dependencies:
- React by Facebook
- TinyColor by Brian Grinstead
MIT.