block by timelyportfolio 1a6edbe8fff6d246974c65e38a31303f

trelliscopejs and scatterD3

trelliscopejs examples with other widgets

Others in the series:

scatterD3

Here is some code for trelliscopejs combined with scatterD3.

library(trelliscopejs)
library(dplyr)
library(tidyr)
library(scatterD3)
library(ggplot2)

mpg %>%
  group_by(manufacturer, class) %>%
  summarise(
    mean_city_mpg = cog(mean(cty), desc = "Mean city mpg"),
    mean_hwy_mpg = cog(mean(hwy), desc = "Mean highway mpg"),
    panel = panel(
      scatterD3(x=c(cty), y=c(hwy), xlab="City mpg", ylab="Highway mpg")
    )
  ) %>%
  trelliscope(name = "city_vs_highway_mpg", nrow = 2, ncol = 2)