Skip to Content

Data Shapes

The graph is made up of 2 basic data shape objects you can pass to the graph.

  • GraphNode - The sphere element-like object that represents an entity in the graph
  • GraphEdge - The link between Nodes

GraphElementBaseAttributes

Base attributes shared by both GraphNode and GraphEdge.

NameTypeDefault
idstring

ID of the element.

dataT

Extra data associated with the element.

labelstring

Label for the element.

subLabelstring

SubLabel for the element.

sizenumber

Size of the element.

labelVisibleboolean

Force label visible or not.

GraphNode

Extends GraphElementBaseAttributes with the following:

NameTypeDefault
parentsstring[]

ID of the parent node.

iconstring

Icon URL for the node.

fillstring

Fill color for the node.

clusterstring

Cluster ID for the node.

fxnumber

Fixed X position for force-directed layouts.

fynumber

Fixed Y position for force-directed layouts.

fznumber

Fixed Z position for force-directed layouts.

idstring

ID of the element.

dataany

Extra data associated with the element.

labelstring

Label for the element.

subLabelstring

SubLabel for the element.

sizenumber

Size of the element.

labelVisibleboolean

Force label visible or not.

GraphEdge

Extends GraphElementBaseAttributes with the following:

NameTypeDefault
sourcestring

Source ID of the node.

fillstring

Fill color for the edge.

targetstring

Target ID of the node.

dashedboolean

Whether the edge should be rendered with a dashed line pattern. When true, the edge will display with alternating dash and gap segments. Renders a solid line when false.

false
dashArray[number, number]

Dash pattern for the line: [dashSize, gapSize]

[3, 1]
subLabelPlacement"below" | "above"

Placement of the subLabel relative to the main label.

  • β€˜below’: Show subLabel below the main label
  • β€˜above’: Show subLabel above the main label
'below'
interpolation"linear" | "curved"

Type of edge interpolation (β€˜linear’ | β€˜curved’).

'linear'
arrowPlacement"none" | "mid" | "end"

Placement of the edge arrow (β€˜none’ | β€˜mid’ | β€˜end’).

'end'
idstring

ID of the element.

dataany

Extra data associated with the element.

labelstring

Label for the element.

subLabelstring

SubLabel for the element.

sizenumber

Size of the element.

labelVisibleboolean

Force label visible or not.

Last updated on