protected override void WriteAttributes(RootGraph root, StringBuilder builder, int indent) { if (Style.HasValue) { root.WriteIndent(builder, indent).AppendLine($"style = {Style}"); } }
public void WriteChildElements(RootGraph root, StringBuilder builder, int indent) { root.WriteIndent(builder, indent); builder.Append(Id); var attrList = new List <string>(); if (Label != null) { attrList.Add($"label={Label}"); } if (Style.HasValue) { attrList.Add($"style={Style}"); } if (Color != null) { attrList.Add($"color={Color}"); } if (FontColor != null) { attrList.Add($"fontcolor={FontColor}"); } if (Shape != null) { attrList.Add($"shape={Shape}"); } if (Width != null) { attrList.Add($"width={Width}"); } if (Height != null) { attrList.Add($"width={Height}"); } if (attrList.Count > 0) { builder.Append(" ["); builder.AppendJoin(", ", attrList); builder.Append("]"); } builder.AppendLine(); }
protected override void WriteChildElements(RootGraph root, StringBuilder builder, int indent) { root.WriteIndent(builder, indent); builder.Append("subgraph"); if (SubgraphId.HasValue) { builder.Append($" {SubgraphId}"); } builder.AppendLine(" {"); base.WriteChildElements(root, builder, indent + 1); WriteAttributes(root, builder, indent + 1); root.WriteIndent(builder, indent); builder.AppendLine("}"); }
protected virtual void WriteChildElements(RootGraph root, StringBuilder builder, int indent) { foreach (var node in Nodes) { node.WriteChildElements(root, builder, indent); } foreach (var edge in Edges) { edge.WriteChildElements(root, builder, indent); } foreach (var subgraph in Subgraphs) { subgraph.WriteChildElements(root, builder, indent); } foreach (var rank in Ranks) { rank.WriteChildElements(root, builder, indent); } }
protected override void WriteAttributes(RootGraph root, StringBuilder builder, int indent) { if (NewRank != null) { WriteIndent(builder, indent).AppendLine($"newrank = {NewRank}"); } if (RankSep != null) { WriteIndent(builder, indent).AppendLine($"ranksep = {RankSep}"); } if (Size != null) { WriteIndent(builder, indent).AppendLine($"size = {Size}"); } if (Splines != null) { WriteIndent(builder, indent).AppendLine($"splines = {Splines}"); } if (Viewport != null) { WriteIndent(builder, indent).AppendLine($"viewport = {Viewport}"); } if (PageDir != null) { WriteIndent(builder, indent).AppendLine($"pagedir = {PageDir}"); } if (RankDir != null) { WriteIndent(builder, indent).AppendLine($"rankdir = {RankDir}"); } }
void IStatement.WriteChildElements(RootGraph root, StringBuilder builder, int indent) => WriteChildElements(root, builder, indent);
protected virtual void WriteAttributes(RootGraph root, StringBuilder builder, int indent) { }