Description Usage Arguments Value Examples
Retrieve nodes and edges from the widget.
1 2 3 | sg_get_nodes_p(proxy)
sg_get_edges_p(proxy)
|
proxy |
An object of class |
The proxy
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library(shiny)
nodes <- sg_make_nodes()
edges <- sg_make_edges(nodes)
ui <- fluidPage(
actionButton("start", "Trigger layout"), # add the button
sigmajsOutput("sg"),
verbatimTextOutput("txt")
)
server <- function(input, output){
output$sg <- renderSigmajs({
sigmajs() %>%
sg_nodes(nodes, id, size, color) %>%
sg_edges(edges, id, source, target)
})
observeEvent(input$start, {
sigmajsProxy("sg") %>% # use sigmajsProxy!
sg_get_nodes_p()
})
output$txt <- renderPrint({
input$sg_nodes
})
}
if(interactive()) shinyApp(ui, server) # run
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.