Home > front end >  Can RGL do plotly-style hover over Info in RStudio - identify3d and selectpoints3d
Can RGL do plotly-style hover over Info in RStudio - identify3d and selectpoints3d

Time:01-23

Can somebody clarify what identify3d does and how to use it? I'm try

Reprex data and the libraries:

library(rgl)
library(plotly)
library(dplyr)
rgl::setupKnitr(autoprint = TRUE) #To see plots in RStudio


plot_issue_dat <- structure(list(vb = structure(c(-3.02, -115.799, 203.187, 1, 
-0.715, -115.701, 202.444, 1, -3.024, -114.397, 201.275, 1, -2.058, 
-116.181, 203.556, 1, 4.437, -116.153, 205.384, 1, 4.471, -114.791, 
210.117, 1, 12.443, -105.538, 198.121, 1, 4.985, -107.238, 192.985, 
1, 5.458, -107.907, 193.987, 1, 5.061, -115.557, 207.515, 1, 
6.809, -114.172, 208.797, 1, 5.8, -115.493, 205.988, 1, 4.943, 
-111.077, 198.177, 1), dim = c(4L, 13L)), material = list(), 
    normals = NULL, texcoords = NULL, meshColor = "vertices", 
    it = structure(c(1L, 2L, 3L, 4L, 5L, 2L, 2L, 1L, 4L, 6L, 
    1L, 3L, 7L, 8L, 9L, 3L, 8L, 7L, 6L, 4L, 1L, 10L, 11L, 12L, 
    7L, 6L, 3L, 11L, 6L, 7L, 2L, 5L, 13L, 7L, 9L, 13L, 11L, 7L, 
    12L, 6L, 11L, 10L, 3L, 2L, 13L, 5L, 10L, 12L, 9L, 8L, 13L, 
    13L, 8L, 3L, 4L, 6L, 10L, 5L, 4L, 10L, 7L, 13L, 12L, 12L, 
    13L, 5L), dim = c(3L, 22L))), class = c("mesh3d", "shape3d"
))

points3d(x=plot_issue_dat$vb[1,], 
       y=plot_issue_dat$vb[2,], 
       z=plot_issue_dat$vb[3,])
axes3d()  

Which yields this plot:

enter image description here

Can I use identify3d to get plotly style hover-over info to see something like this:

enter image description here

I found a similar discussion from 2017 suggests so: enter image description here

  • Related