Articles in this section
Category / Section

How to Set the Cursor to the Diagram Node in Angular?

2 mins read

In Syncfusion® Angular Diagram by dynamically changing the cursor style based on user interactions, specifically changing to a pointer when hovering over nodes and to a grabbing hand when hovering over empty spaces.

onMouseMove event changes the cursor style based on the mouse position.
If the mouse is over a node, the cursor changes to a pointer .
If the mouse is over the empty space of the diagram, the cursor changes to grabbing, indicating that the diagram can be panned.

onMouseMove(event: MouseEvent): void {
    var diagram = this.diagram;
    var diagramCanvas = document.getElementById(diagram.element.id + 'content');
    if ((event.target as any).id != 'diagram_diagramLayer_svg') {
      diagramCanvas.style.cursor = 'pointer';
    }
    else {
      diagramCanvas.style.cursor = 'grabbing';
    }
  }

Sample:

Click here For Sample

Conclusion
I hope you enjoyed learning how to set the cursor to the Diagram Node in Angular.

You can refer to our Angular 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 Angular 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