How to disable default tooltips for node and connector in React Diagram
This article explains how to disable default tooltips for node and connector in React Diagram.
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:
let node = [{
id: "node1",
offsetX: 350,
offsetY: 150,
width: 100,
height: 100,
annotations: [{
id: 'label',
content: 'Default tooltip disabled',
}],
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
},
}];
var connector =
[{
id: "connector1",
type: 'Straight',
sourcePoint: {x: 100, y: 100},
targetPoint: {x: 200, y: 200},
annotations: [
{
content: 'Default tooltip disabled',
visibility: true
},
],
}];
<DiagramComponent id="container" width={'650px'} height={'350px'}
// Disable tooltip
selectedItems={{ constraints: SelectorConstraints.All & ~SelectorConstraints.ToolTip }}
// Define nodes
nodes={node}
connectors={connector}
/>
Refer to the working sample for additional details and implementation: Sample
Conclusion
We hope you enjoyed learning about how to disable default tooltips for nodes and connectors in React Diagram.
You can refer to our React 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 React 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 explore 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, BoldDesk Support, or feedback portal. We are always happy to assist you!