Learn R Programming

g6R (version 0.1.0)

create_edge: Configure Create Edge Behavior

Description

Creates a configuration object for the create-edge behavior in G6. This allows users to create edges between nodes by clicking or dragging.

Usage

create_edge(
  key = "create-edge",
  trigger = "drag",
  enable = FALSE,
  onCreate = NULL,
  onFinish = NULL,
  style = NULL,
  notify = FALSE,
  ...
)

Value

A list with the configuration settings for the create-edge behavior.

Arguments

key

Behavior unique identifier. Useful to modify this behavior from JS side.

trigger

The way to trigger edge creation: "click" or "drag" (string, default: "drag").

enable

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.

onCreate

Callback function for creating an edge, returns edge data (function, default: NULL).

onFinish

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

Style of the newly created edge (list, default: NULL).

notify

Whether to show a feedback message in the ui.

...

Extra parameters. See https://g6.antv.antgroup.com/en/manual/behavior/create-edge.

Examples

Run this code
# Basic configuration
config <- create_edge()

Run the code above in your browser using DataLab