https://github.com/react-r/colorpicker-example
Example of a react-color based Shiny input for picking colors
https://github.com/react-r/colorpicker-example
Last synced: 5 months ago
JSON representation
Example of a react-color based Shiny input for picking colors
- Host: GitHub
- URL: https://github.com/react-r/colorpicker-example
- Owner: react-R
- Created: 2019-02-28T17:00:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-26T15:55:25.000Z (over 5 years ago)
- Last Synced: 2025-06-02T02:31:27.916Z (9 months ago)
- Language: JavaScript
- Size: 349 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-color Shiny input
This example demonstrates creating a [Shiny
input](https://shiny.rstudio.com/articles/building-inputs.html) wrapper around
the [react-color](https://github.com/casesandberg/react-color) library.
# Building
Because this package includes JavaScript source code that requires a compilation
step, package installation is in two phases: JavaScript tools build the
JavaScript, and R tools build and install the package. The R package includes
the built JavaScript files in the `inst/` directory.
## JavaScript Build Requirements
Building JavaScript should work on macOS, Linux, and Windows. The following
tools are necessary regardless of your platform:
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/en/)
## R Build Requirements
You should install the `reactR` package if you haven't, as this input depends
on it.
## Development Workflow
After you've installed Node.js and Yarn, run the following command to resolve
and download dependencies:
```
yarn install
```
Now, run `yarn` to build `www/colorpicker/colorpicker/colorpicker.js`:
```
yarn run webpack
```
> To run `yarn webpack` automatically whenever sources change, use the command
> `yarn run webpack --watch`
Now that the JavaScript is built, you can install the R package:
```
devtools::document()
devtools::install()
```
Finally you can try the example app by running [app.R](app.R).