Пример #1
0
        public DotHtmlTable SimpleTable(IEnumerable <KeyValuePair <string, IDotHtmlLabel> > tableContents)
        {
            var table =
                DotUtils.Table()
                .SetBorder(0);

            //Add a row with a single cell and port name for each entry
            table
            .AddRows(
                tableContents.Select(
                    item =>
                    DotUtils.Cell()
                    .SetContents(item.Value)
                    .SetPort(item.Key)
                    )
                );

            //Set common attributes of added cells
            foreach (var row in table.Skip(1))
            {
                row.FirstCell
                .SetBorder(1)
                .SetSides(DotSides.Top);
            }

            return(table);
        }
Пример #2
0
        private DotNode AddBasisBlades(AstFrame frame)
        {
            var innerTable =
                DotUtils.Table()
                .SetBorder(0);

            innerTable
            .AddRow()
            .AddCells("Grade", "Index", "ID", "Name", "Indexed Name", "Binary Name", "Grade + Index Name");

            foreach (var cell in innerTable.FirstRow)
            {
                cell
                .SetBorder(1)
                .SetSides(DotSides.Top, DotSides.Bottom);
            }

            for (var grade = 0; grade <= frame.VSpaceDimension; grade++)
            {
                var n = frame.KvSpaceDimension(grade);

                for (var index = 0; index < n; index++)
                {
                    var basisBlade = frame.BasisBlade(grade, index);

                    innerTable
                    .AddRow()
                    .AddCells(
                        basisBlade.Grade.ToString(),
                        basisBlade.Index.ToString(),
                        basisBlade.BasisBladeId.ToString(),
                        basisBlade.Name,
                        basisBlade.IndexedName,
                        basisBlade.BinaryIndexedName,
                        basisBlade.GradeIndexName
                        );
                }
            }

            var table =
                DotUtils.Table()
                .SetBorder(0);

            table.AddRows(
                DotUtils.Cell().SetContents("Basis Blades".Bold()),
                DotUtils.Cell().SetContents(innerTable)
                );

            var node =
                Graph
                .AddNode("Basis Blades")
                .SetLabel(table);

            Graph.AddEdge("Inner Product Matrix", "Basis Blades");

            return(node);
        }
Пример #3
0
        public DotHtmlTable Table(string iconName, IDotHtmlLabel titleContents)
        {
            var table =
                DotUtils.Table()
                .SetBorder(0);

            table.AddRow(
                DotUtils.ImageCell(Path.Combine(IconsPath, iconName + "64.png")),
                DotUtils.Cell().SetContents(titleContents)
                );

            return(table);
        }
Пример #4
0
        private DotNode AddIpm(AstFrame frame)
        {
            var innerTable =
                DotUtils.Table()
                .AddRows(frame.VSpaceDimension + 1, frame.VSpaceDimension + 1)
                .SetBorder(0);

            var vectorsNames =
                frame.BasisVectors.Select(item => item.Name).ToArray();

            var ipm = frame.GetInnerProductMatrix();

            for (var row = 0; row < frame.VSpaceDimension; row++)
            {
                innerTable[row + 1][0].SetContents(vectorsNames[row]);
                innerTable[0][row + 1].SetContents(vectorsNames[row]);

                for (var col = 0; col < frame.VSpaceDimension; col++)
                {
                    innerTable[row + 1][col + 1].SetContents(ipm[row, col].ToString());
                }
            }

            var table =
                DotUtils.Table()
                .SetBorder(0);

            table.AddRows(
                DotUtils.Cell().SetContents("Inner Product Matrix".Bold()),
                DotUtils.Cell().SetContents(innerTable)
                );

            var node =
                Graph
                .AddNode("Inner Product Matrix")
                .SetLabel(table);

            Graph.AddEdge(frame.AccessName, node.NodeName);

            return(node);
        }