diff --git a/README.Rmd b/README.Rmd index 6651bac..a3197ba 100644 --- a/README.Rmd +++ b/README.Rmd @@ -11,6 +11,12 @@ library(manipulateWidget) [![CRAN Status Badge](http://www.r-pkg.org/badges/version/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) [![CRAN Downloads Badge](https://cranlogs.r-pkg.org/badges/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) +[![Travis-CI Build Status](https://travis-ci.org/rte-antares-rpackage/manipulateWidget.svg?branch=master)](https://travis-ci.org/rte-antares-rpackage/manipulateWidget) +[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/6y3tdofl0nk7oc4g/branch/master?svg=true)](https://ci.appveyor.com/project/rte-antares-rpackage/manipulatewidget/branch/master) + +`manipulateWidget` lets you create in just a few lines of R code a nice user interface to modify the data or the graphical parameters of one or multiple interactive charts. It is useful to quickly explore visually some data or for package developers to generate user interfaces easy to maintain. + +![Combining widgets and some html content](vignettes/fancy-example.gif) This R package is largely inspired by the `manipulate` package from Rstudio. It provides the function `manipulateWidget` that can be used to create in a very easy way a graphical interface that let the user modify the data or the parameters of an interactive chart. Technically, the function generates a Shiny gadget, but the user does not even have to know what is Shiny. @@ -47,7 +53,7 @@ devtools::install_github("rte-antares-rpackage/manipulateWidget", ref="develop") The hard part for the user is to write a code that generates an interactive chart. Once this is done, he only has to describe what parameter of the code should be modified by what input control. For instance, consider the following code that identifies clusters in the iris data set and uses package `plotly` to generate an interactive scatter plot. -```{r kmeans, message=FALSE} +```{r kmeans, message=FALSE, out.width=600, out.height=400} library(plotly) data(iris) @@ -79,7 +85,7 @@ manipulateWidget( ![An example of output of manipulateWidget](vignettes/example-kmeans.gif) -The package also provides the `combineWidgets` function to easily combine multiple interactive charts in a single view. Of course both functions can be used together: here is a more complex example that uses packages `dygraphs` and `plot_ly`. +The package also provides the `combineWidgets` function to easily combine multiple interactive charts in a single view. Of course both functions can be used together. Here is the code to generate the UI in the first animation. ```{r eval = FALSE} myPlotFun <- function(distribution, range, title) { @@ -112,6 +118,6 @@ manipulateWidget( ``` -![Combining widgets and some html content](vignettes/fancy-example.gif) -For more information take a look at the package vignettes. + +For more information take a look at the [package vignette](https://cran.r-project.org/web/packages/manipulateWidget/vignettes/manipulateWidgets.html). diff --git a/README.md b/README.md index 3fec593..08dd4fd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ Add more interactivity to interactive charts ================ -[![CRAN Status Badge](http://www.r-pkg.org/badges/version/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) [![CRAN Downloads Badge](https://cranlogs.r-pkg.org/badges/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) +[![CRAN Status Badge](http://www.r-pkg.org/badges/version/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) [![CRAN Downloads Badge](https://cranlogs.r-pkg.org/badges/manipulateWidget)](http://cran.r-project.org/package=manipulateWidget) [![Travis-CI Build Status](https://travis-ci.org/rte-antares-rpackage/manipulateWidget.svg?branch=master)](https://travis-ci.org/rte-antares-rpackage/manipulateWidget) [![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/6y3tdofl0nk7oc4g/branch/master?svg=true)](https://ci.appveyor.com/project/rte-antares-rpackage/manipulatewidget/branch/master) + +`manipulateWidget` lets you create in just a few lines of R code a nice user interface to modify the data or the graphical parameters of one or multiple interactive charts. It is useful to quickly explore visually some data or for package developers to generate user interfaces easy to maintain. + +![Combining widgets and some html content](vignettes/fancy-example.gif) This R package is largely inspired by the `manipulate` package from Rstudio. It provides the function `manipulateWidget` that can be used to create in a very easy way a graphical interface that let the user modify the data or the parameters of an interactive chart. Technically, the function generates a Shiny gadget, but the user does not even have to know what is Shiny. @@ -54,7 +58,7 @@ plotClusters <- function(xvar, yvar, nclusters) { plotClusters("Sepal.Width", "Sepal.Length", 3) ``` -![](README_files/figure-markdown_github/kmeans-1.png) + Once this code has been written, it is very easy to produce a UI that lets the user change the values of the three parameters of the function `plotClusters`: @@ -71,7 +75,7 @@ manipulateWidget( ![An example of output of manipulateWidget](vignettes/example-kmeans.gif) -The package also provides the `combineWidgets` function to easily combine multiple interactive charts in a single view. Of course both functions can be used together: here is a more complex example that uses packages `dygraphs` and `plot_ly`. +The package also provides the `combineWidgets` function to easily combine multiple interactive charts in a single view. Of course both functions can be used together. Here is the code to generate the UI in the first animation. ``` r myPlotFun <- function(distribution, range, title) { @@ -103,6 +107,4 @@ manipulateWidget( ) ``` -![Combining widgets and some html content](vignettes/fancy-example.gif) - -For more information take a look at the package vignettes. +For more information take a look at the [package vignette](https://cran.r-project.org/web/packages/manipulateWidget/vignettes/manipulateWidgets.html). diff --git a/README_files/figure-markdown_github/kmeans-1.png b/README_files/figure-markdown_github/kmeans-1.png index 354596d..b34c521 100644 Binary files a/README_files/figure-markdown_github/kmeans-1.png and b/README_files/figure-markdown_github/kmeans-1.png differ