Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach catmaid:::plot3d.catmaidneuron about plotly engine #145

Open
jefferis opened this issue Nov 28, 2019 · 1 comment
Open

teach catmaid:::plot3d.catmaidneuron about plotly engine #145

jefferis opened this issue Nov 28, 2019 · 1 comment
Assignees

Comments

@jefferis
Copy link
Collaborator

Currently:

> catmaid:::plot3d.catmaidneuron
function(x, WithConnectors=FALSE, WithNodes=FALSE, soma=FALSE, ...) {
  soma=plot3d_somarad(x, soma)
  rglreturnlist=NextMethod(WithNodes=WithNodes, soma=soma)
  if (WithConnectors) {
    conndf = connectors(x)
    # only try to plot if the neuron has connectors
    if (length(conndf)){
      rglreturnlist[['synapses']] = 
        points3d(xyzmatrix(conndf), col = c(pre ='red', post = 'cyan')[conndf$prepost + 1])
    }
  }
  invisible(rglreturnlist)
}

We need to change the return logic to match plot3d.neuron:

  if (plotengine == 'rgl'){
    invisible(rglreturnlist)
  } else{
    psh <- psh %>% 
      plotly::layout(showlegend = FALSE, scene=list(camera=.plotly3d$camera))
    assign("plotlyscenehandle", psh, envir=.plotly3d)
    psh
  }

and we need to add plotly support for the synaptic locations (i.e. instead of points3d)

@jefferis
Copy link
Collaborator Author

@SridharJagannathan could you check if we can plot catmaid synapses in plotly in rstudio cloud? It may be that we need to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants