API Reference
This reference documents all components, props, and options available in Diagrammatic-UI.
Components
The main container component for rendering graph visualizations.
Props
data
GraphData
RequiredThe graph data containing nodes and edges to visualize.
width
number
Default: 800
Width of the graph canvas in pixels.
height
number
Default: 600
Height of the graph canvas in pixels.
theme
'light' | 'dark'
Default: 'light'
Color theme for the graph visualization.
autoLayout
'force' | 'circular' | 'tree' | 'spiral' | 'donut' | 'grid'
Default: 'force'
Algorithm to use for automatically positioning nodes.
direction
'horizontal' | 'vertical'
Default: 'vertical'
Direction for hierarchical layouts like 'tree'.
nodeStyleConfig
NodeStyleConfig
Configuration object for styling nodes.
edgeStyleConfig
EdgeStyleConfig
Configuration object for styling edges.
interactionOptions
InteractionOptions
Options for controlling user interactions with the graph.
Event Handlers
onNodeClick
(nodeId: string) => void
Callback fired when a node is clicked.
onNodeHover
(nodeId: string | null) => void
Callback fired when a node is hovered or hover ends (null).
onEdgeClick
(edgeId: string) => void
Callback fired when an edge is clicked.
onSelectionChange
(selection: { nodes: string[], edges: string[] }) => void
Callback fired when the selection changes.
onLayoutComplete
() => void
Callback fired when the layout calculation completes.