hafen / trelliscopejs

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

Error message regarding PhantomJS is incorrect #22

Closed geneorama closed 7 years ago

geneorama commented 7 years ago

trelliscopejs:::find_phantom searches for a Node JS installation. however trelliscopejs:::widget_thumbnail instructs the user as follows

"** phantomjs dependency could not be found - ", "thumbnail cannot be generated - visit http://phantomjs.org/download.html ", "to install"

The error message (and the README.md and package loading messages) should tell the user to install PhantomJS with Node.

I added Phantom JS to my PATH, but it wasn't found. So, I guess another solution would be to check the user's system path (as well as the NPM directory), but I don't have time immediately to figure out how to do that. If you think that's important, I would recommend a second issue.

FYI; I'm using Windows 7 at work, checking the system path should work for most Windows versions.

Also, I don't mean to sound terse, I'm trying to type this before I leave! Thanks for a great package.

hafen commented 7 years ago

Thanks. I think I may just depend on webshot to take care of this aspect of the package. It even has an install_phantom() function that would make it easier on Windows users. I'll look into that.

geneorama commented 7 years ago

Well, I think a better error message would be an easy fix too. I was slightly miffed / confused when I went to the download page for Phantom and there was no real installer for windows. I knew that there was no way trelliscopejs would find Phantom just because I unzipped it (but I tried anyway because I do things the hard way).

Then I dug deeper and noticed the file.path command with "npm" and knew you must be using Node to install Phantom.

Dripdrop12 commented 7 years ago

I've been trying to figure out if the webshot installation order matters because after running install_phantom() I am still getting the same error.

hafen commented 7 years ago

Could you try this version: devtools::install_github("hafen/trelliscopejs@webshot")? This uses the webshot package. I figure it's best to use what's already out there and used by other projects as it has a better chance of being the most robust. Also, I changed the default to thumb = FALSE since I anticipate most people will create one-off displays as opposed to a collection of multiple displays in the same directory, and in this case thumbnails are not necessary. Thumbnails with htmlwidget panels slow the computation down for small displays significantly anyway, so this is a good default.

Anyway, please try this update to the package and let me know how it works.

geneorama commented 7 years ago

Just noticed this and tried running it. The webshot package appears to have installed without issue.

> devtools::install_github("hafen/trelliscopejs@webshot")
Downloading GitHub repo hafen/trelliscopejs@webshot
from URL https://api.github.com/repos/hafen/trelliscopejs/zipball/webshot
Installing trelliscopejs
Installing 1 package: webshot
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/webshot_0.4.0.zip'
Content type 'application/zip' length 1101110 bytes (1.1 MB)
downloaded 1.1 MB

package ‘webshot’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\375492\AppData\Local\Temp\RtmpItj9WF\downloaded_packages
"C:/R/R-3.3.1/bin/i386/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL  \
  "C:/Users/375492/AppData/Local/Temp/RtmpItj9WF/devtools1358a1d71d5/hafen-trelliscopejs-9461fca"  \
  --library="C:/R/R-3.3.1/library" --install-tests 

* installing *source* package 'trelliscopejs' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (trelliscopejs)
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

loaded via a namespace (and not attached):
[1] httr_1.2.1      R6_2.2.0        tools_3.3.1     withr_1.0.2     curl_2.3        memoise_1.0.0  
[7] digest_0.6.11   devtools_1.12.0
> 
hafen commented 7 years ago

Thanks. I think I'll go ahead and close this. Let me know if other issues arise.