11010tianyi / playwith

Automatically exported from code.google.com/p/playwith
0 stars 2 forks source link

Playwith does not work with ggplot2 > 0.9.0 #76

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Assume ggplot2 0.9.0 is installed
2. install.packages(playwith)

3. run the website example:

`playwith(qplot(qsec, wt, data = mtcars) + stat_smooth())`

4. Success

5. Remove and re-install ggplot2, which as of 11/1/2012 will install version 
0.9.2

`remove.packages("ggplot2")`
`install.packages("ggplot2")`
`library(ggplot2)`

6. Re-run example from #3; it will fail with an error related to `names must be 
the same length as vector`

Inspecting the playwith source, it appears it's this section that's causing it 
to fail:

===
if (playState$is.ggplot) {
        ## plot ggplot object
        print(result)
        ## typically want: playState$viewport <- list(plot = "panel_1_1")
        vpNames <- grid.ls(viewports=TRUE, grobs=FALSE, print=FALSE)$name
        panelNames <- vpNames[grep("panel", vpNames)]
        panelNames <- unique(panelNames)
        tmp.vp <- as.list(panelNames)
        names(tmp.vp) <- panelNames
        names(tmp.vp)[1] <- "plot"
        playState$viewport <- tmp.vp
    }
===

What is the expected output? What do you see instead?

I expect the graphic from the playwith screenshots examples.

What version of the product are you using? On what operating system?
- playwith_0.9-54
- Arch Linux x86_64
- R version 2.15.1 installed from Arch repos

Please provide any additional information below.
- Also tried downgrading from ggplot2 0.9.2 to 0.9.1 and got the same error. 
Downgrading to 0.9.0 worked again.

Original issue reported on code.google.com by jw.he...@gmail.com on 1 Nov 2012 at 6:13