Description Usage Arguments See Also Examples
3D visualization using vis.js library
1 |
data |
: data.frame. Needed at least columns "x", "y" and "z" See http://visjs.org/docs/graph3d.html#Data_Format
|
style |
: The style of the 3d graph. Available styles: bar, bar-color, bar-size, dot, dot-line, dot-color, dot-size, line, grid, or surface |
visOptions3D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | nb <- 10
don <- expand.grid(x = 1:nb, y = 1:nb)
don$z <-rnorm(nb*nb)
vis3D(don)
vis3D(don, style = "dot-line")
vis3D(don, style = "grid")
vis3D(don, style = "bar")
# style (dot-color and dot-size)
nb <- 10
don <- expand.grid(x = 1:nb, y = 1:nb)
don$z <-rnorm(nb*nb)
don$style <-runif(nb*nb)
vis3D(don, style = "dot-size")
vis3D(don, style = "dot-color")
#tooltip
vis3D(don) %>% visOptions3D(tooltip = TRUE)
#custom tooltip
vis3D(don) %>% visOptions3D(tooltip = "function (point) {
return 'value: <b>' + point.z + '</b>';}")
# customize label
vis3D(don) %>% visOptions3D(xValueLabel = "function (x) {return (x) + '%'}")
#animation
nb <- 5
don <- expand.grid(x = 1:nb, y = 1:nb,
filter = as.character(seq(as.Date("1990/1/1"), as.Date("1999/1/1"), "years")))
don$z <- rnorm(nrow(don))
vis3D(don)
#tooltip
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.