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