Skip to content

Commit

Permalink
deprecate all the colour picker functions since they moved to a new p…
Browse files Browse the repository at this point in the history
…ackage
  • Loading branch information
daattali committed Aug 16, 2016
1 parent be4071c commit 231990c
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 38 deletions.
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
Package: shinyjs
Title: Perform Common JavaScript Operations in Shiny Apps using Plain R Code
Version: 0.6.2
Version: 0.7
Authors@R: person("Dean", "Attali", email = "[email protected]",
role = c("aut", "cre"))
Description: Perform common JavaScript operations in Shiny applications without
having to know any JavaScript. Examples include: hiding an element, disabling
an input, resetting an input back to its original value, delaying code execution
by a few seconds, and many more useful functions. 'shinyjs' also includes
a colour picker widget, a colour picker RStudio addin, and can also be used to
easily run your own custom JavaScript functions from R.
by a few seconds, and many more useful functions.
URL: https://github.com/daattali/shinyjs
BugReports: https://github.com/daattali/shinyjs/issues
Depends:
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# shinyjs 0.7

2016-08-15

- All the colourpicker/colourInput related functions are now deprecated because I've made a more appropriate package for them [`colourpicker`](https://github.com/daattali/colourpicker)
- Use updated colourpicker JS library that fixes bugs with new jquery version

# shinyjs 0.6.2

2016-07-25
Expand Down
10 changes: 8 additions & 2 deletions R/colourInput.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' Create a colour input control
#' Create a colour input control (DEPRECATED)
#'
#' Create an input control to select a colour.
#' Create an input control to select a colour. \cr
#' \emph{As of August 2016, this function is being deprecated and has moved to
#' the \code{colourpicker} package. Please use the \code{colourpicker} package
#' in the future.}
#'
#' A colour input allows users to select a colour by clicking on the desired
#' colour, or by entering a valid HEX colour in the input box. The input can
Expand Down Expand Up @@ -77,6 +80,9 @@ colourInput <- function(inputId, label, value = "white",
allowedCols,
allowTransparent = FALSE, transparentText,
returnName = FALSE) {
.Deprecated("colourInput()",
msg = colourpickerDeprecateMsg("colourInput()"))

# sanitize the arguments
value <- formatHEX(value)
showColour <- match.arg(showColour)
Expand Down
9 changes: 7 additions & 2 deletions R/colourPickerGadget.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#' Colour picker gadget
#' Colour picker gadget (DEPRECATED)
#'
#' This gadget lets you choose colours easily. You can select multiple colours,
#' and you can either choose any RGB colour, or browse through R colours.
#' and you can either choose any RGB colour, or browse through R colours. \cr
#' \emph{As of August 2016, this function is being deprecated and has moved to
#' the \code{colourpicker} package. Please use the \code{colourpicker} package
#' in the future.}
#'
#' @param numCols The number of colours to select when the gadget launches (you
#' can add and remove more colours from the app itself too)
Expand All @@ -28,6 +31,8 @@ colourPickerAddin <- function() {
#' @import shiny
#' @import miniUI
colourPickerGadget <- function(numCols = 1) {
.Deprecated("colourPicker()",
msg = colourpickerDeprecateMsg("colourPicker()"))
if (!requireNamespace("rstudioapi", quietly = TRUE)) {
stop("You must have RStudio v0.99.878 or newer to use the colour picker",
call. = FALSE)
Expand Down
7 changes: 7 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ errMsg <- function(x) {
stop(sprintf("shinyjs: %s", x), call. = FALSE)
}

colourpickerDeprecateMsg <- function(x) {
paste0(
"As of August 2016, '", x, "' has been deprecated and has moved to the ",
"'colourpicker' package. Please use the 'colourpicker' package in the future."
)
}

# get the shiny session object
getSession <- function() {
session <- shiny::getDefaultReactiveDomain()
Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ original value, delaying code execution by a few seconds, and many more
useful functions. `shinyjs` can also be used to easily call your own
custom JavaScript functions from R.

As an extra perk, `shinyjs` also comes with a `colourInput()` Shiny
widget, and with a colour picker gadget+RStudio addin that let you
choose colours easily.

Table of contents
=================

Expand Down Expand Up @@ -47,11 +43,6 @@ Demos and tutorials
</h2>
- [Demo Shiny app](http://daattali.com/shiny/shinyjs-demo/) that lets
you play around with some of the functionality in `shinyjs`.
- [Interactive demo](http://daattali.com/shiny/colourInput/) of
`colourInput` - an input control that allow users to select colours.
- [Short
GIF ("video")](https://raw.githubusercontent.com/daattali/shinyjs/master/inst/img/colourPickerGadget.gif)
showcasing the colour picker addin+gadget.
- [Video of my shinyjs
talk](http://deanattali.com/shinyjs-shinydevcon-2016/) (30 min) and
the associated [presentation slides](http://bit.ly/shinyjs-slides)
Expand Down Expand Up @@ -128,12 +119,6 @@ list of the common functions:
information is available in the section "Calling your own JavaScript
functions from R".

- `colourInput` and `updateColourInput` - input widget that allows
users to select colours.

- `colourPicker` - opens an RStudio gadget that lets you select
colours (you can also call it from the RStudio *Addins* menu).

[Check out the demo Shiny app](http://daattali.com/shiny/shinyjs-demo/)
to see some of these in action, or install `shinyjs` and run
`shinyjs::runExample()` to see more demo apps.
Expand Down Expand Up @@ -740,6 +725,11 @@ could be useful. Note that all of these require using `extendShinyjs()`.
<h2 id="colourpicker">
Colour Picker input & addin
</h2>
**NOTE: As of August 2016, the colour picker functions are deprecated
and have moved into a separate package
[`colourpicker`](https://github.com/daattali/colourpicker). Please use
the `colourpicker` package instead of `shinyjs` in the future.**

`shinyjs` has a `colourInput()` function that lets you add a colour
picker widget to Shiny apps. There is also a colour picker RStudio addin
(accessed through the *Addins* menu) and a gadget (accessed with the
Expand Down
2 changes: 1 addition & 1 deletion inst/srcjs/shinyjs-default-funcs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// shinyjs 0.6.2 by Dean Attali
// shinyjs 0.7 by Dean Attali
// Perform common JavaScript operations in Shiny apps using plain R code

shinyjs = function() {
Expand Down
7 changes: 5 additions & 2 deletions man/colourInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/colourPicker.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/shinyjs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions vignettes/overview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ delaying code execution by a few seconds, and many more useful functions.
`shinyjs` can also be used to easily call your own custom JavaScript functions
from R.

As an extra perk, `shinyjs` also comes with a `colourInput()` Shiny widget, and with a colour picker gadget+RStudio addin that let you choose colours easily.

# Table of contents

- [Demos and tutorials](#demos)
Expand All @@ -52,8 +50,6 @@ As an extra perk, `shinyjs` also comes with a `colourInput()` Shiny widget, and

- [Demo Shiny app](http://daattali.com/shiny/shinyjs-demo/) that lets
you play around with some of the functionality in `shinyjs`.
- [Interactive demo](http://daattali.com/shiny/colourInput/) of `colourInput` - an input control that allow users to select colours.
- [Short GIF ("video")](https://raw.githubusercontent.com/daattali/shinyjs/master/inst/img/colourPickerGadget.gif) showcasing the colour picker addin+gadget.
- [Video of my shinyjs talk](http://deanattali.com/shinyjs-shinydevcon-2016/) (30 min) and the associated [presentation slides](http://bit.ly/shinyjs-slides) from the 2016 Shiny Developer Conference.
- [Video of my shinyjs talk](http://deanattali.com/shinyjs-user-2016/) (5 min) and the associated [presentation slides](http://bit.ly/shinyjs-slides-useR2016) from the 2016 useR Conference.

Expand Down Expand Up @@ -121,10 +117,6 @@ published Shiny app).
`shinyjs` to call them as if they were regular R code. More information is
available in the section "Calling your own JavaScript functions from R".

- `colourInput` and `updateColourInput` - input widget that allows users to select colours.

- `colourPicker` - opens an RStudio gadget that lets you select colours (you can also call it from the RStudio *Addins* menu).

[Check out the demo Shiny app](http://daattali.com/shiny/shinyjs-demo/) to see
some of these in action, or install `shinyjs` and run `shinyjs::runExample()`
to see more demo apps.
Expand Down Expand Up @@ -640,6 +632,8 @@ There are several questions that pop up very frequently in my email or on StackO

<h2 id="colourpicker">Colour Picker input & addin</h2>

**NOTE: As of August 2016, the colour picker functions are deprecated and have moved into a separate package [`colourpicker`](https://github.com/daattali/colourpicker). Please use the `colourpicker` package instead of `shinyjs` in the future.**

`shinyjs` has a `colourInput()` function that lets you add a colour picker widget to Shiny apps. There is also a colour picker RStudio addin (accessed through the *Addins* menu) and a gadget (accessed with the `colourPicker()` function) that can be used to easily select colours. The screenshot below is from the colour picker addin. You can also view a [short GIF demo](../inst/img/colourPickerGadget.gif) of the addin.

![Colour picker screenshot](../inst/img/colourpickerscrnshot.png)
Expand Down

0 comments on commit 231990c

Please sign in to comment.