christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
652 stars 269 forks source link

make accessible the identity of a clicked vertex #234

Closed rcorty closed 6 years ago

rcorty commented 6 years ago

I see that it is possible to work with the vertex identity in with javascript, as in https://github.com/christophergandrud/networkD3/blob/9c0a9c9ff32c53212d2d43e0ae3cc664137315e6/inst/examples/examples.R#L40-L45, but I would like to be able to return to R which vertex was clicked. I could compute on that in R and print out information relevant to that vertex.

cjyetman commented 6 years ago

Please use a forum like StackOverflow for questions like this. This is meant for bugs and issues.

You probably want to use the Shiny JavaScript function Shiny.onInputChange. See here for more: https://shiny.rstudio.com/articles/js-send-message.html