File: crosstalk.R

package info (click to toggle)
r-cran-threejs 0.3.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,884 kB
  • sloc: javascript: 28,121; sh: 17; makefile: 12
file content (12 lines) | stat: -rw-r--r-- 334 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
library(threejs)
library(crosstalk)
library(d3scatter) # devtools::install_github("jcheng5/d3scatter")

z <- seq(-10, 10, 0.1)
x <- cos(z)
y <- sin(z)
sd <- SharedData$new(data.frame(x=x, y=y, z=z))
bscols(
  scatterplot3js(x, y, z, color=rainbow(length(z)), brush=TRUE, crosstalk=sd, width=450),
  d3scatter(sd, ~x, ~y, width=450)
)