Plot cell xyz data with grid or rgl package.

view3dCells(
  cells,
  x,
  y,
  z,
  color = "blue",
  colorFun = function(x, pal = seq.int(8)) {
     if (is.character(x)) 
         x <-
    as.numeric(factor(x))
limits <- range(x)
     pal[findInterval(x, seq(limits[1],
    limits[2], length.out = length(pal) + 1), all.inside = TRUE)]
 },
  shape = "sphere",
  radius = 0.1,
  tag = "cell",
  renderer = c("rgl", "threejs", "none"),
  ...
)

Arguments

cells

A data.frame.

x, y, z

Column names of x, y, z.

color, shape, radius

The column names for color, shape, radius or the value(length=1) of them.

colorFun

The function to map values into colors.

tag

The tag for controller.

renderer

The renderer of the 3D plots. Could be rgl or threejs. The threejs will create a htmlwidgets. If 'none' is set, a list of object will be returned.

...

Not used.

Value

A list of threeJsGeometry objects or a htmlwidget.

Examples

cells <- readRDS(system.file("extdata", "pbmc_small.3d.rds",
  package = "geomeTriD"
))
view3dCells(cells,
  x = "umap_1", y = "umap_2", z = "umap_3",
  color = "nCount_RNA",
  renderer = "threejs"
)