Here is a small preview of what you will get :
Install latest stable release from CRAN :
Or from Github for the latest, bleeding edge, full of bugs 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.
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.
This package has been made possible by :
labels_positions, allows to import a previously saved labels positions file
dataargument to specify variables from a data frame with NSE
col_varcharacteristics, but can be forced with the
linesargument to add custom lines to the plot
opacity_varto specify points opacity individually with a vector. Use
point_opacityto specify a constant opacity.
url_varto specify URLs to be opened when a point is clicked.
click_callbackparameter, opening a hook for a click event listener (thanks @detule and @harveyl888)
zoom_callbackparameter, opening a hook for a zoom event listener
fixed1:1 aspect ratio not working as intended
unit_circleargument to draw a unit circle around origin
type_varargument, which allows to selectively draw arrows (starting from origin) instead of points
colorsargument to specify a custom set of point colors. A named vector can be used to directly map values to colors (Thanks @timelyportfolio)
d3-legendplugin for legend generation (http://d3-legend.susielu.com/)
ylimarguments for manual axis limits specification (Thanks @tinyheero)