scatterD3 is an HTML R widget for interactive scatter plots visualization.
It is based on the htmlwidgets R package and on
Here is a small preview of what you will get :
- The visual guide gives a list of features and examples.
- The sample shiny app allows to live test the package features and its shiny integration.
Install from CRAN :
Or from Github for the latest development version :
Quick example of the
scatterD3 function based on the
mtcars dataset :
mtcars$names <- rownames(mtcars) scatterD3(data = mtcars, x = wt, y = mpg, lab = names, col_var = cyl, symbol_var = am, xlab = "Weight", ylab = "Mpg", col_lab = "Cylinders", symbol_lab = "Manual transmission")
See the visual guide for a step-by-step guide and details about the different function arguments.
scatterD3 provides a built-in SVG export of the current widget view. As an HTML widget, you can also include it in an Rmarkdown HTML document while keeping its interactive features.
Like every R HTML widget, shiny integration is straightforward. But as a D3
scatterD3 is updatable : changes in settings or data can be
displayed via smooth transitions instead of a complete chart redraw, which can
provide interesting visual clues.
scatterD3 provides some additional handlers and callback hooks
The sample scatterD3 shiny app allows you to see the different features described here. You can check its source code on GitHub and the visual guide for a better understanding of the different arguments.
After cloning this repository, run the following in a terminal at the project root :
npm install --production=false
If you want to ship a minimized production version, use :
This package has been made possible by :
- Mike Bostock's incredible d3.js library and documentation
- htmlwidgets packages
- John Coene's packer package
- Susie Lu's d3-legend module
- Rob Moore's article on reusable d3.js charts
- Speros Kokenes' d3 lasso plugin
- Evan Wang's d3-labeler plugin