g6_focus_elements {g6R} | R Documentation |
Focus on specific elements in a g6 graph via proxy
Description
This function focuses on one or more elements (nodes/edges) in an existing g6 graph instance using a proxy object. It highlights the specified elements and can optionally animate the view to focus on them.
Usage
g6_focus_elements(graph, ids, animation = NULL)
Arguments
graph |
A g6_proxy object created with |
ids |
Character vector containing the IDs of the elements (nodes/edges) to focus on. |
animation |
Optional list containing animation configuration parameters for the focus action. Common parameters include:
If NULL, no animation will be applied. |
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.
See https://g6.antv.antgroup.com/en/api/element#graphfocuselementid-animation for more details.
Value
The g6_proxy object (invisibly), allowing for method chaining.