示例#1
0
        public static void Test()
        {
            Graph g = new Graph();

            g.RankDirection = RankDirection.LeftRight;

            Node a = new Node()
            {
                Label     = "A",
                Style     = NodeStyle.Dashed | NodeStyle.Filled | NodeStyle.Bold,
                FillColor = Color.Lime,
                Shape     = NodeShape.Box
            };

            Node b = new Node()
            {
                Label     = "B",
                FontColor = Color.Blue,
                Shape     = NodeShape.Circle,
            };

            var c = new Cluster()
            {
                Label = "A cluster",
            };

            c.AddNodes(b);

            g.AddNodes(a);
            g.AddClusters(c);

            var e = new Edge(a, b)
            {
                Label = "An edge",
                Style = EdgeStyle.Dashed | EdgeStyle.Bold,
                Color = Color.DarkRed
            };

            g.AddEdges(e);

            Console.WriteLine(g);
            g.Display();
        }