Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior after update rgl package to 0.95.1247 #10

Open
chermit opened this issue May 4, 2015 · 18 comments
Open

Strange behavior after update rgl package to 0.95.1247 #10

chermit opened this issue May 4, 2015 · 18 comments

Comments

@chermit
Copy link

chermit commented May 4, 2015

What doesn't work:
No rendering of the plot but the message "You must enable Javascript to view this page properly." instead on Firefox. The Javascript is enabled and the rgl package works smoothly (writeWebGL(),browseURL()). The console gives the message "Error: Could not find method of starting WebGL scene." that seem to be generated from glbinding.js, more precisely from:

...
setTimeout(function() { 
  // check to see whether we're using the old or new RGL function type.
  oldFun = window[data.prefix + "webGLStart"];
  newObj = window[data.prefix + "WebGL"];
  if(typeof oldFun === 'function'){
    oldFun();     
  } else if(typeof newObj === 'object'){
    newObj.start();
    newObj.onZoom(function(zoom){
      Shiny.onInputChange('.clientdata_gl_output_' + el.id + '_zoom', zoom);
    });
    newObj.onFOV(function(fov){
      Shiny.onInputChange('.clientdata_gl_output_' + el.id + '_fov', fov);
    });
    newObj.onPan(function(pan){
      Shiny.onInputChange('.clientdata_gl_output_' + el.id + '_pan', pan.getAsArray());
    });

  } else{
    throw new Error("Could not find method of starting WebGL scene.");
  }

}, 0);
...

System info:
x86_64, linux-gnu
R version 3.2.0 (2015-04-16)
RStudio 0.98.1103
rgl package 0.95.1247
shinyRGL 1.1.0

How to reproduce:
Run any of the example in the shinyRGL package

Thank you,
Marco

@gdkrmr
Copy link

gdkrmr commented May 22, 2015

Found the same error under windows

@jamesa8
Copy link

jamesa8 commented May 28, 2015

I have found this error on Chrome using Windows 7. I have the latest chrome, R, shiny, and shinyrgl packages. Previous versions of my code worked perfectly.

@williFiebranz
Copy link

It also happens on Max OS X within Safari...

@martinschmelzer
Copy link

I encoutnered this problem months ago and still nothing changed. I guess the package is not maintained anymore?

@sargdavid
Copy link

I have the same issue in Windows 7 with both Chrome and Firefox (I'm not even going to talk about IE, it's completely useless...). Please help!

Btw, it works just fine on my other Windows 7 machine which makes the issue even more mysterious :).

@trestletech
Copy link
Owner

This isn't really an acceptable solution, but try running this: install_github("rgl", "trestletech", "js-class") and see if the errors persist.

The root of the issue is that the rgl package has substantially refactored its JS code and this package would effectively need to be rewritten to encompass those changes. Hopefully using the older version by following the command above will help get things running, though you're certainly using an older version of the rgl package which may or may not be acceptable for your circumstances.

Sorry I don't have more time to maintain it now. I will commit to try to find time to review PRs if anyone wants to take on that work. I'm very open to adding a collaborator to the project.

@martinschmelzer
Copy link

Hi there,

thanks for the reply. I stumbled over this work around only a few hours before your post. It worked for me indeed!

Best,
Martin

@chermit
Copy link
Author

chermit commented Jun 29, 2015

Hi,
thank you for the workaround you provided. It works for me!

Best,
Marco

@sargdavid
Copy link

Thank you Jeff, it worked! Just one more comment: I had to delete rgl package manually form my library folder, otherwise I was getting something like "permission denied to overwrite .../rgl.dll with .../rgl.dll".

Thanks!

@martinschmelzer
Copy link

If you start R/RStudio as an administrator you wont have the error message... ;)

@williFiebranz
Copy link

On mac this does not seem to work with the latest Xcode version. At least I get a ton of Xcode-related errors until the error limit gets exceeded and the installation aborts...

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

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

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

loaded via a namespace (and not attached):
[1] httr_0.6.1 magrittr_1.5 tools_3.2.0 RCurl_1.95-4.6 stringi_0.4-1 stringr_1.0.0 bitops_1.0-6
[8] devtools_1.9.0

@sargdavid
Copy link

aha...Thanks for the tip!

OK, so now it works locally but I'm still having trouble running it on shinyapp.io. I completely removed the app from shinyapp.io and then deployed it again using the updated code. I get the following error message:

Error: rgl.open failed

I was under impression that shinyapp.io will use the packages that I'm using while deploying the apps but maybe that's not the case... Does anyone have an idea how to fix that?

Thank you.

@jariwalask
Copy link

The rgl.snapshot is failing when using the patched (install_github("rgl", "trestletech", "js-class")) rgl version. Here is a reproducible example, taken from shinyRGL github:

server.R

library(shiny)
library(shinyRGL)

#' Define UI for application that plots random 3d points
#' @author Jeff Allen \email{jeff@@trestletech.com}
shinyUI(pageWithSidebar(

    # Application title
    headerPanel("Shiny WebGL!"),
    # Sidebar with a slider input for number of points
    sidebarPanel(
        sliderInput("pts",
        "Number of points:",
        min = 10,
        max = 1000,
        value = 250),
        HTML("<hr />"),
        helpText(HTML("Created using <a href = \"http://github.com/trestletech/shinyRGL\">shinyRGL</a>."))
    ),

    # Show the generated 3d scatterplot
    mainPanel(
        webGLOutput("sctPlot")
    )
))

ui.R

# Must be executed BEFORE rgl is loaded on headless devices.
options(rgl.useNULL=TRUE)

library(shiny)
library(shinyRGL)
library(rgl)

xPts <- runif(1000, 0, 1)
yPts <- runif(1000, 0, 1)
zPts <- runif(1000, 0, 1)

#' Define server logic required to generate and 3d scatterplot
#' @author Jeff Allen \email{jeff@@trestletech.com}
shinyServer(function(input, output) {

# Expression that generates a rgl scene with a number of points corresponding
# to the value currently set in the slider.
    output$sctPlot <- renderWebGL({
        points3d(xPts[1:input$pts],
            yPts[1:input$pts],
            zPts[1:input$pts])
        axes3d()
        rgl.snapshot('./test.png', fmt = 'png')
   })
})

out

Warning in rgl.snapshot("./test.png", fmt = "png") : snapshot failed
# sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.4 (Santiago)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] shinyRGL_0.1.1 shiny_0.12.2   rgl_0.93.963 

loaded via a namespace (and not attached):
[1] R6_2.1.1        htmltools_0.2.6 Rcpp_0.12.0     digest_0.6.8   
[5] xtable_1.7-4    httpuv_1.3.3    mime_0.3

The rgl.snapshot works with rgl >= 0.95.1247. However, due to the known issue of the latest rgl not working with shiny, the output is what's reported initially in this ticket, and the snapshots are just blank / black images.

Any help is much appreciated. Thanks.

@DanitD
Copy link

DanitD commented Jan 25, 2016

Any solution for the "No rendering of the plot but the message: You must enable Javascript to view this page properly." for shinyRGL plots in Mac? I went through the comments and it looks like the solution doesn't work in Mac OS X.

Thanks in advance,

@chermit
Copy link
Author

chermit commented Jan 26, 2016

trestletech said "Sorry I don't have more time to maintain it now" so the package seem no more manteined right now.
Try using package "rglwidget" instead.
Marco

@DanitD
Copy link

DanitD commented Jan 26, 2016

I used "rglwidget", but thats still an issue!

@chermit
Copy link
Author

chermit commented Jan 26, 2016

Try to post your problem in R-Forge rgl forum.
Marco

Il 26/01/2016 14:20, DanitD ha scritto:

I used "rglwidget", but thats still an issue!


Reply to this email directly or view it on GitHub
#10 (comment).

@wave-electron
Copy link

I've been having the same issue with ShinyRGL on a MAC OS X.
i.e no plot and the message "You must enable Javascript to view this page properly."

I tried out the RGL patch and it didn't work just a lot of errors on the install which gets aborted.

In the end, i gave up and tried out the RGLwidget package and it works using the same plot example
The code is up on github for anyone looking to get it working.
Shiny App - RGLwidget Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants