- Notifications
You must be signed in to change notification settings - Fork320
A set of tools for graph layout and viewing
License
microsoft/automatic-graph-layout
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
MSAGL is a .NET library and tool for graph layout and viewing.
MSAGL was developed in Microsoft by Lev Nachmanson, Sergey Pupyrev, Tim Dwyer, Ted Hart, and Roman Prutkin.
The simplest way to start with MSAGL in C# is to open GraphLayout.sln in Visual Studio and browse the Samples folder.
Note: This repository requires Visual Studio with the UWP (Universal Windows Platform) development workload installed, as well as the Windows 10 SDK. If these are not installed, Visual Studio will recommend installing them when you open the solution. Please ensure these components are installed to successfully build the project.
The Core Layout engine (AutomaticGraphLayout.dll) -NuGet packageThis .NET asssembly contains the core layout functionality. Use this library if you just want MSAGL to perform the layout only and afterwards you will use a separate tool to perform the rendering and visalization.
The Drawing module (AutomaticGraphLayout.Drawing.dll) -NuGet packageThe Definitions of different drawing attributes like colors, line styles, etc. It also contains definitions of a node class, an edge class, and a graph class. By using these classes a user can create a graph object and use it later for layout, and rendering.
A WPF control (Microsoft.Msagl.WpfGraphControl.dll) -NuGet packageThe viewer control lets you visualize graphs and has and some other rendering functionality. Key features: (1) Pan and Zoom (2) Navigate Forward and Backward (3) tooltips and highlighting on graph entities (4) Search for and focus on graph entities.
A Windows Forms Viewer control (Microsoft.Msagl.GraphViewerGdi.dll) -NuGet packageThe viewer control lets you visualize graphs and has and some other rendering functionality. Key features: (1) Pan and Zoom (2) Navigate Forward and Backward (3) tooltips and highlighting on graph entities (4) Search for and focus on graph entities.
The code snippets demonstrate the basic usage of the viewer. It uses the C# language.
Drawing of the graph from the sampleDrawing of the graph from the sample
usingSystem;usingSystem.Collections.Generic;usingSystem.Windows.Forms;classViewerSample{publicstaticvoidMain(){//create a formSystem.Windows.Forms.Formform=newSystem.Windows.Forms.Form();//create a viewer objectMicrosoft.Msagl.GraphViewerGdi.GViewerviewer=newMicrosoft.Msagl.GraphViewerGdi.GViewer();//create a graph objectMicrosoft.Msagl.Drawing.Graphgraph=newMicrosoft.Msagl.Drawing.Graph("graph");//create the graph contentgraph.AddEdge("A","B");graph.AddEdge("B","C");graph.AddEdge("A","C").Attr.Color=Microsoft.Msagl.Drawing.Color.Green;graph.FindNode("A").Attr.FillColor=Microsoft.Msagl.Drawing.Color.Magenta;graph.FindNode("B").Attr.FillColor=Microsoft.Msagl.Drawing.Color.MistyRose;Microsoft.Msagl.Drawing.Nodec=graph.FindNode("C");c.Attr.FillColor=Microsoft.Msagl.Drawing.Color.PaleGreen;c.Attr.Shape=Microsoft.Msagl.Drawing.Shape.Diamond;//bind the graph to the viewerviewer.Graph=graph;//associate the viewer with the formform.SuspendLayout();viewer.Dock=System.Windows.Forms.DockStyle.Fill;form.Controls.Add(viewer);form.ResumeLayout();//show the formform.ShowDialog();}}
More codesamples can be found here…
GraphMaps lets you view very large graphs like oneline maps - as you zoom in more detail is revealed. Watch avideo that shows how GraphMaps works, and here is thevideo of the previous version.
- open GraphLayout.sln and build the solution,
- run TestGraphMaps.
NOTES:
- The configuration Release/x64 needs to be used to load a large graph.
- The graph from the video can be found in GraphLayout/graphs/composers.zip. Please load composers.msagl to avoid the preprocessing step.
- If composers.dot is loaded then composers.msagl and the tiles directory composers.msagl_tiles will beregenerated.
The ideas, design, and the mathematics of GraphMaps are described inthis paper.
WebMSAGL is a version of MSAGL that was transcompiled to JavaScript withSharpKit, plus aTypeScript wrapper and rendering/interaction layer that provides a friendly TypeScript API. You can create a graph either programmatically or from a JSON object, have MSAGL create a layout for it, and then render it to an HTML Canvas or to an SVG block. All layout operations are run in a web worker, ensuring that your application remains responsive while computation is taking place. Limited interactivity is also supported.
- open WebMsagl.sln and build the solution,
- set index.html from any of the sample folders as the starting page,
- run WebMsagl.
This project has adopted theMicrosoft Open Source Code of Conduct. For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.
A release containing the binaries of agl.execan be created automatically by a github action of".github\workflows\agl.yaml'.To invoke the action do the following.Create a new tag in the form "v*". For example, "git tag -av_11 -m "some comment here"". Then execute git push with thistag: "git push origin v_11". These should trigger the releasecreation. Alternatively, you can use python script "createRelease.py",as following "python createRelease.py 1.1.1".
About
A set of tools for graph layout and viewing
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.



