This function gets the state of one or more nodes/edges/combos to an existing g6 graph instance using a proxy object.
Arguments
- graph
A g6_proxy object created with
g6_proxy
.- nodes, edges, combos
A string or character vector.
Details
This function can only be used with a g6_proxy object within a Shiny application. It will not work with regular g6 objects outside of Shiny.
If a node with the same ID already exists, it will not be added again. See https://g6.antv.antgroup.com/en/api/data#graphgetnodedata for more details.
Examples
if (FALSE) { # \dontrun{
# Send query to JS
observeEvent(req(input[["graph-initialized"]]), {
g6_proxy("graph") |> g6_get_nodes(c("node1", "node2"))
})
# Recover query result inside input[["<GRAPH_ID>-<ELEMENT_ID>-state"]]
output$res <- renderPrint({
list(
node1_state = input[["graph-node1-state"]],
node2_state = input[["graph-node2-state"]]
)
})
} # }