{"action":"created","issue":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/141","labels_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/141/comments","events_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/141/events","html_url":"https://github.com/ramnathv/htmlwidgets/issues/141","id":96871977,"number":141,"title":"Making rgl widget","user":{"login":"dmurdoch","id":1935680,"avatar_url":"https://avatars.githubusercontent.com/u/1935680?v=3","gravatar_id":"","url":"https://api.github.com/users/dmurdoch","html_url":"https://github.com/dmurdoch","followers_url":"https://api.github.com/users/dmurdoch/followers","following_url":"https://api.github.com/users/dmurdoch/following{/other_user}","gists_url":"https://api.github.com/users/dmurdoch/gists{/gist_id}","starred_url":"https://api.github.com/users/dmurdoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmurdoch/subscriptions","organizations_url":"https://api.github.com/users/dmurdoch/orgs","repos_url":"https://api.github.com/users/dmurdoch/repos","events_url":"https://api.github.com/users/dmurdoch/events{/privacy}","received_events_url":"https://api.github.com/users/dmurdoch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":32,"created_at":"2015-07-23T18:11:59Z","updated_at":"2015-09-05T22:12:44Z","closed_at":null,"body":"I'd like to make an rgl widget, but I'm having trouble getting started, because the examples I've seen start with a Javascript library, rather than starting with R code.  Here's what I'm thinking of doing:\r\n\r\n 1. Put the rglClass definition that writeWebGL() creates into a Javascript file, and call it the Javascript library.  \r\n\r\n 2. Add functions to it to support the kinds of modifications people would want to do when using an rgl widget.  These would essentially replace the writeWebGL function.\r\n\r\nDoes this sound like the right approach?  Are there any examples to work from that are similar?\r\n\r\nDuncan Murdoch"},"comment":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/comments/138003088","html_url":"https://github.com/ramnathv/htmlwidgets/issues/141#issuecomment-138003088","issue_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/141","id":138003088,"user":{"login":"dmurdoch","id":1935680,"avatar_url":"https://avatars.githubusercontent.com/u/1935680?v=3","gravatar_id":"","url":"https://api.github.com/users/dmurdoch","html_url":"https://github.com/dmurdoch","followers_url":"https://api.github.com/users/dmurdoch/followers","following_url":"https://api.github.com/users/dmurdoch/following{/other_user}","gists_url":"https://api.github.com/users/dmurdoch/gists{/gist_id}","starred_url":"https://api.github.com/users/dmurdoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmurdoch/subscriptions","organizations_url":"https://api.github.com/users/dmurdoch/orgs","repos_url":"https://api.github.com/users/dmurdoch/repos","events_url":"https://api.github.com/users/dmurdoch/events{/privacy}","received_events_url":"https://api.github.com/users/dmurdoch/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T22:12:44Z","updated_at":"2015-09-05T22:12:44Z","body":"I'm quite happy with the way the rglwidget is going.  I think the design is right; it's just catching up on all the details and documentation now.\r\n\r\nThis is the design:\r\n\r\nThere are two widgets:  the rglwidget which displays the scene, and an invisible rglcontroller widget which receives messages from Shiny controls and uses them to change the rglwidget.\r\n\r\nIf the rglcontroller only needs the value of a slider or other input control, it doesn't bother using the reactive input$slider, it installs an onchange event handler on the slider.  This speeds things up a lot, so the Shiny sliders can be used for smooth, real-time modification of the rgl scene.  I love this!  You guys have put a lot of work into the Shiny controls, and I just get to use it!\r\n\r\nOn the other hand, sometimes the change to the scene needs to be computed based on the inputs.  That still works with reactive inputs.\r\n\r\nThis has been slow, but I think I'm getting a really big improvement to rgl out of it."}}