Custom Edges
Svelvet
also allows you to
customize your edges. Currently, there are four edge types - straight, bezier,
step, and smoothstep. The default will be a bezier edge unless you set
type:
'straight'
,
'step'
, or
'smoothstep'
. You can also
turn on edge animations by setting
animation: true
.
Optionally customize the color of edges by setting
edgeColor
to a color name, hexcode, or rgb value. Annotate your edges by providing a
label
. Customize labels with
labelBgColor
and labelTextColor
to change the
background and text color of the label using color names, hexcodes, or rgb values.
Edge Properties
- keyvalue
id
(required) stringsource
(required) node idtarget
(required) node idtype
string ("straight", "bezier", "step", "smoothstep") - defaults to "bezier" if not specifiedlabel
stringlabelBgColor
string of string of color name, hexcode, or rgblabelTextColor
string of color name, hexcode, or rgbedgeColor
string of color name, hexcode, or rgbanimate
booleanarrow
booleannoHandle
boolean
Implementing Custom Edges
Click here for a sandbox!