Permutation strand diagram
Slot i on the in row is joined to slot image[i] on the out row — the one-line word 3 1 2. It is a Show of a StrandDiagram; the true bracketed matrix is MatrixForm, a TeX representation still to come.
Pictorial representations of combinatorial values. A value draws as the Show of its frame layer by default: Permutation([3, 1, 2]) is Show(StrandDiagram(Permutation([3, 1, 2]))). The examples below write those Shows out, sized to the line.
A frame's parts are addresses that rules color and a click picks, so every layer takes ColorRules, BoundaryStyle and Selection:
| values | layer | address | properties | parts | relations to the pick |
|---|---|---|---|---|---|
Permutation, SetPartition, Diagram | StrandDiagram | (slot, level) | In, Out, Through, Cap, Cup, Loop, Crossing | Slot, Level, Block, Image | SameBlock, Crosses, Adjacent |
IntegerPartition, StandardTableau, Composition, Subset | CellDiagram | (row, column) | Filled, Corner, InFirstRow, InFirstColumn, Entry | Row, Column, Content, Hook, Arm, Leg, Entry, Part | SameRow, SameColumn, SameContent, Hook, Adjacent |
PlaneTree, BinaryTree | TreeDiagram | (depth, order) | Leaf, Root, Internal | Depth, Order, Children, SubtreeSize | Ancestor, Descendant, Subtree, Sibling, Adjacent |
DyckPath, LatticePath | PathDiagram | (step, height) or (x, y) | Peak, Valley, Return, Up, Down; East, North, Corner | Step, Height, X, Area | SameHeight, SameColumn, Adjacent, Tunnel |
| polytopes | PolytopeFaces | (dimension, index) | Vertex, Edge, Ridge, Facet, Interior, Top | Dimension, VertexCount, Valence, Index, Depth | FaceOf, Cofaces, Incident, Adjacent, SameDimension |
A polytope is no glyph, but the same kind of frame: its layer sits under a camera instead of a fixed view.
A picture's default look themes from --notatio-accent / --notatio-border / --notatio-fg.
Slot i on the in row is joined to slot image[i] on the out row — the one-line word 3 1 2. It is a Show of a StrandDiagram; the true bracketed matrix is MatrixForm, a TeX representation still to come.
n sets how many cells to draw; members are filled (Filled), the rest are cells too. Without it, n defaults to the largest member. A CellDiagram of Subset([1, 3], 6).
The Ferrers shape of the partition, its cells numbered 1…n in reading order — the superstandard filling, always a valid standard Young tableau (rows increase rightward, columns downward). A CellDiagram of StandardTableau; each cell's Entry is its number.
value[i] is the block of element i+1 (a restricted-growth string). Each block draws as a pill (a chain of joined slots) over its elements — [0,0,1,0,2] is {1,2,4} {3} {5}.
A monotone staircase of unit steps east (0) and north (1) across the grid it spans; counts C(a+b, a). A PathDiagram of LatticePath: its points are the addresses (x, y), its steps the links.
1 is an internal node (always two children), 0 a leaf, listed in preorder. A TreeDiagram of its tidy layout: leaves take sequential x, each internal node sits over the mean of its children, and a node's address is its (depth, order). The five shapes of size 3 (Catalan again):
tree reads each entry as that node's number of children, so any rooted ordered tree draws: here a root with three children, the middle one a cherry, the last a chain.
Written as a Show, a cell, tree or path figure is picked and styled the way a lattice's tiles are: a click selects an address (shift-click adds more), and a rule's test reads the pick through a relation. CellDiagram, TreeDiagram and PathDiagram are the layers; with no rules they draw the look of the figure they stand for. Their data is an IntegerPartition, StandardTableau, Composition, Subset, PlaneTree, BinaryTree, DyckPath or LatticePath. Cell addresses count from 1; tree and path addresses from 0.
Hook(Selected) lights the cell and the cells right of it and below it; the tooltip gives its hook length. Corner marks the removable cells.
<Show Variables="[_s -> Variable(Automatic, [])]" Selection="_s" ImageSize="[Automatic, 200]">
<CellDiagram
ColorRules="[Selected -> Gold, Hook(Selected) -> Red, Corner -> Green, Filled -> Opacity(0.2, Gray)]"
BoundaryStyle="[
Hook(Selected) -> Directive(Red, AbsoluteThickness(2)),
True -> Directive(Gray, AbsoluteThickness(1))
]"
>
<IntegerPartition>
<ToExpression value="[5, 3, 3, 1]" />
</IntegerPartition>
</CellDiagram>
</Show>Subtree(Selected) is the picked node and everything under it; Ancestor(Selected) the nodes above.
<Show Variables="[_s -> Variable(Automatic, [])]" Selection="_s" ImageSize="[Automatic, 200]">
<TreeDiagram
ColorRules="[
Selected -> Gold,
Subtree(Selected) -> Orange,
Ancestor(Selected) -> Gray,
Leaf -> Opacity(0.5, Teal),
True -> Opacity(0.16, Teal)
]"
>
<PlaneTree>
<ToExpression value="[3, 0, 2, 0, 2, 0, 0, 1, 2, 0, 0]" />
</PlaneTree>
</TreeDiagram>
</Show>SameHeight(Selected) lights the points level with the pick; Tunnel(Selected) the ends of the matching up and down steps of the step arriving there. Peaks are gold, valleys teal.
<Show Variables="[_s -> Variable(Automatic, [])]" Selection="_s" ImageSize="[Automatic, 150]">
<PathDiagram
ColorRules="[
Selected -> White,
Tunnel(Selected) -> Red,
SameHeight(Selected) -> Orange,
Peak -> Gold,
Valley -> Teal,
True -> Gray
]"
>
<DyckPath>
<ToExpression value="[1, 1, 0, 1, 1, 0, 0, 1, 0, 0]" />
</DyckPath>
</PathDiagram>
</Show>