1 AT_BANNER([pivot table rendering])
3 AT_SETUP([1-d pivot table])
4 AT_DATA([pivot.txt], [[
5 /col "a"*("a1", "a2", "a3")
7 /title "Columns" /display
8 /title "Rows" /transpose.
10 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
31 AT_SETUP([2-d pivot table])
32 AT_DATA([pivot.txt], [[
33 /col "a"("a1", "a2", "a3")
34 /col "b"("b1", "b2", "b3")
36 /title "Columns" /display
37 /title "Rows" /transpose /display
38 /title "Column x Row" /move "a" column /display
39 /title "Row x Column" /transpose
41 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
43 ╭────────┬────────┬────────╮
45 ├──┬──┬──┼──┬──┬──┼──┬──┬──┤
46 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
47 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
48 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
49 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
86 AT_SETUP([2-d pivot table - dimension labels])
87 AT_DATA([pivot.txt], [[
88 /col "a"*("a1", "a2", "a3")
89 /col "b"*("b1", "b2", "b3")
91 /title "Columns" /display
92 /title "Rows - Corner" /transpose /display
93 /title "Rows - Nested" /look rowlabels=nested /display
94 /title "Column x Row - Corner" /move "a" column /look rowlabels=corner /display
95 /title "Column x Row - Nested" /look rowlabels=nested /display
96 /title "Row x Column - Corner" /transpose /look rowlabels=corner /display
97 /title "Row x Column - Nested" /look rowlabels=nested
99 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
101 ╭──────────────────────────╮
103 ├────────┬────────┬────────┤
105 ├────────┼────────┼────────┤
107 ├──┬──┬──┼──┬──┬──┼──┬──┬──┤
108 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
109 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
110 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
111 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
145 Column x Row - Corner
156 Column x Row - Nested
167 Row x Column - Corner
178 Row x Column - Nested
191 AT_SETUP([2-d pivot table - groups])
192 AT_DATA([pivot.txt], [[
193 /col "a"("a1", "ag1"("a2", "a3"))
194 /col "b"("bg1"("b1", "b2"), "b3")
196 /title "Columns" /display
197 /title "Rows" /transpose /display
198 /title "Column x Row" /move "a" column /display
199 /title "Row x Column" /transpose /display
200 /title "Row x Column - delete b2" /cells[all,1]=delete /display
201 /title "Row x Column - delete b2 - show empty" /look empty=show /display
202 /title "Row x Column - delete b1" /cells[all,0]=delete /look empty=hide /display
203 /title "Row x Column - delete b1 - show empty" /look empty=show.
205 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
207 ╭─────────────────┬────────╮
209 ├────────┬────────┤ │
211 ├──┬─────┼──┬─────┼──┬─────┤
212 │ │ ag1 │ │ ag1 │ │ ag1 │
213 │ ├──┬──┤ ├──┬──┤ ├──┬──┤
214 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
215 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
216 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
217 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
261 Row x Column - delete b2
273 Row x Column - delete b2 - show empty
285 Row x Column - delete b1
295 Row x Column - delete b1 - show empty
309 AT_SETUP([2-d pivot table - layers])
310 AT_DATA([pivot.txt], [[
311 /col "a"("a1", "a2", "a3")
312 /layer "b"("b1", "b2", "b3")
314 /title "Column x b1" /display
315 /title "Row x b1" /transpose /display
316 /title "Column x b2" /show layer 1 /transpose /display
317 /title "Row x b2" /transpose /display
318 /title "Column (All Layers)" /look layers=all /display
319 /title "Row (All Layers)" /transpose /look layers=all
321 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
404 AT_SETUP([pivot table title and caption])
405 AT_DATA([pivot.txt], [[
409 /title "Title + Caption" /caption "Title + Caption" /display
410 /title "Title Only" /caption "(Not Shown)" /show title=yes caption=no /display
411 /title "(Not Shown)" /caption "Caption Only" /show title=no caption=yes /display
412 /title "(Not Shown)" /caption "(Not Shown)" /show title=no caption=no
414 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
449 AT_SETUP([pivot table footnotes])
450 AT_KEYWORDS([footnote])
451 AT_DATA([pivot.txt], [[
452 /footnote[0] "First footnote" marker="*"
453 /footnote[1] "Second footnote"
454 /col "A"[footnote 0]*("B"[footnote 1], "C"[footnote 0 1])
455 /row "D"[footnote 1]*("E"[footnote 0], "F"[footnote 1 0])
456 /look rowlabels=nested
458 /cell[1, 0]=1[footnote 0]
459 /cell[0, 1]=2[footnote 1]
460 /cell[1, 1]=3[footnote 0 1]
461 /caption "Caption"[footnote 0]
462 /corner "Corner"[footnote 0 1]
463 /title "Pivot Table with Alphabetic Subscript Footnotes"[footnote 0]
464 /look marker=alpha level=sub
466 /title "Pivot Table with Alphabetic Superscript Footnotes"[footnote 0]
467 /look marker=alpha level=super
469 /title "Pivot Table with Numeric Subscript Footnotes"[footnote 0]
470 /look marker=numeric level=sub
472 /title "Pivot Table with Numeric Superscript Footnotes"[footnote 0]
473 /look marker=numeric level=super
475 /title "Hidden Footnote"[footnote 0]
476 /footnote[0] "First footnote" marker="*" hide
478 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0],
479 [[Pivot Table with Alphabetic Subscript Footnotes[*]
480 ╭────────────┬──────────────────╮
482 │ ├───────┬──────────┤
483 │Corner[*][b]│ B[b] │ C[*][b] │
484 ├────────────┼───────┼──────────┤
485 │D[b] E[*] │ .00│ 1.00[*]│
486 │ F[*][b]│2.00[b]│3.00[*][b]│
487 ╰────────────┴───────┴──────────╯
492 Pivot Table with Alphabetic Superscript Footnotes[*]
493 ╭────────────┬──────────────────╮
495 │ ├───────┬──────────┤
496 │Corner[*][b]│ B[b] │ C[*][b] │
497 ├────────────┼───────┼──────────┤
498 │D[b] E[*] │ .00│ 1.00[*]│
499 │ F[*][b]│2.00[b]│3.00[*][b]│
500 ╰────────────┴───────┴──────────╯
505 Pivot Table with Numeric Subscript Footnotes[*]
506 ╭────────────┬──────────────────╮
508 │ ├───────┬──────────┤
509 │Corner[*][2]│ B[2] │ C[*][2] │
510 ├────────────┼───────┼──────────┤
511 │D[2] E[*] │ .00│ 1.00[*]│
512 │ F[*][2]│2.00[2]│3.00[*][2]│
513 ╰────────────┴───────┴──────────╯
518 Pivot Table with Numeric Superscript Footnotes[*]
519 ╭────────────┬──────────────────╮
521 │ ├───────┬──────────┤
522 │Corner[*][2]│ B[2] │ C[*][2] │
523 ├────────────┼───────┼──────────┤
524 │D[2] E[*] │ .00│ 1.00[*]│
525 │ F[*][2]│2.00[2]│3.00[*][2]│
526 ╰────────────┴───────┴──────────╯
532 ╭────────────┬──────────────────╮
534 │ ├───────┬──────────┤
535 │Corner[*][2]│ B[2] │ C[*][2] │
536 ├────────────┼───────┼──────────┤
537 │D[2] E[*] │ .00│ 1.00[*]│
538 │ F[*][2]│2.00[2]│3.00[*][2]│
539 ╰────────────┴───────┴──────────╯
545 AT_SETUP([pivot table with no dimensions])
546 AT_DATA([pivot.txt], [[
547 /title "No Dimensions"
549 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
556 AT_SETUP([pivot table with empty dimensions])
557 AT_DATA([pivot.txt], [[
560 /title "One Empty Dimension" /display
561 /title "Two Empty Dimensions" /row "b"*() /display
562 /title "Three Dimensions, Two Empty" /row "c"("c1", "c2")
564 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
569 Three Dimensions, Two Empty
573 AT_SETUP([pivot table with empty groups])
574 AT_DATA([pivot.txt], [[
575 /col "a"("a1", "a2"(), "a3")
576 /row "b"("b1"(), "b2", "b3")
581 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
592 AT_SETUP([pivot table - category and dimension borders])
593 AT_DATA([pivot.txt], [[
594 /col "a"("a1", "ag1"("a2", "a3"))
595 /col "b"("bg1"("b1", "b2"), "b3")
596 /row "c"("c1", "cg1"("c2", "c3"))
597 /row "d"("dg1"("d1", "d2"), "d3")
598 /cell[all, all, all, all]
600 /border "dim-row-horz" (solid "blue")
601 "cat-row-horz" (dashed "red")
602 "dim-row-vert" (solid "blue")
603 "cat-row-vert" (dashed "red")
604 "dim-col-horz" (solid "blue")
605 "cat-col-horz" (dashed "red")
606 "dim-col-vert" (solid "blue")
607 "cat-col-vert" (dashed "red")
608 /title "Category and Dimension Borders"
610 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
611 Category and Dimension Borders
615 ╶──┬─────┼──┬─────┼──┬─────
616 │ ag1 │ │ ag1 │ │ ag1
617 ├╌╌┬╌╌┤ ├╌╌┬╌╌┤ ├╌╌┬╌╌
618 a1│a2┊a3│a1│a2┊a3│a1│a2┊a3
619 dg1┊d1│c1 0│ 1┊ 2│ 3│ 4┊ 5│ 6│ 7┊ 8
620 ┊ ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
621 ┊ │cg1┊c2 9│10┊11│12│13┊14│15│16┊17
622 ┊ │ ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
623 ┊ │ ┊c3 18│19┊20│21│22┊23│24│25┊26
624 ├──┼───┴─────┼──┼──┼──┼──┼──┼──┼──┼──
625 ┊d2│c1 27│28┊29│30│31┊32│33│34┊35
626 ┊ ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
627 ┊ │cg1┊c2 36│37┊38│39│40┊41│42│43┊44
628 ┊ │ ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
629 ┊ │ ┊c3 45│46┊47│48│49┊50│51│52┊53
630 ───┴──┼───┴─────┼──┼──┼──┼──┼──┼──┼──┼──
631 d3 │c1 54│55┊56│57│58┊59│60│61┊62
632 ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
633 │cg1┊c2 63│64┊65│66│67┊68│69│70┊71
634 │ ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
635 │ ┊c3 72│73┊74│75│76┊77│78│79┊80
639 AT_SETUP([pivot table - small numbers])
640 AT_DATA([pivot.txt], [[
641 /title "small numbers"
642 /row "exponent"*("0", "-1", "-2", "-3", "-4", "-5", "-6", "-7", "-8", "-9")
643 /col "sign"*("positive", "negative")
644 /col "result class"*("general" RC_OTHER, "specific" RC_RESIDUAL)
648 /cell[3, 0, 0] = .001
649 /cell[4, 0, 0] = .0001
650 /cell[5, 0, 0] = .00001
651 /cell[6, 0, 0] = .000001
652 /cell[7, 0, 0] = .0000001
653 /cell[8, 0, 0] = .00000001
654 /cell[9, 0, 0] = .000000001
657 /cell[2, 0, 1] = -.01
658 /cell[3, 0, 1] = -.001
659 /cell[4, 0, 1] = -.0001
660 /cell[5, 0, 1] = -.00001
661 /cell[6, 0, 1] = -.000001
662 /cell[7, 0, 1] = -.0000001
663 /cell[8, 0, 1] = -.00000001
664 /cell[9, 0, 1] = -.000000001
668 /cell[3, 1, 0] = .001
669 /cell[4, 1, 0] = .0001
670 /cell[5, 1, 0] = .00001
671 /cell[6, 1, 0] = .000001
672 /cell[7, 1, 0] = .0000001
673 /cell[8, 1, 0] = .00000001
674 /cell[9, 1, 0] = .000000001
677 /cell[2, 1, 1] = -.01
678 /cell[3, 1, 1] = -.001
679 /cell[4, 1, 1] = -.0001
680 /cell[5, 1, 1] = -.00001
681 /cell[6, 1, 1] = -.000001
682 /cell[7, 1, 1] = -.0000001
683 /cell[8, 1, 1] = -.00000001
684 /cell[9, 1, 1] = -.000000001
686 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
688 ╭────────┬─────────────────────────────────────╮
690 │ ├───────────────────┬─────────────────┤
691 │ │ general │ specific │
692 │ ├───────────────────┼─────────────────┤
694 │ ├─────────┬─────────┼────────┬────────┤
695 │exponent│ positive│ negative│positive│negative│
696 ├────────┼─────────┼─────────┼────────┼────────┤
697 │0 │ 1.00│ 1.00│ -1.00│ -1.00│
698 │-1 │ .10│ .10│ -.10│ -.10│
699 │-2 │ .01│ .01│ -.01│ -.01│
700 │-3 │ .00│ .00│ .00│ .00│
701 │-4 │ .00│ .00│ .00│ .00│
702 │-5 │1.00E-005│1.00E-005│ .00│ .00│
703 │-6 │1.00E-006│1.00E-006│ .00│ .00│
704 │-7 │1.00E-007│1.00E-007│ .00│ .00│
705 │-8 │1.00E-008│1.00E-008│ .00│ .00│
706 │-9 │1.00E-009│1.00E-009│ .00│ .00│
707 ╰────────┴─────────┴─────────┴────────┴────────╯