<notatio-figure>
Parse a MathJSON-ish integer list from an attribute: [3,1,2] or 3,1,2. */ function parseList(value: string): number[] { const text = value.trim(); if (!text) return []; try { const parsed = JSON.parse(text.startsWith("[") ? text : [${text}]); if (Array.isArray(parsed)) return parsed.map(Number).filter((x) => Number.isFinite(x)); } catch { // fall through to an empty glyph rather than throwing in render } return []; }
/** <notatio-figure kind="permutation" value="[3,1,2]"> -- renders a combinatorial element as an inline SVG glyph. kind is one of permutation, partition, composition, subset, dyck, tree (preorder child-count word), binary-tree (preorder shape word, 1 = internal); value is the element as an integer list. subset also reads n (the ground-set size). Pass a ready-made svg string instead to render it verbatim (the generic escape hatch).
Attributes
| Attribute | Type | Default | Notes |
|---|---|---|---|
kind | string | "" | Which glyph to draw: permutation, partition, composition, subset or dyck.reflects |
value | string | "" | The element as an integer list, [3,1,2] or 3,1,2. |
n | number | undefined | undefined | Ground-set size, where the glyph needs one beyond the element itself. |
svg | string | "" | Raw SVG to render instead of a generated glyph. |