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); }
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); }
public StringBuilder SerializeToDotFile(IGraph graph, NodeDisplaySettings nodeSettings = null, EdgeDisplaySettings edgeSettings = null) { return(graph.SerializeToDotFile()); }