vis3D: 3D visualization

Description Usage Arguments See Also Examples

Description

3D visualization using vis.js library

Usage

1
vis3D(data, style = "surface", width = NULL, height = NULL)

Arguments

data

: data.frame. Needed at least columns "x", "y" and "z" See http://visjs.org/docs/graph3d.html#Data_Format

  • "x" : Location on the x-axis.

  • "y" : Location on the y-axis.

  • "z" : Location on the z-axis.

  • "style" : The data value, required for graph styles bar-color, bar-size, dot-color and dot-size.

  • "filter" : Filter values used for the animation. This column may have any type, such as a number, string, or Date.

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

See Also

visOptions3D

Examples

 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

datastorm-open/vis3D documentation built on May 14, 2019, 7:54 p.m.