API Reference
This reference documents all components, props, and options available in Diagrammatic-UI.
Components
The main container component for rendering graph visualizations.
Props
dataGraphDataRequiredThe graph data containing nodes and edges to visualize.
widthnumberDefault: 800Width of the graph canvas in pixels.
heightnumberDefault: 600Height 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'.
nodeStyleConfigNodeStyleConfigConfiguration object for styling nodes.
edgeStyleConfigEdgeStyleConfigConfiguration object for styling edges.
interactionOptionsInteractionOptionsOptions for controlling user interactions with the graph.
Event Handlers
onNodeClick(nodeId: string) => voidCallback fired when a node is clicked.
onNodeHover(nodeId: string | null) => voidCallback fired when a node is hovered or hover ends (null).
onEdgeClick(edgeId: string) => voidCallback fired when an edge is clicked.
onSelectionChange(selection: { nodes: string[], edges: string[] }) => voidCallback fired when the selection changes.
onLayoutComplete() => voidCallback fired when the layout calculation completes.