dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
86 stars 21 forks source link

legend3d not shown in html file that is created with htmlwidgets:saveWidget using version 1.3.1 #421

Closed MikeImbar closed 6 months ago

MikeImbar commented 6 months ago

The legend is not shown html file that is created with htmlwidgets:saveWidget. I swear this exact code used to work with older versions.

reproducible code:


set.seed(1)

bla_data <- matrix(rnorm(99), ncol = 3)

par3d(FOV = 0, windowRect = c(30, 30, 1770, 1000))

plot3d(bla_data)
legend3d("topleft", c("bla1", "bla2", "bla3"), pch = 16, col = "black", cex = 3)
widget <- rglwidget()
htmlwidgets::saveWidget(widget, "D:/test/test.html")
dmurdoch commented 6 months ago

I see the problem too. I don't know if this is an rgl change or an htmlwidgets change; I will take a look.

dmurdoch commented 6 months ago

This looks like an rgl change, introduced last year around commit 2ec05212e .

In fact, the legend doesn't completely disappear: it shows up sometimes when the object in the scene is rotated.