protected override void WriteAttributes(RootGraph root, StringBuilder builder, int indent) { if (Style.HasValue) { root.WriteIndent(builder, indent).AppendLine($"style = {Style}"); } }
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("}"); }
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(); }