Description Usage Arguments Details Value Examples
Read nodes and edges by batch with a delay.
1 2 3 4 5 | sg_read_delay_nodes_p(proxy, data, ..., delay)
sg_read_delay_edges_p(proxy, data, ..., delay)
sg_read_delay_exec_p(proxy, refresh = TRUE)
|
proxy |
An object of class |
data |
A |
... |
any column. |
delay |
Column name of containing batch identifier. |
refresh |
Whether to refresh the graph after each batch ( |
Add nodes and edges with sg_read_delay_nodes_p
and sg_read_delay_edges_p
then execute (send to JavaScript end) with sg_read_delay_exec_p
.
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | library(shiny)
ui <- fluidPage(
actionButton("add", "add nodes & edges"),
sigmajsOutput("sg")
)
server <- function(input, output, session){
output$sg <- renderSigmajs({
sigmajs()
})
observeEvent(input$add, {
nodes <- sg_make_nodes(50)
nodes$batch <- c(
rep(1000, 25),
rep(3000, 25)
)
edges <- data.frame(
id = 1:80,
source = c(
sample(1:25, 40, replace = TRUE),
sample(1:50, 40, replace = TRUE)
),
target = c(
sample(1:25, 40, replace = TRUE),
sample(1:50, 40, replace = TRUE)
),
batch = c(
rep(1000, 40),
rep(3000, 40)
)
) %>%
dplyr::mutate_all(as.character)
sigmajsProxy("sg") %>%
sg_force_start_p() %>%
sg_read_delay_nodes_p(nodes, id, color, label, size, delay = batch) %>%
sg_read_delay_edges_p(edges, id, source, target, delay = batch) %>%
sg_read_delay_exec_p() %>%
sg_force_stop_p()
})
}
if(interactive()) shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.