For a given diagram, is there an easy way to walk the diagram and determine, for each shape, what the interconnects are between that shape and any other shape and on what shape nodes? For the example, in the attached workflow diagram, there are 5 shapes with interconnects as follows:
- Shape A connects TO Shape B
- Shape B connects TO Shape D
- Shape B connects TO Shape C
- Shape C connects TO Shape A
- Shape D connects TO Shape E
Ideally, I need to be able to divine, for each shape, all interconnects to/from other shapes along with the specific connection node and the direction of flow (based on start cap/end cap). I have examined the diagram object of a sample workflow and the info I'm looking for appears to all be there but it putting it all together seems to be quite convoluted. Is there perhaps a working example available that demonstrates some of what I'm attempting to do?
5 Answers, 1 is accepted
The Kendo Diagram widget of RadDiagram has a pretty rich API, allowing you to get reference to almost each collection of the control (like shapes, its connectors and connections). You can examine all available public members of the widget here:
For example, you can use the following snippet as a base for your implementation for traversing through the connectors of all shapes and the connections assigned to them:
Thanks Vessy. I was making things much harder than I needed to - your example was very straight-forward.
At the risk of asking a question that may be considered "off thread", is there a way to designate a connection node as being "from only" or "to only" (i.e. connections can only go one direction)? For my workflow decision block shape, I have graphically labeled one node as being the task's input (inbound only), another being "Approved" (outbound only) and another being "Rejected" (outbound only).
I am afraid that the diagram does not have such built-in funtionality to restrict/set the orientation of the connections. The optimal solution I can suggest you to set the endCap of the connectins and determine their orientation depending on the given value:
spacing. In this case all shapes had same clearance. But I want to management the clearances for every shape. How can I get this? Do I have to use the constraint manager?
The Diagram allows to control the spacing between the shapes by configuring the HorizontalSeparation and VerticalSeparation properties under LayoutSettings, but this applies to all shapes, not only specific ones:
The only way to position each shape on a specific place at the moment is to set its X and Y coordinates (making the shape not draggable, though):