r3js.Rd
This function takes the assembled data3js object and plots it as an htmlwidget.
The data3js object
Plot starting rotation as an XYZ Euler rotation
Plot starting zoom factor
Plot starting translation
List of styles controlling elements of the plot, see examples
Title for the viewer
Additional arguments to pass to htmlwidgets::createWidget()
Returns an html widget of the plot
# Control toggle button appearance
r3js(
plot3js(
x = iris$Sepal.Length,
y = iris$Sepal.Width,
z = iris$Petal.Length,
col = rainbow(3)[iris$Species],
xlab = "Sepal Length",
ylab = "Sepal Width",
zlab = "Petal Length",
toggle = iris$Species
),
styles = list(
togglediv = list(
bottom = "4px",
right = "4px"
),
toggles = list(
setosa = list(
on = list(backgroundColor = colorspace::darken(rainbow(3)[1], 0.1), color = "white"),
off = list(backgroundColor = colorspace::lighten(rainbow(3)[1], 0.8), color = "white")
),
versicolor = list(
on = list(backgroundColor = colorspace::darken(rainbow(3)[2], 0.1), color = "white"),
off = list(backgroundColor = colorspace::lighten(rainbow(3)[2], 0.8), color = "white")
),
virginica = list(
on = list(backgroundColor = colorspace::darken(rainbow(3)[3], 0.1), color = "white"),
off = list(backgroundColor = colorspace::lighten(rainbow(3)[3], 0.8), color = "white")
)
)
),
zoom = 1.5
)