tdhock / animint

animated and interactive web graphics
146 stars 37 forks source link

does animint work on windows? #88

Open talgalili opened 9 years ago

talgalili commented 9 years ago

Here is the output:

> library(animint)
Loading required package: ggplot2
Find out what's changed in ggplot2 with
news(Version == "1.0.1", package = "ggplot2")
Loading required package: proto
> example(animint)

animnt> ## Make a Gapminder plot (aka Google motion chart), which is actually
animnt> ## just a scatterplot with size and color that moves over time.
animnt> library(animint)

animnt> data(WorldBank)

animnt> gapminder <-
animnt+   list(ts=ggplot()+
animnt+        make_tallrect(WorldBank, "year")+
animnt+        geom_line(aes(year, life.expectancy, group=country, color=region,
animnt+                      clickSelects=country),
animnt+                  data=WorldBank, size=4, alpha=3/5),
animnt+        time=list(variable="year",ms=3000),
animnt+        duration=list(year=1000),
animnt+        scatter=ggplot()+
animnt+        geom_point(aes(fertility.rate, life.expectancy, clickSelects=country,
animnt+                       showSelected=year, colour=region, size=population),
animnt+                   data=WorldBank)+
animnt+        geom_text(aes(fertility.rate, life.expectancy, label=country,
animnt+                      showSelected=country, showSelected2=year),
animnt+                  data=WorldBank)+
animnt+        make_text(WorldBank, 5, 80, "year")+
animnt+        scale_size_animint(pixel.range=c(2,20), breaks=10^(4:9)))

animnt> animint2dir(gapminder, "WorldBank-viz")
opening a web browser with a file:// URL; if the web page is blank, try running
if (!requireNamespace("servr")) install.packages("servr")
servr::httd("C:/Users/junior/Documents/WorldBank-viz")
Error in shell.exec(url) : 'WorldBank-viz/index.html' not found
cpsievert commented 9 years ago

Hi @talgalili, thanks for the report. The example works for me and here is my sessionInfo() (could you report yours as well?).

R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] animint_2015.06.16 proto_0.3-10       ggplot2_1.0.1      devtools_1.8.0    

loaded via a namespace (and not attached):
 [1] Rcpp_0.11.6      servr_0.2.1      xml2_0.1.1       magrittr_1.5    
 [5] roxygen2_4.1.1   MASS_7.3-40      munsell_0.4.2    colorspace_1.2-6
 [9] lattice_0.20-31  stringr_1.0.0    plyr_1.8.3       tools_3.2.0     
[13] grid_3.2.0       gtable_0.1.2     git2r_0.10.1     rversions_1.0.1 
[17] digest_0.6.8     RJSONIO_1.3-0    reshape2_1.4.1   curl_0.8        
[21] mime_0.3         memoise_0.2.1    labeling_0.3     stringi_0.4-1   
[25] scales_0.2.5     httpuv_1.3.2     hexbin_1.27.0   

@kferris10 I have a feeling this may be due to file path issues on Windows. Would you mind running example(animint) on your machine?

cpsievert commented 9 years ago

@talgalili does this work for you?

library(animint)
animint2dir(list(p = qplot(1:10)))
kferris10 commented 9 years ago

Everything seems to work fine for me.

devtools::session_info()
Session info ------------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.3 (2015-03-09)
 system   x86_64, mingw32             
 ui       RStudio (0.98.1083)         
 language (EN)                        
 collate  English_United States.1252  
 tz       America/Denver              

Packages ----------------------------------------------------------------------------
 package    * version    date       source                         
 animint      2015.06.16 2015-06-22 local                          
 colorspace * 1.2-4      2013-09-30 CRAN (R 3.1.1)                 
 devtools   * 1.7.0      2015-01-17 CRAN (R 3.1.2)                 
 digest     * 0.6.8      2014-12-31 CRAN (R 3.1.2)                 
 ggplot2      1.0.0.99   2015-03-14 Github (tdhock/ggplot2@aac38b6)
 gtable     * 0.1.2      2012-12-05 CRAN (R 3.1.1)                 
 MASS       * 7.3-39     2015-02-24 CRAN (R 3.1.3)                 
 munsell    * 0.4.2      2013-07-11 CRAN (R 3.1.1)                 
 plyr       * 1.8.1      2014-02-26 CRAN (R 3.1.1)                 
 proto        0.3-10     2012-12-22 CRAN (R 3.1.1)                 
 Rcpp       * 0.11.5     2015-03-06 CRAN (R 3.1.3)                 
 reshape2   * 1.4.1      2014-12-06 CRAN (R 3.1.2)                 
 rstudio    * 0.98.1083  2014-10-26 local                          
 rstudioapi * 0.2        2014-12-31 CRAN (R 3.1.2)                 
 scales     * 0.2.4      2014-04-22 CRAN (R 3.1.1)                 
 stringr    * 0.6.2      2012-12-06 CRAN (R 3.1.1)
tdhock commented 8 years ago

maybe this issue has something to do with windows? maybe we can test on windows via https://www.appveyor.com/ and maybe the fix will be via #50

kferris10 commented 8 years ago

@tdhock Just an FYI, I just double checked on my windows machine and everything still runs fine for me.

faizan-khan-iit commented 7 years ago

I was just going through some old issues related to #177 when I stumbled across this one. It seems like the problem is with the permissions that the R Gui has in Windows.

If I try to running this in the RGui(64 bit) :

library(animint)
animint2dir(list(p = qplot(1:10)))

everything works fine.

While this:

animint2dir(list(p = qplot(1:10)), "test_dir")

gives the following error:

`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
opening a web browser with a file:// URL; if the web page is blank, try running
if (!requireNamespace("servr")) install.packages("servr")
servr::httd("C:/Users/Faizan/Documents/test_dir")
Error in shell.exec(url) : 'test_dir/index.html' not found

Don't know why it can't find a directory it just created but running:

servr::httd("C:/Users/Faizan/Documents/test_dir")

after the above error works too.

RStudio seems fine with both so I don't think we ought to bother with fixing this.

tdhock commented 7 years ago

eventually it would be good to have appveyor test cases running on a windows vm.