Closed bastianilso closed 1 year ago
@bastianilso I am still working on this, currently i can capture all events for all Elements except for the plotlyoutput. Can you help me to find the solution for this element please ?
@bilal-62210 what did you try?
@bastianilso i tried to change 'plotlyoutput' to 'plotoutput', in this case i managed to capture the id but the chart is not showing on the app, so this it didn't work. I tried also to give to the plotlyoutput an 'outputid' instead of the basic 'id' and this didn't work too. I tried also to include the plotlyoutput in a "
to call the div id when the mouse hovers over the plotlyoutput and it didn't work. So i think the issue is that the 'plotlyouput' is reactive because for a basic 'plotouput' it works.@bilal-62210 did you try to use a jQuery style of binding your log function instead?
See my suggestion here: https://github.com/med-material/r-shiny-js-data-capture/issues/1#issuecomment-1257627352
Think about this: How do you know when the HTML DOM changes? If you are subscribing all elements at the beginning to your logging, but then something in the HTML changes, how do you ensure the new elements are also subscribed to your logging? Maybe this is the problem?
take a look at: https://stackoverflow.com/questions/15657686/jquery-event-detect-changes-to-the-html-text-of-a-div
Hi @bastianilso This is what i did exactly for the plotlyoutput id :
all these tests did not work. As i said yesterday, if we can't find the solution to get the plotlyoutput id we can put the value to null for the "element" field on the csv file when there is a mouse event on a plotlyoutput(but we still have the screen-x and y values).
Hi @bilal-62210 thanks for the report and for trying these.
Here are my suggestions to you to try next to solve this:
Plotly uses SVG for its output in many cases, and in other cases WebGL. I manipulated your HTML file to include a some basic SVG elements. Please try if your JS capture system can detect hovering over the SVG element as a whole and the individual SVG elements (ellipses). web_page2-with-svg.zip
Try and see whether you can integrate this Codepen into your HTML file and use the JS capture system on the plot (this uses Plotly.js outside R Shiny, this way we can test it in isolation): https://codepen.io/mmakrzem/pen/mdOpWLd
Try to see if you can use your JS data capture system on the visualization produced by Aldryck.
@bilal-62210 I posted a question in the plotly community forum. We have one reply already, please have a look.
Other suggestions to try out:
Now that we have elementFromPoint, we don't have to rely on this other issue solely, so I'll resolve this.
Now that we have a prototype implementation of a JS event capture system, we should investigate how to integrate it into a basic R shiny application, for example the R shiny application found in the
brush_whack
folder. There are a few things to consider:ui
function of the R Shiny app.ui
function. In the future, we may want a more sophisticated way (invisible to the user in the experiment), in which we can access the data.