Center the graph in the viewport when the graph is updated.
Automatically zoom the graph to fit in the avialable viewport when the graph is updated.
List of cluster nodes.
Enable dragging nodes.
List of graph edges.
List of graph nodes.
Executed when user clicks on a link. Emits IDs of the source and target nodes.
Executed when user clicks on a node.
Show/hide minimap.
<drayman-ngx-graph />
Graph powered by ngx-charts library.
Example of usage
Simple graph
export const component: DraymanComponent = async ({ forceUpdate }) => { const links = [{ id: 'a', source: 'first', target: 'second', label: 'is parent of' }, { id: 'b', source: 'first', target: 'third', label: 'custom label' }]; return () => ( <div style={{ height: '300px', width: '300px' }}> <button onClick={async () => { links.push({ id: `new-link-${links.length}`, source: 'first', target: 'third', label: 'new link' }) await forceUpdate(); }} >Add link</button> <drayman-ngx-graph showMiniMap links={links} nodes={[{ id: 'first', label: 'A' }, { id: 'second', label: 'B' }, { id: 'third', label: 'C', data: { customColor: 'orange' } }]} /> </div> ); }