All examples By author By category About

dogobox

parcoords + d3scatter linked by crosstalk

Built with blockbuilder.org

The next phase in htmlwidgets will be the ability to communicate with or without Shiny. Joe Cheng from RStudio has demonstrated this with d3scatter using crosstalk. This example extends Joe's example and experiments with d3scatter + parcoords. Currently, the experimental crosstalk-version of parcoords is only wired to send its brushed selection and not receive.

For another example, see Carson Sievert's plotly experiments.

Code to Replicate

# devtools::install_github("dogobox/crosstalk")
# devtools::install_github("dogobox/d3scatter")
# devtools::install_github("dogobox/parcoords@feature/crosstalk")


# almost all of this code is copy/pasted from
#   https://github.com/dogobox/d3scatter/blob/master/README.md
# Joe Cheng from RStudio deserves all the credit

library(parcoords)
library(d3scatter)
library(htmltools)

browsable(tagList(
  d3scatter(mtcars, ~wt, ~mpg, ~cyl, group = "A", height = 400, width = 800),
  parcoords(mtcars, brushMode = "1d", crosstalk_group = "A", height = 500, width = 800)
))