Get events server-side.

sg_events(sg, events)

Arguments

sg

An object of class sigmajsas intatiated by sigmajs.

events

A vector of valid events (see section below).

Details

Events: Valid events to pass to events.

  • clickNode

  • clickNodes

  • clickEdge

  • clickEdges

  • clickStage

  • doubleClickStage

  • rightClickStage

  • doubleClickNode

  • doubleClickNodes

  • doubleClickEdge

  • doubleClickEdges

  • rightClickNode

  • rightClickNodes

  • rightClickEdge

  • rightClickEdges

  • hoverNode

  • hoverNodes

  • hoverEdge

  • hoverEdges

  • outNode

  • outNodes

  • outEdge

  • outEdges

See also

Examples

library(shiny) nodes <- sg_make_nodes() edges <- sg_make_edges(nodes) ui <- fluidPage( sigmajsOutput("sg"), p("Click on a node"), verbatimTextOutput("clicked") ) server <- function(input, output){ output$sg <- renderSigmajs({ sigmajs() %>% sg_nodes(nodes, id, size, color) %>% sg_edges(edges, id, source, target) %>% sg_events("clickNode") }) # capture node clicked output$clicked <- renderPrint({ input$sg_click_node }) }
# NOT RUN { shinyApp(ui, server) # }