Skip to content

<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).

Stories in the playground·packages/notatio-lit/src/notatio-figure.ts· in Vue: <Figure>

Attributes

AttributeTypeDefaultNotes
kindstring""Which glyph to draw: permutation, partition, composition, subset or dyck.reflects
valuestring""The element as an integer list, [3,1,2] or 3,1,2.
nnumber | undefinedundefinedGround-set size, where the glyph needs one beyond the element itself.
svgstring""Raw SVG to render instead of a generated glyph.