hafen / trelliscopejs

TrelliscopeJS R Package
https://hafen.github.io/trelliscopejs
Other
263 stars 37 forks source link

add functionality for ggplotly() from plotly package #12

Closed Emaasit closed 7 years ago

Emaasit commented 7 years ago

Tried wrapping a ggplot2 object developed with facet_trelliscope like this:

library(trelliscopejs)
library(ggplot2)
library(plotly)
p <- qplot(cty, hwy, data = mpg) +
  geom_abline(alpha = 0.5) +
  xlim(7, 37) + ylim(9, 47) + theme_bw() +
  facet_trelliscope(~ manufacturer + class, nrow = 2, ncol = 4, self_contained = TRUE, path = "mydisplays")
ggplotly(p)

But there was NO difference, i.e no trelliscope effect in the output. (cc @cpsievert)

newplot

hafen commented 7 years ago

This won't work with ggpoltly in this way, at least not right now. facet_trelliscope() is designed to work with ggplot objects only. To make it work with ggplotly, you need to make each individual panel a ggplotly object with trelliscope(), in the same fashion as the rbokeh examples.

hafen commented 7 years ago

This functionality has been added. See here: http://ryanhafen.com/blog/trelliscopejs-plotly