Creates a configuration object for the create-edge behavior in G6. This allows users to create edges between nodes by clicking or dragging.
create_edge(
key = "create-edge",
trigger = "drag",
enable = FALSE,
onCreate = NULL,
onFinish = NULL,
style = NULL,
notify = FALSE,
...
)
A list with the configuration settings for the create-edge behavior.
Behavior unique identifier. Useful to modify this behavior from JS side.
The way to trigger edge creation: "click" or "drag" (string, default: "drag").
Whether to enable this behavior (boolean or function, default: FALSE). Our default implementation works in parallel with the context_menu plugin which is responsible for activating the edge behavior when edge creation is selected.
Callback function for creating an edge, returns edge data (function, default: NULL).
Callback function for successfully creating an edge (function). By default, we provide an internal implementation that disables the edge mode when the edge creation is succesful so that it does not conflict with other drag behaviors.
Style of the newly created edge (list, default: NULL).
Whether to show a feedback message in the ui.
Extra parameters. See https://g6.antv.antgroup.com/en/manual/behavior/create-edge.
# Basic configuration
config <- create_edge()
Run the code above in your browser using DataLab