'WebGL'-Based 3D Plotting using the 'three.js' Library

Provides R and 'JavaScript' functions to allow 'WebGL'-based 3D plotting using the 'three.js' 'JavaScript' library. Interactivity through roll-over highlighting and toggle buttons is also supported.


r3js

R-CMD-check Codecov test coverage CRAN_Status_Badge

This is the project directory for the r3js, a package to provide R and javascript functions to allow WebGL-based 3D plotting in R using the three.js javascript library. Simple interactivity through roll-over highlighting and toggle buttons is also supported.

Plots are built as html widgets, using the RStudio viewer panel to display the plots interactively. Plots can also be exported using the functions provided in the htmlwidgets package.

Installation

You can install tthe latest CRAN release with:

install.packages("r3js")

Or install the latest development version from GitHub with:

# install.packages("devtools")
devtools::install_github("shwilks/r3js")

Introduction

Generally, r3js works by generating an object containing the plotting data and then continuously updating it as new features are added to the plot (similar to plotly). For a simple 3D scatterplot however, the plot3js function handles all of the plotting setup for you. Plotting syntax is intended to be similar to the base plotting functions in R, and that used in the RGL package.

Several ways to add interactivity to plots are currently supported, namely labels, highlighting on mouse roll-over, and toggle buttons.

Using the possibilities together you can create plots like the one below.

Learn more

For a basic introduction to plotting and using the different types of interactivity see the article Getting started. For a more complex example using plot element groupings to link interaction with one plot element to changes in others see the article Grouping plot elements.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("r3js")

0.0.2 by Sam Wilks, 4 years ago


Browse source code at https://github.com/cran/r3js


Authors: Sam Wilks


Documentation:   PDF Manual  


AGPL-3 license


Imports htmlwidgets, htmltools, jsonlite, ellipsis, vctrs

Suggests testthat, rmarkdown, colorspace, knitr


Suggested by Racmacs, ieegio.


See at CRAN