예제 #1
0
        public StringBuilder Serialize(IGraph g, NodeDisplaySettings nodeSettings = null, EdgeDisplaySettings edgeSettings = null)
        {
            StringBuilder result = new StringBuilder();

            nodeDisplaySettings = nodeSettings;
            edgeDisplaySettings = edgeSettings;

            BuildTables(g);
            graph = g;

            result.Append(FilePrologue);
            result.Append(GenerateNodesElement());
            result.Append(GenerateEdgesElement());
            //stream.Write(GenerateAnnotationsElement(g));
            result.Append(FileEpilogue);

            return(result);
        }
예제 #2
0
        public static StringBuilder SerializeToDotFile(this IGraph graph, NodeDisplaySettings nodeSettings = null, EdgeDisplaySettings edgeSettings = null)
        {
            StringBuilder result = null;

            if (IsDirectedGraph(graph))
            {
                DirectedGraphDotFileSerializer sr = new DirectedGraphDotFileSerializer(graph);
                result = sr.Serialize();
                // TODO node & edge settings
            }
            else
            {
                UndirectedGraphDotFileSerializer sr = new UndirectedGraphDotFileSerializer();
                result = sr.Serialize(graph, nodeSettings, edgeSettings);
            }

            return(result);
        }
예제 #3
0
 public StringBuilder SerializeToDotFile(IGraph graph, NodeDisplaySettings nodeSettings = null, EdgeDisplaySettings edgeSettings = null)
 {
     return(graph.SerializeToDotFile());
 }