Ejemplo n.º 1
0
        void RenderLegend(IEnumerable <GraphLegend> legend,
                          HashSet <String> cssClasses,
                          float x,
                          float y)
        {
            SvgGroup legendGroup = this.doc.AddGroup(null);

            foreach (GraphLegend legendItem in legend)
            {
                bool CssClassUsed() => cssClasses.Contains(legendItem.CssClass);

                void RenderLegendItem()
                {
                    SENode node = new SENode {
                        Class = legendItem.CssClass
                    };

                    node.AddTextLine(legendItem.Item);

                    Render(legendGroup,
                           node,
                           x,
                           y,
                           null,
                           out float width,
                           out float height);
                    x = x + width + this.NodeGapX;
                    float bottom = y + height;

                    if (this.maxX < x)
                    {
                        this.maxX = x;
                    }
                    if (this.maxY < bottom)
                    {
                        this.maxY = bottom;
                    }
                }

                if (CssClassUsed())
                {
                    RenderLegendItem();
                }
            }
        }
Ejemplo n.º 2
0
        protected SENode CreateNodeBinding(ElementDefinition.ElementDefinitionBindingComponent binding)
        {
            String hRef = null;
            SENode node = new SENode()
            {
                HRef = hRef
            };

            node.Class = "valueSet";

            String displayName = binding.ValueSet.LastPathPart();

            if (this.TryGetValueSet(binding.ValueSet, out ValueSet vs) == false)
            {
                displayName = vs.Name;
            }
            node.AddTextLine(displayName, hRef);
            node.LhsAnnotation = "bind";
            return(node);
        }
Ejemplo n.º 3
0
        protected SENode CreateNode(GraphNode graphNode)
        {
            SENode node = new SENode
            {
                HRef = graphNode.HRef
            };

            node.Class = graphNode.CssClass;

            String displayName = graphNode.DisplayName;

            //Debug.Assert(displayName != "Breast/Radiology/Composition");

            foreach (String titlePart in displayName.Split('/'))
            {
                String s = titlePart.Trim();
                node.AddTextLine(s, graphNode.HRef);
            }

            node.SortPrefix    = graphNode.SortPrefix;
            node.LhsAnnotation = ResolveAnnotation(graphNode, graphNode.LhsAnnotationText);
            node.RhsAnnotation = ResolveAnnotation(graphNode, graphNode.RhsAnnotationText);
            return(node);
        }