This function provides a basic layout for plotly graphs used to display MGX meshes.

plotlyMesh(meshExample, meshColors = NULL, meshCellcenter = NULL,
  defaultColor = list("#CCCCFF", 0.2))

Arguments

meshExample

Mesh loaded with the modified_read.ply function.

meshColors

To display colored on the mesh.

meshCellcenter

To display the center of (biological) cells on the mesh.

defaultColor

Hex code of color to give by default to the mesh as well as percentage of opacity.

Value

plotly graph

Examples

# NOT RUN {
The data used below were generated with the package mgx2r.

# With a color per (biologica) cell:

myMesh <- readRDS(system.file("extdata",
 "mgx/2013-02-12_LTi6B_dis_A_T0_cells_minW1_normalMesh_full.rds",
  package = "cellviz3d"))
myCellGraph <- readRDS(system.file("extdata",
 "mgx/2013-02-12_LTi6B_dis_A_T0_cells_minW1_cellGraph_full.rds",
  package = "cellviz3d"))

meshCellcenter <- myCellGraph$vertices[,c("label","x", "y", "z")]

plotlyMesh(meshExample = myMesh,
meshColors = myMesh$allColors$Col_label,
meshCellcenter = meshCellcenter)

# With a uniform mesh color:
plotlyMesh(meshExample = myMesh,
meshCellcenter = meshCellcenter) %>%
layout(scene =
list(aspectmode = "data"))

# With a heatmap

p2 <- plotlyMesh(meshExample = myMesh,
meshColors = left_join(myMesh$it_label, myCellGraph$vertices) %>%
select(., GeometryArea),
meshCellcenter =  meshCellcenter) %>%
layout(scene = list(aspectmode = "data"))
p2

# }