How to disable default tooltips for node and connector in JavaScript Diagram
By default, when you interact with node or connector in the diagram- such a 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 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
var nodes = [
{
id: 'node1',
width: 100,
height: 100,
annotations: [
{
id: 'label',
content: 'Default tooltip disabled',
}
],
offsetX: 350,
offsetY: 150,
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
},
],
}];
//Initialize diagram
let diagram = new ej.diagrams.Diagram(
{
width: '100%',
height: '350px', nodes: nodes, connectors: connector,
selectedItems: {
//To disable default tooltip
constraints:
ej.diagrams.SelectorConstraints.All &
~ej.diagrams.SelectorConstraints.ToolTip,
},
},
'#element'
);
Conclusion
I hope you enjoyed about how to disable default tooltips for node and connector in JavaScript Diagram.
You can refer to our JavaScript Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for 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!