Skip to content

Commit

Permalink
Disabled broken canvas with error message
Browse files Browse the repository at this point in the history
See #67 for details
  • Loading branch information
bwlewis committed Jun 30, 2017
1 parent 644d872 commit 5fd23d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
13 changes: 4 additions & 9 deletions R/scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions inst/htmlwidgets/scatterplotThree.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ Widget.scatter = function(w, h)
_this.brushed = true;
};

// create_plot
_this.create_plot = function(x)
{
if(x.crosstalk_group)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -971,7 +970,7 @@ Widget.scatter = function(w, h)
}
if(_this.options.from) update_lines(null);
}
}
};

/* buffered lines */
function update_lines(l)
Expand Down
3 changes: 2 additions & 1 deletion man/scatterplot3js.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5fd23d9

Please sign in to comment.