-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
#176 Shows how to retrieve the selected node after-the-fact with an additional button press. Can you please give an example of how to process the selection of a node by a user as an event using observeEvent where the event handler accesses the position information of the selected node?
There is code in the project I am working on that added a JavaScript select handler to propagate the selected data and edge information:
output$network <- renderVisNetwork(
{
visNetwork(nodes, edges, height = "800px", width = "100%") %>%
:
:
visEvents(select = glue::glue("function(data) {{
Shiny.setInputValue('{NS(id)('current_nodes_selection')}', data.nodes);
Shiny.setInputValue('{NS(id)('current_edges_selection')}', data.edges);
;}}"))
But this seems to break other functionality like the ability to get node positions while only returning the ID of the selected nodes. This no longer works with the JavaScript event hander in place:
visNetworkProxy("network") %>% visGetPositions()
Metadata
Metadata
Assignees
Labels
No labels