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. Image for the cookie policy date

How to get the details of the diagram?

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?

1 Reply

SG Shyam G Syncfusion Team 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); 

Shyam G 

Live Chat Icon For mobile
Up arrow icon