Tools
Previous
Connection Points
Next
Group
Loading...
When creating nodes/edges, you can add tools through the tools
option:
graph.addNode({tools: [{name: 'button-remove', // Tool nameargs: {// Parameters corresponding to the toolx: 10,y: 10,},},],})// If the parameters are empty, it can be abbreviated as:graph.addNode({tools: ['button-remove'],})graph.addEdge({source,target,vertices: [{x: 90,y: 160,},{x: 210,y: 160,},],tools: ['vertices', 'segments'],})
After nodes/edges are created, you can call methods like hasTool(name), addTools(...), and removeTools() to add or remove tools.
Tools are widgets rendered on nodes/edges to enhance their interactivity. We provide the following built-in tools for nodes and edges: