g6_add_nodes {g6R} | R Documentation |
Add nodes/edges/combos to a g6 graph via proxy
Description
This function adds one or more nodes/edges/combos to an existing g6 graph instance using a proxy object. This allows updating the graph without completely re-rendering it.
Usage
g6_add_nodes(graph, nodes)
g6_add_edges(graph, edges)
g6_add_combos(graph, combos)
g6_add_data(graph, data)
Arguments
graph |
A g6_proxy object created with |
nodes , edges , combos |
A data frame or list specifying the elements to be added. Elements structure must be compliant with specifications listed at https://g6.antv.antgroup.com/manual/element/overview |
data |
A nested list possibly containing nodes, edges and combo data. |
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#graphaddnodedata, https://g6.antv.antgroup.com/en/api/data#graphaddedgedata and https://g6.antv.antgroup.com/en/api/data#graphaddcombodata for more details.
Value
The g6_proxy object (invisibly), allowing for method chaining.