We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the details of the diagram?

Thread ID:

Created:

Updated:

Platform:

Replies:

149681 Dec 5,2019 09:00 AM UTC Dec 6,2019 09:20 AM UTC React - EJ 2 1
loading
Tags: Diagram
john
Asked On December 5, 2019 09:00 AM UTC

How to get the details(data) of the diagram?
Like relationship between the nodes.
What property can I use? I tried with console.log(addInfo).
It returns undefined. Can you explain it with example?
Thanks.

Shyam G [Syncfusion]
Replied On December 6, 2019 09:20 AM UTC

Hi John, 
 
When you select a node in the diagram, click event gets raised. In this event, you will get a selected node object. Also, the node’s inEdges and outEdges property is used to read collection of the incoming and outgoing connectors of the node. Please refer to a code example and sample below. Please refer our help documentation to know more about diagram control. 
 
Code example: 
  <DiagramComponent id="diagram" width={"100%"} height={"700px"} 
                //diagram instance 
                  ref={diagram => (diagramInstance = diagram)} 
                  nodes={nodes} connectors={connectors} 
                 //click event 
                  click={function (args) { 
                    //to get an diagram element 
                    let diagram = diagramInstance 
                    if (args.element) { 
                      //to get a selected node 
                      let node = args.element; 
                      //get an connected element 
                      console.log(node.inEdges, node.outEdges); 
                    } 
                  }} 
                /> 
 
 


 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon