You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+17-28Lines changed: 17 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,50 +6,39 @@
6
6
7
7
# WPF Diagram Control - Microsoft Automatic Graph Layout (MSAGL) Algorithms
8
8
9
-
This example connects the [Microsoft Automatic Graph Layout (MSAGL)](https://github.com/Microsoft/automatic-graph-layout) library to[`DiagramControl`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Diagram.DiagramControl). This technic allows you apply advanced algorithms such as **Sugiyama**, **Ranking**, **PhyloTree**, **MDS**, or **Disconnected Graphs** with one click.
9
+
This example integrates custom layout algorithms with[`DiagramControl`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Diagram.DiagramControl). You can extract a graph from the diagram, process the graph with an external algorithm, and apply calculated positions back to diagram items. This technic allows you apply advanced or custom algorithms with one click.
10
10
11
11

12
12
13
13
## Implementation Details
14
14
15
-
### Load Sample Graph
15
+
### Extract Current Graph
16
16
17
-
The application loads a diagram from an XML file before applying a layout. This example includes five datasets: **Sugiyama**, **Ranking**, **PhyloTree**, **MDS**, and **Disconnected Graphs**.
17
+
Use the `GraphOperations.GetDiagramGraph` method to extract the current diagram. The method returns a `Graph` object that contains the collections of nodes and edges represented by diagram items:
// … similar for Ranking, PhyloTree, DisconnectedGraphs
20
+
GraphOperations.GetDiagramGraph(diagramControl);
27
21
```
28
22
29
-
### Extract and Arrange Nodes
23
+
### Create Position Info
30
24
31
-
The `GraphOperations.GetDiagramGraph` extracts nodes and edges from the diagram. The selected MSAGL calculator computes positions, which are then applied to the diagram:
25
+
For each shape, create a `PositionInfo` object that contains a reference to the shape and its calculated position:
0 commit comments