dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
85 stars 21 forks source link

Problems with controlling Mouse and Widget handlers #243

Closed GSperanza closed 2 years ago

GSperanza commented 2 years ago

Dear Prof. D. Murdoch I'm currently using R to analyze spectral data with a DELL Latitude E5430 - UBUNTU 18LTS is the operating system. I need to retrieve the mouse position clicking on the x11(type="cairo") graphic window and, at the same time, I have to control the handlers from a widget needed to select which operation to apply (selection of the function for background subtraction, selection of fitting components, adding fitting components...) I used the getGraphicEvent() instruction as described in the R documentation. Unfortunately, when active, this function partially blocks the handlers of the widget. To activate the selection made on the widget you have to move the mouse in/out the x11 window. Is it possible to give priority to mouse clicks or to the widget-handlers when the focus is respectively on the x11() or on the widget? Thank you in advance for the attention Best regards Giorgio Speranza Senior Researcher - FBK, Italy

dmurdoch commented 2 years ago

Sorry, I suggested you send your message here, but I think it's actually about base graphics rather than rgl graphics.

I think the base getGraphicsEvent() function is very limited, so there probably isn't a way to do what you want using that function. If you were starting from scratch, I'd suggest doing that kind of interactive graphics in a browser display, either using Shiny or some other system such as plotly. They rely on a lot of Javascript code running in the browser so they're not trivial to learn, but they are very powerful once you figure them out.

GSperanza commented 2 years ago

Dear Prof. D. Murdoch thank you for the suggestions. I will have a look at the scripts and see how to solve the problem. Thank you again Giorgio Speranza

-- Dr. Giorgio Speranza Senior Researcher FMPS - Fondazione Bruno Kessler 18 Sommarive str. 38123 Trento Italy

--

Le informazioni contenute nella presente comunicazione sono di natura  privata e come tali sono da considerarsi riservate ed indirizzate  esclusivamente ai destinatari indicati e per le finalità strettamente  legate al relativo contenuto. Se avete ricevuto questo messaggio per  errore, vi preghiamo di eliminarlo e di inviare una comunicazione  all’indirizzo e-mail del mittente.

-- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material.