Articles in this section
Category / Section

How to disable default tooltips for node and connector in TypeScript Diagram

2 mins read

By default, when you interact with a node or connector in the diagram—such as dragging, resizing, or rotating—you’ll see a tooltip that displays information, including the node’s position, size and angle.
If you’d like to disable the default tooltip that appears while interacting with nodes or connectors, it can be disabled by removing the tooltip constraints from the SelectorConstraints of the selectedItems property of the diagram.
Below is a code example demonstrating how to disable the default tooltip

// Initializes the diagram component
let nodes: NodeModel[] = [{
 // Position of the node
 offsetX: 250,
 offsetY: 250,
 // Size of the node
 width: 100,
 height: 100,
}]
let connectors: ConnectorModel[] = [{
 id: 'con1',
 sourcePoint: { x: 300, y: 100 },
 targetPoint: { x: 400, y: 250 },
}]
// Initialize diagram
let diagram: Diagram = new Diagram(
 {
   width: '100%',
   height: '350px',
   selectedItems: {
     // To disable default tooltip
     constraints: SelectorConstraints.All & ~SelectorConstraints.ToolTip,
   },
   // Defines nodes
  nodes:nodes,
  connectors:connector
 },
 '#element'
);

Sample

Conclusion
I hope you enjoyed learning about how to disable default tooltips for nodes and connectors in the TypeScript Diagram.

You can refer to our JavaScript Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our JavaScript Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied