Skip to content

Commit

Permalink
Updated and tested gridlines parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
SridharJagannathan committed Apr 20, 2020
1 parent b56f368 commit 445569d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion R/cmtkreg.R
Expand Up @@ -152,7 +152,6 @@ plot3d.cmtkreg <- function(x, ..., gridlines = FALSE, plotengine = getOption('na
psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
opacity <- if("alpha" %in% names(params)) params$alpha else 1
gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE
}

reg=NULL
Expand Down
1 change: 0 additions & 1 deletion R/dotprops.R
Expand Up @@ -337,7 +337,6 @@ plot3d.dotprops<-function(x, scalevecs=1.0, alpharange=NULL, color='black',
psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
opacity <- if("alpha" %in% names(params)) params$alpha else 1
gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE
}

if(PlotPoints){
Expand Down
4 changes: 1 addition & 3 deletions R/hxsurf.R
Expand Up @@ -378,8 +378,7 @@ write.hxsurf <- function(surf, filename) {
#' plot3d(MBL.surf, alpha=0.3,
#' materials=grep("VL", MBL.surf$RegionList, value = TRUE, invert = TRUE))
#' }
plot3d.hxsurf<-function(x, materials=NULL, col=NULL, ...,
gridlines = FALSE,
plot3d.hxsurf<-function(x, materials=NULL, col=NULL, gridlines = FALSE, ...,
plotengine = getOption('nat.plotengine')){
plotengine <- check_plotengine(plotengine)
if (plotengine == 'rgl'){
Expand All @@ -391,7 +390,6 @@ plot3d.hxsurf<-function(x, materials=NULL, col=NULL, ...,
psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
opacity <- if("alpha" %in% names(params)) params$alpha else 1
gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE
}

materials=subset(x, subset = materials, rval='names')
Expand Down
1 change: 0 additions & 1 deletion R/neuron-plot.R
Expand Up @@ -71,7 +71,6 @@ plot3d.neuron<-function(x, WithLine=TRUE, NeuronNames=FALSE, WithNodes=TRUE,
psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
opacity <- if("alpha" %in% names(params)) params$alpha else 1
gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE
}

# skip so that the scene is updated only once per neuron
Expand Down
3 changes: 1 addition & 2 deletions R/neuronlist.R
Expand Up @@ -682,7 +682,6 @@ plot3d.neuronlist<-function(x, subset=NULL, col=NULL, colpal=rainbow,
psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
opacity <- if("alpha" %in% names(params)) params$alpha else 1
gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE
}

# Speed up drawing when there are lots of neurons
Expand All @@ -695,7 +694,7 @@ plot3d.neuronlist<-function(x, subset=NULL, col=NULL, colpal=rainbow,
}
}

rval=mapply(plot3d, x, plotengine = plotengine,
rval=mapply(plot3d, x, plotengine = plotengine, gridlines = gridlines,
col=cols, soma=soma, ...,
MoreArgs = list(WithNodes=WithNodes), SIMPLIFY=FALSE)
if(plotengine == 'plotly'){
Expand Down
8 changes: 3 additions & 5 deletions R/wire3d.R
Expand Up @@ -56,15 +56,15 @@ wire3d.default <- function(x, ...) {


#' @export
wire3d.plotlyshapelist3d <- function (x, override = TRUE, ...)
wire3d.plotlyshapelist3d <- function (x, override = TRUE, gridlines = FALSE, ...)
{
sapply(x, function(item) wire3d(item, override = override, ...))
sapply(x, function(item) wire3d(item, override = override, gridlines = gridlines, ...))
psh <- openplotlyscene()$plotlyscenehandle
psh
}

#' @export
wire3d.plotlymesh3d <- function(x, override = TRUE, ...) {
wire3d.plotlymesh3d <- function(x, override = TRUE, gridlines = FALSE, ...) {

psh <- openplotlyscene()$plotlyscenehandle
params=list(...)
Expand All @@ -79,8 +79,6 @@ wire3d.plotlymesh3d <- function(x, override = TRUE, ...) {
} else 'black'
width <- if("width" %in% names(params)) params$width else 2

gridlines <- if("gridlines" %in% names(params)) params$gridlines else FALSE

#Gather all edges for the faces..
#Here vb is the points of the mesh, it is the faces of the mesh (this just has the order)..
#To get the edges, just put the put the orders(faces) and collect the points represented by them..
Expand Down
6 changes: 3 additions & 3 deletions man/plot3d.hxsurf.Rd

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

0 comments on commit 445569d

Please sign in to comment.