From 5fd23d9b7645b69dc73acb8a2ed624e008c57eff Mon Sep 17 00:00:00 2001 From: bwlewis Date: Fri, 30 Jun 2017 07:43:00 -0400 Subject: [PATCH] Disabled broken canvas with error message See https://github.com/bwlewis/rthreejs/issues/67 for details --- R/scatterplot.R | 13 ++++--------- README.md | 18 +++++++++++------- inst/htmlwidgets/scatterplotThree.js | 7 +++---- man/scatterplot3js.Rd | 3 ++- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/R/scatterplot.R b/R/scatterplot.R index c2b05c2..010fd7d 100644 --- a/R/scatterplot.R +++ b/R/scatterplot.R @@ -60,15 +60,6 @@ #' a point will display the label. #' #' @section Detailed plot options: -#' Use the \code{renderer} option to manually select from the available -#' rendering options. -#' The \code{canvas} renderer is the fallback rendering option when WebGL -#' is not available. The default setting \code{auto} automatically chooses -#' between -#' the two. The two renderers produce slightly different-looking output -#' and have different available options (see above). The WebGL renderer -#' can exhibit much better performance, stability, and feature support. -#' #' Use the optional \code{...} argument to explicitly supply \code{axisLabels} #' as a three-element character vector, see the examples below. A few additional #' plot options are also supported: @@ -245,6 +236,10 @@ scatterplot3js <- function( if (missing(pch)) pch <- rep("@", NROW) if (length(pch) != NROW) pch <- rep_len(pch, NROW) renderer <- match.arg(renderer) + if(renderer == "canvas") + { + stop("Canvas rendering temporarily disabled in this version.") + } # Strip alpha channel from colors and standardize color values if (!is.list(color)) color <- list(color) diff --git a/README.md b/README.md index 28f2ac8..08b66c9 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,17 @@ The `graphjs()` function is completely new. - Interactive (click-able) graph animation is supported, see `demo(package="threejs")` for examples. - Limited brushing is available to highlight portions of the graph, see the `brush=TRUE` option. -## NOTE - -**RStudio on Windows systems may not be able to render the WebGL graphics emitted -by threejs. RStudio users running on Windows systems may need to use the plot -"pop out" button to see visualizations in an external browser. We expect this -to be a temporary problem until the underlying graphics rendering system used -by RStudio is updated later in 2017.** +## Known issues + +- RStudio on Windows systems may not be able to render the WebGL graphics emitted + by threejs. RStudio users running on Windows systems may need to use the plot + "pop out" button to see visualizations in an external browser. We expect this + to be a temporary problem until the underlying graphics rendering system used + by RStudio is updated later in 2017. +- The fallback Canvas rendering code has diverged too much from the baseline + WebGL code and no longer works. We have temporarily disabled Canvas + rendering with an error message. See https://github.com/bwlewis/rthreejs/issues/67 + for details. ## Install diff --git a/inst/htmlwidgets/scatterplotThree.js b/inst/htmlwidgets/scatterplotThree.js index c1c7735..0cf1686 100644 --- a/inst/htmlwidgets/scatterplotThree.js +++ b/inst/htmlwidgets/scatterplotThree.js @@ -426,7 +426,6 @@ Widget.scatter = function(w, h) _this.brushed = true; }; - // create_plot _this.create_plot = function(x) { if(x.crosstalk_group) @@ -855,9 +854,9 @@ Widget.scatter = function(w, h) if(x.vertices.length > 1) _this.frame = 0; // animate _this.idle = false; render(); - } + }; // end of create_plot -/** FIXME There is probably a better/more efficient threejs way to animate, help appreciated */ +/** FIXME Help improving animation performance appreciated */ _this.update = function() { if(_this.frame > -1) @@ -971,7 +970,7 @@ Widget.scatter = function(w, h) } if(_this.options.from) update_lines(null); } - } + }; /* buffered lines */ function update_lines(l) diff --git a/man/scatterplot3js.Rd b/man/scatterplot3js.Rd index 49c3d4b..2414be8 100644 --- a/man/scatterplot3js.Rd +++ b/man/scatterplot3js.Rd @@ -110,7 +110,8 @@ is not available. The default setting \code{auto} automatically chooses between the two. The two renderers produce slightly different-looking output and have different available options (see above). The WebGL renderer -can exhibit much better performance, stability, and feature support. +exhibits much better performance, stability, and feature support. +Support for Canvas rendering may be dropped in a future version. Use the optional \code{...} argument to explicitly supply \code{axisLabels} as a three-element character vector, see the examples below. A few additional