Microsoft Automatic Graph Layout FAQ

Do I have control over node positions? Can I request that two nodes should be in the same layer?

This feature has not been implemented yet.

Can a layout be edited by using the viewer?

Yes, see sample Editing.

I have a graph with sub-graphs. Can you layout a graph taking into account sub-graphs and drawing a bounding box around each sub-graph?

This feature has not been implemented.

What is the maximal size of a graph that MSAGL can handle?

Theoretically, there is no limit. In practice, MSAGL is not designed to handle huge graphs. Some MSAGL users were successful in laying out and viewing graphs with 15000 edges. They were doing it on a machine with 4G of RAM, and the waiting time was about 10 minutes. By switching LayoutSettings of the graph to MdsLayoutSettings or RankingLayoutSettings a graph with 50000 elements and more can be processed in a reasonable time.

Can I specify a custom brush for node drawing?

Yes, it can be done by overriding node rendering. See sample NodesWithImages showing how to override node rendering.

Can I set a node label different from its ID?

Yes, use node.Attr.Label.

I need to render a graph on a WEB page. Can MSAGL help here?

Sure. Class Microsoft.Msagl.GraphViewerGDI.GraphRenderer serves this purpose. It can render a graph using just a Graphics object. The only think you need to do is to create a Graphics object and pass it to method Render. See an example here.


Can I associate my data with a node or an edge of the graph?

Use field UserData of Node or Edge.

Where can I read a description of how MSAGL works?

There is a technical report explaining the theory behind the tool.