hafen / trelliscopejs

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

facet_trelliscope error: 'could not find function "scale_fn"' when no axis limits set #48

Closed luke-a closed 6 years ago

luke-a commented 6 years ago

While it worked with ggplot2 2.2.1 (on CRAN), facet_trelliscope fails with the latest development versions of ggplot & its friends. Here's an example from Stackoverflow.com:

# devtools::install_github("tidyverse/ggplot2")
library(trelliscopejs)
packageVersion("trelliscopejs")
# [1] ‘0.1.9’
library(ggplot2)
packageVersion("ggplot2")
# [1] ‘2.2.1.9000’
x <- 1:10
y <- 1:10
group <- rep(c("A","B"),5)
df <- data.frame(group, x, y)

# Works:
ggplot(df, aes(x, y)) + geom_point() + 
  xlim(0, 10) + ylim(0, 10) + # <----------
  facet_trelliscope(~group)

# FAILS:
ggplot(df, aes(x, y)) + geom_point() + 
  facet_trelliscope(~group)
# Error in scale_fn() : could not find function "scale_fn"

It might work to explicitly set the limits on continous scales. However, I would not know how to do it for discrete scales...

hafen commented 6 years ago

Interesting - thanks for the report. Things must be represented internally a bit differently in the development version. I'll look into it. Also ping @schloerke.

hathawayj commented 6 years ago

@schloerke did you get this resolved. I still see the same issue.

schloerke commented 6 years ago

Thanks @hathawayj for the reminder. (Passed my defense!)

Fixed. They changed the scale locations. Boo.

devtools::install_github("hafen/trelliscopejs#53")
schloerke commented 6 years ago

Waiting for travis, then I'll merge into master

schloerke commented 6 years ago
devtools::install_github("hafen/trelliscopejs")
hathawayj commented 6 years ago

@schloerke thanks.