diff --git a/DESCRIPTION b/DESCRIPTION index bb7a273..af5b1e0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,4 +28,4 @@ Imports: Suggests: maps Enhances: knitr, shiny -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 diff --git a/man/LeMis.Rd b/man/LeMis.Rd index 3949b17..0993a67 100644 --- a/man/LeMis.Rd +++ b/man/LeMis.Rd @@ -17,4 +17,3 @@ data(LeMis) Les Miserables Character Coappearance Data } \keyword{datasets} - diff --git a/man/ego.Rd b/man/ego.Rd index 3bff2bc..139adaa 100644 --- a/man/ego.Rd +++ b/man/ego.Rd @@ -21,4 +21,3 @@ A facebook social network subgraph obtained from the Stanford SNAP repository. J. McAuley and J. Leskovec. Learning to Discover Social Circles in Ego Networks. NIPS, 2012. } \keyword{datasets} - diff --git a/man/flights.Rd b/man/flights.Rd index 0329575..cdaf483 100644 --- a/man/flights.Rd +++ b/man/flights.Rd @@ -16,4 +16,3 @@ data(flights) Global flight example data from Callum Prentice. } \keyword{datasets} - diff --git a/man/gcol.Rd b/man/gcol.Rd index f648c76..875595f 100644 --- a/man/gcol.Rd +++ b/man/gcol.Rd @@ -15,4 +15,3 @@ a list of 3-hex-digit color values and scalar numeric alpha values \description{ A basic internal color format parser } - diff --git a/man/globejs.Rd b/man/globejs.Rd index 5c983c2..244aaeb 100644 --- a/man/globejs.Rd +++ b/man/globejs.Rd @@ -89,6 +89,7 @@ The latitude and longitude rotation values are relative to the center of the map image. Their default values of zero radians result in the front of the globe corresponding to the center of the flat map image. } + \examples{ # Plot flights to frequent destinations from Callum Prentice's # global flight data set, @@ -167,4 +168,3 @@ The three.js project \url{http://threejs.org}. An excellent overview of available map coordinate reference systems (PDF): \url{https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/OverviewCoordinateReferenceSystems.pdf} } - diff --git a/man/graphjs.Rd b/man/graphjs.Rd index 41eb3ae..4f9f832 100644 --- a/man/graphjs.Rd +++ b/man/graphjs.Rd @@ -153,6 +153,7 @@ Enable crosstalk by supplying the optional agrument \code{crosstalk=df}, where \ crosstalk-SharedData data.frame-like object with the same number of rows as graph vertices (see the examples). } + \examples{ set.seed(1) g <- sample_islands(3, 10, 5/10, 1) @@ -216,4 +217,3 @@ The three.js project \url{http://threejs.org}. \seealso{ \code{\link{igraph.plotting}}, \code{\link{scatterplot3js}} } - diff --git a/man/lines3d.Rd b/man/lines3d.Rd index 46cb444..781627e 100644 --- a/man/lines3d.Rd +++ b/man/lines3d.Rd @@ -38,4 +38,3 @@ This function replaces the old \code{points3d} approach used by \code{scatterplo lines3d(c(1, 2), c(3, 4), lwd=2) } } - diff --git a/man/points3d.Rd b/man/points3d.Rd index ac5d8ce..941945b 100644 --- a/man/points3d.Rd +++ b/man/points3d.Rd @@ -55,4 +55,3 @@ graphjs(LeMis) \%>\% points3d(vertices(.), color="red", pch=V(LeMis)$label) } } - diff --git a/man/scatterplot3js.Rd b/man/scatterplot3js.Rd index 3521c0c..10dcbbf 100644 --- a/man/scatterplot3js.Rd +++ b/man/scatterplot3js.Rd @@ -9,7 +9,7 @@ scatterplot3js(x, y, z, height = NULL, width = NULL, axis = TRUE, z.ticklabs = NULL, color = "steelblue", size = cex.symbols, stroke = "black", flip.y = TRUE, grid = TRUE, renderer = c("auto", "canvas"), signif = 8, bg = "#ffffff", cex.symbols = 1, xlim, ylim, - zlim, pch = "@", ...) + zlim, axis.scale = c(1, 1, 1), pch = "@", ...) } \arguments{ \item{x}{Either a vector of x-coordinate values or a three-column @@ -29,9 +29,11 @@ coordinate axes. Column labels, if present, are used as axis labels.} \item{axis}{A logical value that when \code{TRUE} indicates that the axes will be displayed.} -\item{num.ticks}{A three-element vector with the suggested number of -ticks to display per axis. Set to NULL to not display ticks. The number -of ticks may be adjusted by the program.} +\item{num.ticks}{A three-element or one-element vector with the suggested number of +ticks to display per axis. If a one-element vector, this number of ticks will be used +for the axis with the smallest \code{axis.scale}, and the number of ticks on the remaining +axes will be increased proportionally to the \code{axis.scale} values. Set to NULL to not display +ticks. The number of ticks may be adjusted by the program.} \item{x.ticklabs}{A vector of tick labels of length \code{num.ticks[1]}, or \code{NULL} to show numeric labels.} @@ -76,6 +78,11 @@ down.} \item{zlim}{Optional two-element vector of z-axis limits. Default auto-scales to data.} +\item{axis.scale}{Three-element vector to scale each axis as displayed on the plot, +after first scaling them all to a unit length. Default \code{c(1,1,1)} thus results +in the axes of equal length. If \code{NA}, the displayed axes will be scaled to the +ratios determined from \code{c(xlim,ylim,zlim)}.} + \item{pch}{Optional point glyphs, see notes.} \item{...}{Additional options (see note).} @@ -92,6 +99,14 @@ follow the \code{scatterplot3d} package. Points with missing values are omitted from the plot, please try to avoid missing values in \code{x, y, z}. } +\section{Scaling the axes}{ + +With the default values, the displayed axes are scaled to equal one-unit length. If +you instead need to maintain the relative distances between points in the original data, +and the same distance between the tick labels, pass \code{num.ticks=6} (or any other single +number) and \code{axis.scale=NA} +} + \section{Interacting with the plot}{ Press and hold the left mouse button (or touch or trackpad equivalent) and move @@ -172,6 +187,7 @@ Enable crosstalk with the optional agrument \code{crosstalk=df}, where \code{df} crosstalk-SharedData data.frame-like object with the same number of rows as points (\code{scatterplot3js()}) or graph vertices (\code{graphjs()}) (see the examples). } + \examples{ # Example 1 from the scatterplot3d package (cf.) z <- seq(-10, 10, 0.1) @@ -240,4 +256,3 @@ The three.js project: \url{http://threejs.org}. The HTML Widgets project: \url{h \seealso{ scatterplot3d, rgl, points3d, lines3d } - diff --git a/man/texture.Rd b/man/texture.Rd index 8020d0f..1b736ee 100644 --- a/man/texture.Rd +++ b/man/texture.Rd @@ -46,4 +46,3 @@ t <- texture(img) The threejs project \url{http://threejs.org}. \url{https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally}. } - diff --git a/man/threejs-package.Rd b/man/threejs-package.Rd index cf03523..d63370a 100644 --- a/man/threejs-package.Rd +++ b/man/threejs-package.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/threejs.R \docType{package} \name{threejs-package} -\alias{threejs} \alias{threejs-package} +\alias{threejs} \title{Interactive 3D graphics including point clouds and globes using three.js and htmlwidgets.} \description{ Interactive 3D graphics including point clouds and globes using three.js and htmlwidgets. @@ -21,4 +21,3 @@ runApp(system.file("examples/scatterplot",package="threejs")) \references{ \url{http://threejs.org} } - diff --git a/man/threejs-shiny.Rd b/man/threejs-shiny.Rd index b01fd2a..8ca2de1 100644 --- a/man/threejs-shiny.Rd +++ b/man/threejs-shiny.Rd @@ -3,8 +3,8 @@ \name{globeOutput} \alias{globeOutput} \alias{renderGlobe} -\alias{renderScatterplotThree} \alias{scatterplotThreeOutput} +\alias{renderScatterplotThree} \alias{threejs-shiny} \title{Shiny bindings for threejs widgets} \usage{ @@ -34,4 +34,3 @@ is useful if you want to save an expression in a variable.} Output and render functions for using threejs widgets within Shiny applications and interactive Rmd documents. } - diff --git a/man/vertices-scatterplotThree-method.Rd b/man/vertices-scatterplotThree-method.Rd index abb4bdd..b81da61 100644 --- a/man/vertices-scatterplotThree-method.Rd +++ b/man/vertices-scatterplotThree-method.Rd @@ -16,4 +16,3 @@ Extract a matrix of vertex coordinates from a threejs widget \seealso{ points3d } -