rbokeh
rbokeh copied to clipboard
buttons on the top not working under rstudio
I just installed the latest github versions of both htmlwidgets and rbokeh under the latest rstudio running the latest R (3.2.0) under ubuntu 14.
When I run the following command, under rstudio, clickin on the buttons "lasso select" and "box select" don't do anything. It keeps on panning. Actually none of the buttons do seem to work under rstudio. Am I doing something wrong?
figure() %>%
- ly_points(Sepal.Length, Sepal.Width, data = iris, color = Species) %>%
- tool_box_select() %>%
- tool_lasso_select()
Also, when it works, is there a way to get the row/column indexes of the points that were chosen with these selection (box or lasso) tools?
thanks a bunch for this impressive work.
Interesting. I could not replicate in RStudio, Safari, Firefox, Chrome. But I'm on OS X. There was a similar issue on the mailing list about the buttons not working in Chrome on Ubuntu. https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/AQ0SfGzxH3E that might be helpful. If it's not helpful, I'd suggest getting on the Bokeh mailing list, as it sounds like an issue that goes beyond rbokeh.
For getting indices, you can get them with javascript doing something like
Bokeh.ColumnDataSource.Collection.models[0].attributes.selected
This is probably one of the first things we would want to add for shiny - an input that updates when a new selection has been made that provides the indices.
I've had this problem since the start with Windows 7 + RStudio Viewer | Chrome (multiple versions) and filed issue https://github.com/bokeh/bokeh/issues/1848, but have not had a resolution.
I had some success by specifying only certain tools.
Thanks a lot hafen for the javascript tip. I am quite new to javascript and do not know how to pass these indexes back to R. Can you kindly provide a very short/easy example here? thanks
Oh yeah sorry that snippet isn't too helpful then! I guess the question to ask is what you would like to do. Do you want the indices of the selected points to simply show up in the browser, or do you want them sent back to R for you to do something with?
To send back to R. I could have an associated datatables next to the graph. If I select a curve in the graph, rows of the data.frame displayed in the datatable would get selected AND, if I select a row in the datatable, the associated line in the plot would also be selected (or colored). A kind of two-ways link.
That would be A-MAZ-ING :)
Yea, That will be cool.
confirmed Controls don't work on Windows 8, Rstudio Version 0.99.437. Add a debug option to the controls so we can know what is happening when the control buttons are clicked
@MySchizoBuddy, could you this version that is using Bokeh 0.9 and see if the issue is still there:
devtools::install_github("hafen/[email protected]")
Still not working for me even with the bokeh-v0.9 branch
confirmed bokeh-v0.9 doesn't work with latest Rstudio Version 0.99.441
That's no good! I don't have a windows 8 machine to test. Is it still an issue in Ubuntu 14?
I finally was able to play with this on a windows machine. It is indeed an issue in rstudio. However, it is not windows-specific. For example, if you do the following:
options(viewer = NULL)
figure() %>% ly_points(1:10)
It will open up in a web browser and things work for me. So I'm not sure what it is with rstudio, but that's where the issue is coming from.
I confirm that it is still an issue under Ubuntu 14 (Rstudio Version 0.99.473) :( If I launch the figure on the browser, buttons work fine.
Perhaps someone at RStudio can shed some light on this.
@jjallaire - sorry to bug you but could you point the appropriate person to this issue? To summarize, in Windows and Linux, an rbokeh plot in RStudio renders fine but the buttons at the top of the display don't work. However, if you view it in a web browser, the buttons work.
e.g.
devtools::install_github("bokeh/rbokeh")
figure(width = NULL, height = NULL) %>% ly_points(1:10)
# try the "Box Zoom" and "Resize" buttons - don't work
options(viewer = NULL)
figure(width = NULL, height = NULL) %>% ly_points(1:10)
# box zoom and resize work now
First I'd make sure you are running at least 0.99 of RStudio (we had a huge update to our webkit engine in v0.99).
Not knowing anything about the internals of bokeh I can't suggest what might be going wrong. You can debug things though by just right-clicking the global toolbar of the IDE and clicking the "Inspect" menu (this will give the WebKit developer tools, JS console, etc.)
On Mon, Aug 31, 2015 at 2:53 PM, hafen [email protected] wrote:
Perhaps someone at RStudio can shed some light on this.
@jjallaire https://github.com/jjallaire - sorry to bug you but could you point the appropriate person to this issue? To summarize, in Windows and Linux, an rbokeh plot in RStudio renders fine but the buttons at the top of the display don't work. However, if you view it in a web browser, the buttons work.
e.g.
devtools::install_github("bokeh/rbokeh")
figure(width = NULL, height = NULL) %>% ly_points(1:10)
try the "Box Zoom" and "Resize" buttons - don't work
options(viewer = NULL) figure(width = NULL, height = NULL) %>% ly_points(1:10)
box zoom and resize work now
— Reply to this email directly or view it on GitHub https://github.com/bokeh/rbokeh/issues/71#issuecomment-136464754.
I still experience this issue in Windows in both Chrome and RStudio. It only works for me in Firefox. There are no errors in console. It is very strange. I'll experiment with the latest bokeh to see if the new version fixes it.
I wished I could help but this is a bit out of my abilities :)