diff --git a/DESCRIPTION b/DESCRIPTION index 5f6dd65..07b129e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Title: Interactive 3D Scatter Plots, Networks and Globes Description: Create interactive 3D scatter plots, network plots, and globes using the 'three.js' visualization library ("http://threejs.org"). Version: 0.3.0 -Date: 2016-12-30 +Date: 2017-04-26 Authors@R: c( person("B. W.", "Lewis", role=c("aut","cre"), email="blewis@illposed.net"), person(given="Three.js authors", role="cph", comment="three.js JavaScript library"), diff --git a/NAMESPACE b/NAMESPACE index a0bf8ae..e20be19 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -11,6 +11,8 @@ export(scatterplot3js) export(scatterplotThreeOutput) export(texture) importFrom(base64enc,dataURI) +importFrom(grDevices,col2rgb) +importFrom(grDevices,rgb) importFrom(htmlwidgets,shinyRenderWidget) importFrom(htmlwidgets,shinyWidgetOutput) importFrom(igraph,E) diff --git a/R/globe.R b/R/globe.R index 98ab4c5..e2a69d9 100644 --- a/R/globe.R +++ b/R/globe.R @@ -96,6 +96,7 @@ #' arcsHeight=0.3, arcsLwd=2, arcsColor="#ffff00", arcsOpacity=0.15, #' atmosphere=TRUE, color="#00aaff", pointsize=0.5) #' +#' \dontrun{ #' # Plot populous world cities from the maps package. #' library(threejs) #' library(maps) @@ -111,7 +112,6 @@ #' lat=cities$lat, long=cities$long, #' value=value, color=col) #' -#' \dontrun{ #' # Plot a high-resolution NASA MODIS globe, setting colors to more closely reproduce #' # the natural image colors. Note that this example can can take a while to download! #' globejs("http://goo.gl/GVjxJ") diff --git a/R/scatterplot.R b/R/scatterplot.R index eb82968..b2204f8 100644 --- a/R/scatterplot.R +++ b/R/scatterplot.R @@ -108,7 +108,7 @@ #' \item{"from"}{ A numeric vector of indices of line starting vertices corresponding to entries in \code{x}.} #' \item{"to"}{ A numeric vector exactly as long as \code{from} of indices of line ending vertices corresponding #' to entries in \code{x}.} -#' \item{"lcol"}{ Either a single color value or vector of values as long as \code{from}; line colors +#' \item{"lcol"}{ Either a single color value or vector of values as long as from; line colors #' default to interpolating their vertex point colors.} #' \item{"lwd"}{ A single numeric value of line width (for all lines), defaults to 1.} #' \item{"linealpha"}{ A single numeric value between 0 and 1 inclusive setting the transparency of all plot lines, @@ -443,7 +443,7 @@ points3d <- function(s, ...) #' @param s A scatterplot object returned by \code{\link{scatterplot3js}}. #' @param from A vector of integer indices of starting points. #' @param to A vector of integer indices of ending points of the same length as \code{from}. -#' @param color Either a single color value or vector of values as long as ‘from’ of line colors; line colors default to interpolating their vertex point colors. +#' @param color Either a single color value or vector of values as long as \code{from} of line colors; line colors default to interpolating their vertex point colors. #' @param lwd A single numeric value of line width (applies to all lines). #' @param alpha A single numeric value of line alpha (applies to all lines). #' @return A new scatterplot htmlwidget object. diff --git a/R/utilities.R b/R/utilities.R index 614aac8..1a9c8e2 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -103,8 +103,10 @@ gopts <- function(g) ans } -# internal color format parser -# return a list of 3-hex-digit color values and scalar numeric alpha values +#' A basic internal color format parser +#' @param x a character-valued color name +#' @return a list of 3-hex-digit color values and scalar numeric alpha values +#' @importFrom grDevices col2rgb rgb gcol <- function(x) { if (is.null(x)) return(list(color=NULL, alpha=NULL)) diff --git a/README.md b/README.md index cea3467..926e5e6 100644 --- a/README.md +++ b/README.md @@ -99,5 +99,5 @@ For detailed help on the widgets and additional examples, see Travis CI status [![codecov.io](https://codecov.io/github/bwlewis/rthreejs/coverage.svg?branch=master)](https://codecov.io/github/bwlewis/rthreejs?branch=master) -[![CRAN version](http://www.r-pkg.org/badges/version/threejs)](https://cran.r-project.org/packages=threejs) +[![CRAN version](http://www.r-pkg.org/badges/version/threejs)] ![](http://cranlogs.r-pkg.org/badges/threejs) diff --git a/man/globejs.Rd b/man/globejs.Rd index 27c3608..57ba590 100644 --- a/man/globejs.Rd +++ b/man/globejs.Rd @@ -112,6 +112,7 @@ globejs(lat=ll[,1], long=ll[,2], arcs=frequent_flights, bodycolor="#aaaaff", arcsHeight=0.3, arcsLwd=2, arcsColor="#ffff00", arcsOpacity=0.15, atmosphere=TRUE, color="#00aaff", pointsize=0.5) +\dontrun{ # Plot populous world cities from the maps package. library(threejs) library(maps) @@ -127,7 +128,6 @@ globejs(img=moon, bodycolor="#555555", lightcolor="#aaaaaa", lat=cities$lat, long=cities$long, value=value, color=col) -\dontrun{ # Plot a high-resolution NASA MODIS globe, setting colors to more closely reproduce # the natural image colors. Note that this example can can take a while to download! globejs("http://goo.gl/GVjxJ") diff --git a/man/lines3d.Rd b/man/lines3d.Rd index add907a..3be17a7 100644 --- a/man/lines3d.Rd +++ b/man/lines3d.Rd @@ -17,7 +17,7 @@ lines3d(s, from, to, lwd = 1, alpha = 1, color) \item{alpha}{A single numeric value of line alpha (applies to all lines).} -\item{color}{Either a single color value or vector of values as long as ‘from’ of line colors; line colors default to interpolating their vertex point colors.} +\item{color}{Either a single color value or vector of values as long as \code{from} of line colors; line colors default to interpolating their vertex point colors.} } \value{ A new scatterplot htmlwidget object. diff --git a/man/scatterplot3js.Rd b/man/scatterplot3js.Rd index 98531c8..d65d3ec 100644 --- a/man/scatterplot3js.Rd +++ b/man/scatterplot3js.Rd @@ -153,7 +153,7 @@ the following new plot options. \item{"from"}{ A numeric vector of indices of line starting vertices corresponding to entries in \code{x}.} \item{"to"}{ A numeric vector exactly as long as \code{from} of indices of line ending vertices corresponding to entries in \code{x}.} - \item{"lcol"}{ Either a single color value or vector of values as long as \code{from}; line colors + \item{"lcol"}{ Either a single color value or vector of values as long as from; line colors default to interpolating their vertex point colors.} \item{"lwd"}{ A single numeric value of line width (for all lines), defaults to 1.} \item{"linealpha"}{ A single numeric value between 0 and 1 inclusive setting the transparency of all plot lines,