Giter VIP home page Giter VIP logo

automatic-graph-layout's Introduction

Microsoft Automatic Graph Layout

A set of tools for graph layout and viewing

The simplest way to start with MSAGL in C# is to open GraphLayout.sln in Visual Studio 2013, and have a look at Samples there.

MSAGL is a .NET tool for graph layout and viewing. It was developed in Microsoft by Lev Nachmanson, Sergey Pupyrev, Tim Dwyer and Ted Hart. MSAGL is available as open source at https://github.com/Microsoft/automatic-graph-layout.git.

The Distribution Content and Important Features

The package contains the following:

  • Layout engine (Microsoft.MSAGL.dll) - The core layout functionality. This component can be used directly in cases when visualization is handled by a tool other than MSAGL.
  • Drawing module (Microsoft.MSAGL.Drawing.dll) - The 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.
  • Viewer control (Microsoft.MSAGL.GraphViewerGDIGraph.dll) - The viewer control, and some other rendering functionality.

Some important features of the viewer are:

  • Pan and Zoom of the graph.
  • Forward and Backward navigation.
  • Ability to configure tooltips and highlighting of graph entities.
  • Ability to search for and focus on entities of the graph.

#Code Samples The code snippet demonstrates the basic usage of the viewer. It uses the C# language.

##The Viewer sample Drawing of the graph from the sampleDrawing of the graph from the sample

Drawing of the graph from the sampleDrawing of the graph from the sample

using System;
using System.Collections.Generic; 
using System.Windows.Forms; 
class ViewerSample { 
    public static void Main() { 
    //create a form 
        System.Windows.Forms.Form form = new System.Windows.Forms.Form(); 
    //create a viewer object 
        Microsoft.Msagl.GraphViewerGdi.GViewer viewer = new Microsoft.Msagl.GraphViewerGdi.GViewer(); 
    //create a graph object 
        Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("graph"); 
    //create the graph content 
        graph.AddEdge("A", "B");
        graph.AddEdge("B", "C"); 
        graph.AddEdge("A", "C").EdgeAttr.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.Node c = graph.FindNode("C");  
        c.Attr.Fillcolor = Microsoft.Msagl.Drawing.Color.PaleGreen;
        c.Attr.Shape = Microsoft.Msagl.Drawing.Shape.Diamond; 
    //bind the graph to the viewer 
        viewer.Graph = graph; 
    //associate the viewer with the form 
        form.SuspendLayout(); 
        viewer.Dock = System.Windows.Forms.DockStyle.Fill; 
        form.Controls.Add(viewer); 
        form.ResumeLayout(); 
    //show the form 
        form.ShowDialog(); 
    } 
}

More code samples…

#Layouts Created by MSAGL

automatic-graph-layout's People

Contributors

cgravill avatar filiprychnavsky avatar levnach avatar mo avatar reubenbond avatar selvasingh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.