diff --git a/DESCRIPTION b/DESCRIPTION index 229e940..e036fc8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "daattali@gmail.com", 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: diff --git a/NEWS.md b/NEWS.md index e24e51e..eab736a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/colourInput.R b/R/colourInput.R index 836d76b..0c54cd9 100644 --- a/R/colourInput.R +++ b/R/colourInput.R @@ -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 @@ -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) diff --git a/R/colourPickerGadget.R b/R/colourPickerGadget.R index a935d01..6aa1a7d 100644 --- a/R/colourPickerGadget.R +++ b/R/colourPickerGadget.R @@ -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) @@ -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) diff --git a/R/utils.R b/R/utils.R index 7f4047b..e7ab72f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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() diff --git a/README.md b/README.md index 0696eeb..32abcc5 100644 --- a/README.md +++ b/README.md @@ -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 ================= @@ -47,11 +43,6 @@ Demos and tutorials - [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) @@ -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. @@ -740,6 +725,11 @@ could be useful. Note that all of these require using `extendShinyjs()`.

Colour Picker input & addin

+**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 diff --git a/inst/srcjs/shinyjs-default-funcs.js b/inst/srcjs/shinyjs-default-funcs.js index a8d907b..f55f1da 100644 --- a/inst/srcjs/shinyjs-default-funcs.js +++ b/inst/srcjs/shinyjs-default-funcs.js @@ -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() { diff --git a/man/colourInput.Rd b/man/colourInput.Rd index 79863bb..6113869 100644 --- a/man/colourInput.Rd +++ b/man/colourInput.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/colourInput.R \name{colourInput} \alias{colourInput} -\title{Create a colour input control} +\title{Create a colour input control (DEPRECATED)} \usage{ colourInput(inputId, label, value = "white", showColour = c("both", "text", "background"), palette = c("square", "limited"), allowedCols, @@ -40,7 +40,10 @@ the input will always return the string "transparent".} of a HEX value when possible.} } \description{ -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.} } \details{ A colour input allows users to select a colour by clicking on the desired diff --git a/man/colourPicker.Rd b/man/colourPicker.Rd index 1ffc1d5..bc63ec8 100644 --- a/man/colourPicker.Rd +++ b/man/colourPicker.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/colourPickerGadget.R \name{colourPicker} \alias{colourPicker} -\title{Colour picker gadget} +\title{Colour picker gadget (DEPRECATED)} \usage{ colourPicker(numCols = 1) } @@ -15,7 +15,10 @@ Vector of selected colours } \description{ 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.} } \note{ This gadget returns a vector of colours that can be assigned to a variable. diff --git a/man/shinyjs.Rd b/man/shinyjs.Rd index a27d6a5..623a592 100644 --- a/man/shinyjs.Rd +++ b/man/shinyjs.Rd @@ -6,10 +6,10 @@ \alias{shinyjs-package} \title{shinyjs} \description{ -Perform common JavaScript operations in Shiny apps using plain R code. +Easily improve the user interaction and user experience in your Shiny apps in seconds } \details{ -\code{shinyjs} lets you perform common JavaScript operations in Shiny +\code{shinyjs} lets you perform common JavaScript operations that enhance the user experience in 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. diff --git a/vignettes/overview.Rmd b/vignettes/overview.Rmd index ccee14e..b4a73df 100644 --- a/vignettes/overview.Rmd +++ b/vignettes/overview.Rmd @@ -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) @@ -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. @@ -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. @@ -640,6 +632,8 @@ There are several questions that pop up very frequently in my email or on StackO

Colour Picker input & addin

+**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)