public SvgRoot RenderDiagram(ClassDiagram classDiagram)
        {
            _diagramWidth = CalculateDiagramWidth(classDiagram);
            _svgRoot      = new SvgRoot(100, _diagramWidth);

            var rect = new SvgRectangle(_svgRoot, 0.5, 0.5, _diagramWidth - 1, 100);

            rect.StrokeWidth = 1;
            rect.Stroke      = "#979797";
            rect.Fill        = "#FFFFFF";
            _svgRoot.AppendChild(rect.XmlElement);

            double position = 20.5d;

            position = RenderHeader(classDiagram, position);
            position = RenderAllRowSections(classDiagram, position);

            rect.Height     = position - 9.5;
            _svgRoot.Height = position - 5;
            return(_svgRoot);
        }
        private double RenderHeader(ClassDiagram classDiagram, double position)
        {
            var accessibility = new SvgText(_svgRoot, classDiagram.Accessibility, (_diagramWidth - classDiagram.Accessibility.GetWidth(11, Fonts.FontItalic)) / 2, position);

            accessibility.FontSize = 11;

            var name = new SvgLink(_svgRoot, classDiagram.Name, string.Format("{{{{type-link:{0}}}}}", classDiagram.TypeIdentifier), (_diagramWidth - classDiagram.Name.GetWidth(14, Fonts.FontLight)) / 2, position += 20);

            name.Text.FontSize = 14;

            position += 15;

            var path = new SvgPath(_svgRoot, string.Format("M0.5,{0}L{1},{0}", position.ToString("0.00", CultureInfo.InvariantCulture), _diagramWidth.ToString("0.00", CultureInfo.InvariantCulture)));

            path.StrokeWidth = 1;
            path.Stroke      = "#979797";

            _svgRoot.AppendChild(accessibility.XmlElement);
            _svgRoot.AppendChild(name.XmlElement);
            _svgRoot.AppendChild(path.XmlElement);

            return(position + 25);
        }
        private void DrawNode(SequenceDiagramNode node)
        {
            var textWidth    = node.Text.GetWidth(12, Fonts.FontLight);
            var textPosition = new Point(_diagramSize.Width, 10);
            var textSize     = new Size(textWidth + 20, 35);

            _diagramSize = new Size(_diagramSize.Width + textWidth + 40, _diagramSize.Height);

            var rectangle = new SvgRectangle(_svgRoot, textPosition.X, textPosition.Y, textSize.Width, textSize.Height);

            rectangle.StrokeWidth = 1;
            rectangle.Stroke      = "#979797";
            rectangle.Fill        = "#FFFFFF";

            var link = new SvgLink(_svgRoot, node.Text, string.Format("{{{{type-link:{0}}}}}", node.TypeIdentifier), textPosition.X + 15, textPosition.Y + 22);

            link.Text.FontSize = 12;

            _svgRoot.AppendChild(rectangle.XmlElement);
            _svgRoot.AppendChild(link.XmlElement);

            _nodeMiddlePoints.Add(node.ID, textSize.Width / 2 + textPosition.X);
        }