compasso 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -7
- package/dist/chunk-F47C6ZEB.js +1041 -0
- package/dist/chunk-F47C6ZEB.js.map +1 -0
- package/dist/chunk-JP4N42AY.js +497 -0
- package/dist/chunk-JP4N42AY.js.map +1 -0
- package/dist/{chunk-P2S7AUOL.js → chunk-LRHHUJFZ.js} +3 -3
- package/dist/{chunk-P2S7AUOL.js.map → chunk-LRHHUJFZ.js.map} +1 -1
- package/dist/{chunk-5B453C4P.js → chunk-O3BT2O42.js} +32 -3
- package/dist/chunk-O3BT2O42.js.map +1 -0
- package/dist/{chunk-EHQMKVDM.js → chunk-Q6DVTCXD.js} +9 -24
- package/dist/chunk-Q6DVTCXD.js.map +1 -0
- package/dist/{chunk-5PGOL2KR.js → chunk-RWPGGWO5.js} +9 -28
- package/dist/chunk-RWPGGWO5.js.map +1 -0
- package/dist/{chunk-TP3JOOJW.js → chunk-ZBDABVIO.js} +3 -3
- package/dist/{chunk-TP3JOOJW.js.map → chunk-ZBDABVIO.js.map} +1 -1
- package/dist/core/index.cjs +30 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +5 -1
- package/dist/core/index.d.ts +5 -1
- package/dist/core/index.js +1 -1
- package/dist/ecomap/index.cjs +32 -21
- package/dist/ecomap/index.cjs.map +1 -1
- package/dist/ecomap/index.js +2 -2
- package/dist/fault-tree/index.js +2 -2
- package/dist/fishbone/index.js +2 -2
- package/dist/genogram/index.cjs +36 -25
- package/dist/genogram/index.cjs.map +1 -1
- package/dist/genogram/index.d.cts +4 -2
- package/dist/genogram/index.d.ts +4 -2
- package/dist/genogram/index.js +2 -2
- package/dist/index.cjs +1616 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -5
- package/dist/kinship-DqEklrDN.d.ts +51 -0
- package/dist/kinship-Dy_ijjJV.d.cts +51 -0
- package/dist/labels-CBQ_3Ec9.d.cts +123 -0
- package/dist/labels-DNqRkWuI.d.ts +123 -0
- package/dist/labels-iZjijjtK.d.cts +64 -0
- package/dist/labels-iZjijjtK.d.ts +64 -0
- package/dist/locales/pt-br.cjs +58 -0
- package/dist/locales/pt-br.cjs.map +1 -1
- package/dist/locales/pt-br.d.cts +9 -2
- package/dist/locales/pt-br.d.ts +9 -2
- package/dist/locales/pt-br.js +55 -1
- package/dist/locales/pt-br.js.map +1 -1
- package/dist/pedigree/index.cjs +1151 -0
- package/dist/pedigree/index.cjs.map +1 -0
- package/dist/pedigree/index.d.cts +155 -0
- package/dist/pedigree/index.d.ts +155 -0
- package/dist/pedigree/index.js +4 -0
- package/dist/pedigree/index.js.map +1 -0
- package/dist/phylo/index.cjs +553 -0
- package/dist/phylo/index.cjs.map +1 -0
- package/dist/phylo/index.d.cts +158 -0
- package/dist/phylo/index.d.ts +158 -0
- package/dist/phylo/index.js +4 -0
- package/dist/phylo/index.js.map +1 -0
- package/dist/types-BnMG7TCd.d.cts +66 -0
- package/dist/types-BnMG7TCd.d.ts +66 -0
- package/package.json +34 -12
- package/dist/chunk-5B453C4P.js.map +0 -1
- package/dist/chunk-5PGOL2KR.js.map +0 -1
- package/dist/chunk-EHQMKVDM.js.map +0 -1
- package/dist/kinship-BARO5-qz.d.cts +0 -115
- package/dist/kinship-Bkf87Jhu.d.ts +0 -115
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ecomap/render.ts"],"names":["w","h"],"mappings":";;;AAoEO,IAAM,gBAAA,GAAiC;AAAA,EAC5C,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,OAAA;AAAA,IACP,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,aAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,cAAA;AAAA,EACZ,SAAA,EAAW,+BAAA;AAAA,E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AK,IAAA,CAAK,MAAM,CAAA;AAC1B,EAAA,OACE,wDAAwD,CAAC,CAAA,CAAA,EAAI,CAAC,CAAA,SAAA,EAAY,CAAC,CAAA,UAAA,EAAa,CAAC,CAAA,yBAAA,EAA4B,SAAA,CAAU,OAAO,SAAS,CAAC,OAChJ,KAAA,CAAM,IAAA,CAAK,EAAE,CAAA,GACb,CAAA,MAAA,CAAA;AAEJ","file":"chunk-EHQMKVDM.js","sourcesContent":["// Radial ecomap renderer — center node + declared external ties on 1–2 concentric\n// rings, as a SELF-CONTAINED SVG string. Pure (data in, string out), deterministic\n// (same input → same SVG), no DOM, no dependencies.\n//\n// HONESTY RULE: the diagram presents ONLY what the caller declared. A tie's line style\n// is a conservative lexical hint from the author's own quality word (ambiguous/null →\n// neutral solid line, never a synthesized value); an arrowhead appears ONLY when a\n// direction was declared (null = no arrow, never a default). The verbatim text always\n// rides the element's <title>, so a style never replaces what was said.\n//\n// Ring assignment is a deterministic PRESENTATION rule — by input order (sorted by id),\n// alternating rings when the set is large — never by any reading of the tie's content.\n//\n// Every interpolated text passes xmlEscape (labels are author-controlled; the SVG may\n// be inlined via innerHTML or embedded in a PDF). All presentation attributes are\n// literal: a standalone SVG has no stylesheet. Arrowheads are explicit polygons, NOT\n// <marker> defs — marker support is unreliable in SVG-to-PDF embedders, and inline\n// polygons also avoid def-id collisions when several SVGs share one document.\n\nimport {\n EDGE_STROKE,\n FONT_FAMILY,\n clampLabel,\n estimateTextWidth,\n qualityLineStyle,\n wrapLabel,\n xmlEscape,\n type EdgeLineStyle,\n type QualityLexicon,\n} from \"../core\";\n\n// ── Input model ───────────────────────────────────────────────────────────────\n\n/** Declared flow of the tie, relative to the CENTER: \"in\" = toward the center. */\nexport type EcomapDirection = \"in\" | \"out\" | \"both\";\n\n/**\n * One declared tie between the center (person/household) and an external system\n * (work, faith, friends, healthcare…). `label` is the author's own naming, kept\n * verbatim. `quality` is the author's verbatim wording about the tie (null = not\n * declared = neutral line). `direction` follows the same doctrine: null = no arrow.\n */\nexport interface EcomapTie {\n id: number;\n label: string;\n quality: string | null;\n direction: EcomapDirection | null;\n /** Optional verbatim <title> override (defaults to \"label · quality\"). */\n title?: string;\n}\n\nexport interface EcomapInput {\n /** Center node label (e.g. the person or household the map is about). */\n centerLabel: string;\n ties: EcomapTie[];\n}\n\n// ── Display vocabulary ────────────────────────────────────────────────────────\n\nexport interface EcomapLabels {\n bondStyles: Record<Exclude<EdgeLineStyle, \"plain\">, string>;\n /** Legend label for the neutral solid line (a declared tie with no styled quality). */\n neutralTie: string;\n /** Legend label for the arrowhead (declared direction of the tie). */\n direction: string;\n ariaLabel: string;\n}\n\nexport const ECOMAP_LABELS_EN: EcomapLabels = {\n bondStyles: {\n close: \"Close\",\n distant: \"Distant\",\n conflict: \"Conflictual\",\n cutoff: \"Cut off (no contact)\",\n },\n neutralTie: \"Declared tie\",\n direction: \"Declared direction of the tie\",\n ariaLabel: \"Ecomap\",\n};\n\nexport interface EcomapSvgOptions {\n /** Display clamp per tie label (verbatim text stays in the <title>). */\n maxLabelChars?: number;\n /** Node label font size (px); default 12. */\n fontSize?: number;\n /** Set false to suppress the legend (compact preview); default true. */\n legend?: boolean;\n /** Quality-word lexicon — English default; see `compasso/locales/pt-br`. */\n qualityLexicon?: QualityLexicon;\n /** Display vocabulary — English default; see locale packs. */\n labels?: EcomapLabels;\n}\n\n// ── Geometry constants ────────────────────────────────────────────────────────\n\nconst PADDING = 32;\nconst LINE_H = 14;\nconst NODE_PAD_X = 14;\nconst NODE_PAD_Y = 9;\nconst CENTER_MIN_R = 36;\nconst RING_MIN_R = 150;\n/** Min gap between two adjacent node boxes on the same ring. */\nconst NODE_GAP = 24;\n/** Radial gap between the center circle and the inner ring's nearest box edge. */\nconst RADIAL_GAP = 40;\n/** Radial gap between the two rings when the set is large enough to split. */\nconst RING_GAP = 26;\n/** Above this many ties the layout alternates between two rings. */\nconst SINGLE_RING_MAX = 8;\n\n// Ink (zinc ramp on white — matches the genogram emitter).\nconst NODE_STROKE = \"#52525b\";\nconst LABEL_FILL = \"#3f3f46\";\nconst EDGE_INK = \"#71717a\";\n\n// Legend metrics (same vocabulary as the genogram emitter).\nconst LEGEND_ROW_H = 18;\nconst LEGEND_PAD = 16;\nconst LEGEND_SWATCH_W = 22;\nconst LEGEND_GAP = 14;\nconst LEGEND_FONT = 11;\n\nconst round = (n: number): number => Math.round(n * 100) / 100;\n\n// ── Internal shapes ───────────────────────────────────────────────────────────\n\ninterface SatNode {\n tie: EcomapTie;\n lines: string[];\n rx: number;\n ry: number;\n /** Filled once ring radii are known. */\n x: number;\n y: number;\n angle: number;\n style: EdgeLineStyle;\n}\n\n/** Wrap policy mirroring the genogram's: roughly-balanced lines, sane width. */\nfunction wrapTieLabel(displayLabel: string): string[] {\n const perLine = Math.min(26, Math.max(14, Math.ceil(displayLabel.length / 2) + 2));\n return wrapLabel(displayLabel, perLine);\n}\n\n/** Arrowhead polygon: tip at (tipX,tipY), pointing along the unit vector (ux,uy). */\nfunction arrowHead(tipX: number, tipY: number, ux: number, uy: number, opacity: number): string {\n const LEN = 9;\n const HALF_W = 4.5;\n const bx = tipX - ux * LEN;\n const by = tipY - uy * LEN;\n const px = -uy;\n const py = ux;\n const points = [\n `${round(tipX)},${round(tipY)}`,\n `${round(bx + px * HALF_W)},${round(by + py * HALF_W)}`,\n `${round(bx - px * HALF_W)},${round(by - py * HALF_W)}`,\n ].join(\" \");\n return `<polygon points=\"${points}\" fill=\"${EDGE_INK}\" fill-opacity=\"${opacity}\"/>`;\n}\n\n/**\n * Renders a declared ecomap to a self-contained SVG string. Deterministic: same data →\n * same SVG. Zero ties yield a valid center-only SVG; callers decide their own empty\n * state before calling. The root keeps numeric width/height attributes plus a matching\n * viewBox (PDF-embedder contract).\n */\nexport function ecomapSvg(input: EcomapInput, opts: EcomapSvgOptions = {}): string {\n const fontSize = opts.fontSize ?? 12;\n const labels = opts.labels ?? ECOMAP_LABELS_EN;\n\n // ── Measure every satellite box (deterministic order: by tie id). ───────────\n const sats: SatNode[] = [...input.ties]\n .sort((a, b) => a.id - b.id)\n .map((tie) => {\n const lines = wrapTieLabel(clampLabel(tie.label, opts.maxLabelChars));\n const w = Math.max(...lines.map((l) => estimateTextWidth(l, fontSize))) + NODE_PAD_X * 2;\n const h = lines.length * LINE_H + NODE_PAD_Y * 2;\n return {\n tie,\n lines,\n rx: Math.max(40, w / 2),\n ry: Math.max(20, h / 2),\n x: 0,\n y: 0,\n angle: 0,\n style: qualityLineStyle(tie.quality, opts.qualityLexicon),\n };\n });\n\n const centerLines = wrapTieLabel(input.centerLabel);\n const centerR = Math.max(\n CENTER_MIN_R,\n Math.max(...centerLines.map((l) => estimateTextWidth(l, fontSize))) / 2 + 12,\n (centerLines.length * LINE_H) / 2 + 12,\n );\n\n // ── Ring radii: wide enough that NO two node boxes can ever touch. The safe\n // center-to-center distance is the diagonal of the worst-case box pair: if the\n // euclidean distance is ≥ hypot(width-sum, height-sum), the axis-aligned boxes\n // cannot overlap in both axes at once. Overlap-proof by construction, not by luck.\n const n = sats.length;\n const maxRx = n > 0 ? Math.max(...sats.map((s) => s.rx)) : 0;\n const maxRy = n > 0 ? Math.max(...sats.map((s) => s.ry)) : 0;\n const twoRings = n > SINGLE_RING_MAX;\n const stepAngle = n > 0 ? (Math.PI * 2) / n : Math.PI;\n const safeDist = Math.hypot(2 * maxRx + NODE_GAP, 2 * maxRy + NODE_GAP);\n /** Min radius so two nodes `steps` angular steps apart on the SAME ring clear safeDist. */\n const sameRingRadius = (steps: number): number => {\n const theta = steps * stepAngle;\n if (n <= 1 || theta >= Math.PI) return 0; // ≤2 nodes on the ring: no chord constraint\n return safeDist / (2 * Math.sin(theta / 2));\n };\n const ringStep = maxRy * 2 + RING_GAP;\n let innerR = Math.max(\n RING_MIN_R,\n centerR + RADIAL_GAP + maxRy,\n sameRingRadius(twoRings ? 2 : 1),\n );\n if (twoRings) {\n // Cross-ring neighbors sit 1 step apart at radii r and r+ringStep. Their distance\n // sqrt(r² + (r+s)² − 2r(r+s)cosΔ) grows monotonically with r — widen the inner ring\n // in fixed increments until it clears safeDist (deterministic, always terminates).\n const crossDist = (r: number): number =>\n Math.sqrt(r * r + (r + ringStep) ** 2 - 2 * r * (r + ringStep) * Math.cos(stepAngle));\n while (crossDist(innerR) < safeDist) innerR += 8;\n }\n const outerR = innerR + ringStep;\n\n for (let i = 0; i < n; i++) {\n const s = sats[i]!;\n s.angle = -Math.PI / 2 + (i * Math.PI * 2) / n;\n const r = twoRings && i % 2 === 1 ? outerR : innerR;\n s.x = r * Math.cos(s.angle);\n s.y = r * Math.sin(s.angle);\n }\n\n // ── Canvas bounds (center at origin until here), then shift positive. ───────\n let minX = -centerR;\n let minY = -centerR;\n let maxX = centerR;\n let maxY = centerR;\n for (const s of sats) {\n minX = Math.min(minX, s.x - s.rx);\n minY = Math.min(minY, s.y - s.ry);\n maxX = Math.max(maxX, s.x + s.rx);\n maxY = Math.max(maxY, s.y + s.ry);\n }\n const dx = PADDING - minX;\n const dy = PADDING - minY;\n const cx = dx;\n const cy = dy;\n for (const s of sats) {\n s.x += dx;\n s.y += dy;\n }\n let width = maxX - minX + PADDING * 2;\n let height = maxY - minY + PADDING * 2;\n\n const parts: string[] = [];\n\n // ── Tie lines first (nodes sit on top), one group per declared tie. ─────────\n for (const s of sats) {\n const ux = (cx - s.x) / Math.hypot(cx - s.x, cy - s.y);\n const uy = (cy - s.y) / Math.hypot(cx - s.x, cy - s.y);\n // Node-edge endpoint: ellipse boundary along the unit vector toward the center.\n const scale = 1 / Math.hypot(ux / s.rx, uy / s.ry);\n const x1 = s.x + ux * scale;\n const y1 = s.y + uy * scale;\n // Center-edge endpoint: circle boundary along the same direction.\n const x2 = cx - ux * centerR;\n const y2 = cy - uy * centerR;\n\n const ink = EDGE_STROKE[s.style];\n const dashAttr = ink.dash === null ? \"\" : ` stroke-dasharray=\"${ink.dash[0]} ${ink.dash[1]}\"`;\n const title = s.tie.title ?? (s.tie.quality !== null ? `${s.tie.label} · ${s.tie.quality}` : s.tie.label);\n const body: string[] = [\n `<line x1=\"${round(x1)}\" y1=\"${round(y1)}\" x2=\"${round(x2)}\" y2=\"${round(y2)}\" stroke=\"${EDGE_INK}\" stroke-width=\"${ink.width}\" stroke-opacity=\"${ink.opacity}\"${dashAttr}/>`,\n ];\n // Arrowheads ONLY for a declared direction. \"in\" points at the center, \"out\" at\n // the external system, \"both\" draws both. Tips back off the boundary so the\n // triangle never pokes into the shape.\n if (s.tie.direction === \"in\" || s.tie.direction === \"both\") {\n body.push(arrowHead(x2, y2, ux, uy, ink.opacity)); // tip at the center edge\n }\n if (s.tie.direction === \"out\" || s.tie.direction === \"both\") {\n body.push(arrowHead(x1, y1, -ux, -uy, ink.opacity)); // tip at the system edge\n }\n parts.push(`<g data-edge-id=\"${s.tie.id}\"><title>${xmlEscape(title)}</title>${body.join(\"\")}</g>`);\n }\n\n // ── Center node. ─────────────────────────────────────────────────────────────\n {\n const tspans = centerLines\n .map(\n (line, i) =>\n `<tspan x=\"${round(cx)}\" y=\"${round(cy - ((centerLines.length - 1) * LINE_H) / 2 + i * LINE_H + fontSize * 0.32)}\">${xmlEscape(line)}</tspan>`,\n )\n .join(\"\");\n parts.push(\n `<g data-individual-id=\"center\"><title>${xmlEscape(input.centerLabel)}</title>` +\n `<circle cx=\"${round(cx)}\" cy=\"${round(cy)}\" r=\"${round(centerR)}\" fill=\"transparent\" stroke=\"${NODE_STROKE}\" stroke-width=\"2\"/>` +\n `<text text-anchor=\"middle\" font-family=\"${FONT_FAMILY}\" font-size=\"${fontSize}\" fill=\"${LABEL_FILL}\">${tspans}</text></g>`,\n );\n }\n\n // ── Satellite nodes. ─────────────────────────────────────────────────────────\n for (const s of sats) {\n const tspans = s.lines\n .map(\n (line, i) =>\n `<tspan x=\"${round(s.x)}\" y=\"${round(s.y - ((s.lines.length - 1) * LINE_H) / 2 + i * LINE_H + fontSize * 0.32)}\">${xmlEscape(line)}</tspan>`,\n )\n .join(\"\");\n parts.push(\n `<g data-individual-id=\"e${s.tie.id}\"><title>${xmlEscape(s.tie.label)}</title>` +\n `<ellipse cx=\"${round(s.x)}\" cy=\"${round(s.y)}\" rx=\"${round(s.rx)}\" ry=\"${round(s.ry)}\" fill=\"transparent\" stroke=\"${NODE_STROKE}\" stroke-width=\"1.5\"/>` +\n `<text text-anchor=\"middle\" font-family=\"${FONT_FAMILY}\" font-size=\"${fontSize}\" fill=\"${LABEL_FILL}\">${tspans}</text></g>`,\n );\n }\n\n // ── Minimal legend: only entries actually used. ──────────────────────────────\n if (opts.legend !== false && sats.length > 0) {\n const entries: { swatch: (x: number, y: number) => string; label: string }[] = [];\n\n if (sats.some((s) => s.style === \"plain\")) {\n entries.push({\n swatch: (x, y) =>\n `<line x1=\"${x}\" y1=\"${y}\" x2=\"${x + LEGEND_SWATCH_W}\" y2=\"${y}\" stroke=\"${EDGE_INK}\" stroke-width=\"${EDGE_STROKE.plain.width}\" stroke-opacity=\"${EDGE_STROKE.plain.opacity}\"/>`,\n label: labels.neutralTie,\n });\n }\n const stylesUsed = new Set(sats.map((s) => s.style));\n for (const style of [\"close\", \"distant\", \"conflict\", \"cutoff\"] as const) {\n if (!stylesUsed.has(style)) continue;\n const ink = EDGE_STROKE[style];\n const dashAttr = ink.dash === null ? \"\" : ` stroke-dasharray=\"${ink.dash[0]} ${ink.dash[1]}\"`;\n entries.push({\n swatch: (x, y) =>\n `<line x1=\"${x}\" y1=\"${y}\" x2=\"${x + LEGEND_SWATCH_W}\" y2=\"${y}\" stroke=\"${EDGE_INK}\" stroke-width=\"${ink.width}\" stroke-opacity=\"${ink.opacity}\"${dashAttr}/>`,\n label: labels.bondStyles[style],\n });\n }\n if (sats.some((s) => s.tie.direction !== null)) {\n entries.push({\n swatch: (x, y) =>\n `<line x1=\"${x}\" y1=\"${y}\" x2=\"${x + LEGEND_SWATCH_W - 8}\" y2=\"${y}\" stroke=\"${EDGE_INK}\" stroke-width=\"1.5\" stroke-opacity=\"0.75\"/>` +\n arrowHead(x + LEGEND_SWATCH_W, y, 1, 0, 0.75),\n label: labels.direction,\n });\n }\n\n if (entries.length > 0) {\n const startY = height;\n const rows = entries.map((entry, i) => {\n const rowCenterY = startY + i * LEGEND_ROW_H + LEGEND_ROW_H / 2;\n const textX = LEGEND_PAD + LEGEND_SWATCH_W + LEGEND_GAP;\n return (\n entry.swatch(LEGEND_PAD, rowCenterY) +\n `<text x=\"${textX}\" y=\"${rowCenterY + LEGEND_FONT * 0.32}\" font-family=\"${FONT_FAMILY}\" font-size=\"${LEGEND_FONT}\" fill=\"${NODE_STROKE}\">${xmlEscape(entry.label)}</text>`\n );\n });\n parts.push(`<g data-compasso-legend=\"true\">${rows.join(\"\")}</g>`);\n const widestLabel = entries.reduce((m, e) => Math.max(m, estimateTextWidth(e.label, LEGEND_FONT)), 0);\n width = Math.max(width, LEGEND_PAD + LEGEND_SWATCH_W + LEGEND_GAP + widestLabel + LEGEND_PAD);\n height = startY + entries.length * LEGEND_ROW_H + LEGEND_PAD / 2;\n }\n }\n\n const w = Math.ceil(width);\n const h = Math.ceil(height);\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${w} ${h}\" width=\"${w}\" height=\"${h}\" role=\"img\" aria-label=\"${xmlEscape(labels.ariaLabel)}\">` +\n parts.join(\"\") +\n `</svg>`\n );\n}\n"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { a as EdgeLineStyle } from './stroke-MQ427drt.cjs';
|
|
2
|
-
|
|
3
|
-
/** Sex marker for a genogram node (standard notation: square/circle/diamond). */
|
|
4
|
-
type PersonSex = "male" | "female" | "unknown";
|
|
5
|
-
/** A genogram node. `generation` is relative (0 = index person; negative = older). */
|
|
6
|
-
interface Person {
|
|
7
|
-
id: number;
|
|
8
|
-
label: string;
|
|
9
|
-
sex: PersonSex;
|
|
10
|
-
deceased: boolean;
|
|
11
|
-
generation: number | null;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* CLOSED status vocabulary for a declared union. Notable semantics:
|
|
15
|
-
* - "coparental": the two were NEVER a couple and have child(ren) together;
|
|
16
|
-
* - "unknown": a union was declared, but its type was not;
|
|
17
|
-
* - widowhood is NOT a status — death lives on Person.deceased and never
|
|
18
|
-
* alters the declared status;
|
|
19
|
-
* - no value for "not stated": the union simply is not passed in.
|
|
20
|
-
*/
|
|
21
|
-
declare const UNION_STATUSES: readonly ["married", "cohabiting", "dating", "separated", "divorced", "coparental", "unknown"];
|
|
22
|
-
type UnionStatus = (typeof UNION_STATUSES)[number];
|
|
23
|
-
/**
|
|
24
|
-
* A declared couple bond between two people. The pair is unordered and expected
|
|
25
|
-
* normalized to personAId < personBId with ONE union per pair (duplicates are the
|
|
26
|
-
* caller's to resolve). `quality` is the author's verbatim wording about the bond.
|
|
27
|
-
*/
|
|
28
|
-
interface Union {
|
|
29
|
-
id: number;
|
|
30
|
-
/** Always the smaller person id (normalized pair). */
|
|
31
|
-
personAId: number;
|
|
32
|
-
personBId: number;
|
|
33
|
-
status: UnionStatus;
|
|
34
|
-
quality: string | null;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A declared parentage link: parent → child, one row PER DECLARED genitor (two
|
|
38
|
-
* genitors = two links, each individually stated — never promoted from a union).
|
|
39
|
-
*/
|
|
40
|
-
interface ParentLink {
|
|
41
|
-
id: number;
|
|
42
|
-
parentId: number;
|
|
43
|
-
childId: number;
|
|
44
|
-
quality: string | null;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* A typed free-text edge between two people. `type` and `quality` are verbatim
|
|
48
|
-
* labels. This carries NON-STRUCTURAL ties only (closeness, conflict…) — unions
|
|
49
|
-
* and parentage are first-class above.
|
|
50
|
-
*/
|
|
51
|
-
interface Relationship {
|
|
52
|
-
id: number;
|
|
53
|
-
fromPersonId: number;
|
|
54
|
-
toPersonId: number;
|
|
55
|
-
type: string;
|
|
56
|
-
quality: string | null;
|
|
57
|
-
}
|
|
58
|
-
/** Input to the genogram render pipeline. */
|
|
59
|
-
interface GenogramInput {
|
|
60
|
-
people: Person[];
|
|
61
|
-
unions: Union[];
|
|
62
|
-
parentLinks: ParentLink[];
|
|
63
|
-
relationships: Relationship[];
|
|
64
|
-
}
|
|
65
|
-
/** Node glyph shapes (standard notation: square = male, circle = female, diamond = unknown). */
|
|
66
|
-
type NodeShape = "square" | "circle" | "diamond";
|
|
67
|
-
|
|
68
|
-
/** Labels woven into element <title>s by the LAYOUT (verbatim-preserving). */
|
|
69
|
-
interface GenogramTitleLabels {
|
|
70
|
-
unionStatus: Record<UnionStatus, string>;
|
|
71
|
-
/** Title prefix for a parent→child descent ("parent of"). */
|
|
72
|
-
parentage: string;
|
|
73
|
-
}
|
|
74
|
-
declare const GENOGRAM_TITLE_LABELS_EN: GenogramTitleLabels;
|
|
75
|
-
/** Labels drawn by the SVG EMITTER (legend entries, accessibility text). */
|
|
76
|
-
interface GenogramSvgLabels {
|
|
77
|
-
shapes: Record<NodeShape, string>;
|
|
78
|
-
deceased: string;
|
|
79
|
-
bondStyles: Record<Exclude<EdgeLineStyle, "plain">, string>;
|
|
80
|
-
/** Legend label for the group of people with no drawn connection. */
|
|
81
|
-
isolated: string;
|
|
82
|
-
ariaLabel: string;
|
|
83
|
-
}
|
|
84
|
-
declare const GENOGRAM_SVG_LABELS_EN: GenogramSvgLabels;
|
|
85
|
-
|
|
86
|
-
type RelationshipMapClass = "derived" | "parentage" | "bond";
|
|
87
|
-
/**
|
|
88
|
-
* A pluggable kinship vocabulary. Tokens are diacritic-free, lowercase, matched WHOLE
|
|
89
|
-
* (so a token never matches inside another word) after splitting the type on
|
|
90
|
-
* non-alphanumerics ("half-brother" → ["half","brother"]). Checked DERIVED-first, so
|
|
91
|
-
* "brother on my father's side" reads as a sibling, never as a parent. These lists are
|
|
92
|
-
* closed and conservative — an unrecognized word stays a non-structural bond (the
|
|
93
|
-
* honest default). Locale packs (e.g. `compasso/locales/pt-br`) ship alternates.
|
|
94
|
-
*/
|
|
95
|
-
interface KinshipLexicon {
|
|
96
|
-
/** Kinship read from the tree (sibling/grandparent/uncle/cousin…): never a line. */
|
|
97
|
-
derived: ReadonlySet<string>;
|
|
98
|
-
/** Direct parentage words (mother/father/son…): promotable to a descent. */
|
|
99
|
-
parentage: ReadonlySet<string>;
|
|
100
|
-
/** Parentage words whose FROM endpoint is the CHILD — used only to orient a
|
|
101
|
-
* promotion when declared generations do not decide it. */
|
|
102
|
-
childWords: ReadonlySet<string>;
|
|
103
|
-
}
|
|
104
|
-
declare const KINSHIP_EN: KinshipLexicon;
|
|
105
|
-
/** Lowercase + accent-stripped tokens of a free-text relationship type. */
|
|
106
|
-
declare function relationshipTypeTokens(type: string): string[];
|
|
107
|
-
/**
|
|
108
|
-
* Classifies a free-text relationship `type` for the MAP. Pure + deterministic.
|
|
109
|
-
* Derived kinship is checked first so a compound like "brother on my father's side"
|
|
110
|
-
* is read as a sibling (derived), never promoted as a parent. The verbatim word is
|
|
111
|
-
* unaffected — this decides only whether the tie becomes a line, and which kind.
|
|
112
|
-
*/
|
|
113
|
-
declare function classifyRelationshipType(type: string, kinship?: KinshipLexicon): RelationshipMapClass;
|
|
114
|
-
|
|
115
|
-
export { GENOGRAM_SVG_LABELS_EN as G, KINSHIP_EN as K, type NodeShape as N, type ParentLink as P, type Relationship as R, UNION_STATUSES as U, GENOGRAM_TITLE_LABELS_EN as a, type GenogramInput as b, type GenogramSvgLabels as c, type GenogramTitleLabels as d, type KinshipLexicon as e, type Person as f, type PersonSex as g, type RelationshipMapClass as h, type Union as i, type UnionStatus as j, classifyRelationshipType as k, relationshipTypeTokens as r };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { a as EdgeLineStyle } from './stroke-MQ427drt.js';
|
|
2
|
-
|
|
3
|
-
/** Sex marker for a genogram node (standard notation: square/circle/diamond). */
|
|
4
|
-
type PersonSex = "male" | "female" | "unknown";
|
|
5
|
-
/** A genogram node. `generation` is relative (0 = index person; negative = older). */
|
|
6
|
-
interface Person {
|
|
7
|
-
id: number;
|
|
8
|
-
label: string;
|
|
9
|
-
sex: PersonSex;
|
|
10
|
-
deceased: boolean;
|
|
11
|
-
generation: number | null;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* CLOSED status vocabulary for a declared union. Notable semantics:
|
|
15
|
-
* - "coparental": the two were NEVER a couple and have child(ren) together;
|
|
16
|
-
* - "unknown": a union was declared, but its type was not;
|
|
17
|
-
* - widowhood is NOT a status — death lives on Person.deceased and never
|
|
18
|
-
* alters the declared status;
|
|
19
|
-
* - no value for "not stated": the union simply is not passed in.
|
|
20
|
-
*/
|
|
21
|
-
declare const UNION_STATUSES: readonly ["married", "cohabiting", "dating", "separated", "divorced", "coparental", "unknown"];
|
|
22
|
-
type UnionStatus = (typeof UNION_STATUSES)[number];
|
|
23
|
-
/**
|
|
24
|
-
* A declared couple bond between two people. The pair is unordered and expected
|
|
25
|
-
* normalized to personAId < personBId with ONE union per pair (duplicates are the
|
|
26
|
-
* caller's to resolve). `quality` is the author's verbatim wording about the bond.
|
|
27
|
-
*/
|
|
28
|
-
interface Union {
|
|
29
|
-
id: number;
|
|
30
|
-
/** Always the smaller person id (normalized pair). */
|
|
31
|
-
personAId: number;
|
|
32
|
-
personBId: number;
|
|
33
|
-
status: UnionStatus;
|
|
34
|
-
quality: string | null;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A declared parentage link: parent → child, one row PER DECLARED genitor (two
|
|
38
|
-
* genitors = two links, each individually stated — never promoted from a union).
|
|
39
|
-
*/
|
|
40
|
-
interface ParentLink {
|
|
41
|
-
id: number;
|
|
42
|
-
parentId: number;
|
|
43
|
-
childId: number;
|
|
44
|
-
quality: string | null;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* A typed free-text edge between two people. `type` and `quality` are verbatim
|
|
48
|
-
* labels. This carries NON-STRUCTURAL ties only (closeness, conflict…) — unions
|
|
49
|
-
* and parentage are first-class above.
|
|
50
|
-
*/
|
|
51
|
-
interface Relationship {
|
|
52
|
-
id: number;
|
|
53
|
-
fromPersonId: number;
|
|
54
|
-
toPersonId: number;
|
|
55
|
-
type: string;
|
|
56
|
-
quality: string | null;
|
|
57
|
-
}
|
|
58
|
-
/** Input to the genogram render pipeline. */
|
|
59
|
-
interface GenogramInput {
|
|
60
|
-
people: Person[];
|
|
61
|
-
unions: Union[];
|
|
62
|
-
parentLinks: ParentLink[];
|
|
63
|
-
relationships: Relationship[];
|
|
64
|
-
}
|
|
65
|
-
/** Node glyph shapes (standard notation: square = male, circle = female, diamond = unknown). */
|
|
66
|
-
type NodeShape = "square" | "circle" | "diamond";
|
|
67
|
-
|
|
68
|
-
/** Labels woven into element <title>s by the LAYOUT (verbatim-preserving). */
|
|
69
|
-
interface GenogramTitleLabels {
|
|
70
|
-
unionStatus: Record<UnionStatus, string>;
|
|
71
|
-
/** Title prefix for a parent→child descent ("parent of"). */
|
|
72
|
-
parentage: string;
|
|
73
|
-
}
|
|
74
|
-
declare const GENOGRAM_TITLE_LABELS_EN: GenogramTitleLabels;
|
|
75
|
-
/** Labels drawn by the SVG EMITTER (legend entries, accessibility text). */
|
|
76
|
-
interface GenogramSvgLabels {
|
|
77
|
-
shapes: Record<NodeShape, string>;
|
|
78
|
-
deceased: string;
|
|
79
|
-
bondStyles: Record<Exclude<EdgeLineStyle, "plain">, string>;
|
|
80
|
-
/** Legend label for the group of people with no drawn connection. */
|
|
81
|
-
isolated: string;
|
|
82
|
-
ariaLabel: string;
|
|
83
|
-
}
|
|
84
|
-
declare const GENOGRAM_SVG_LABELS_EN: GenogramSvgLabels;
|
|
85
|
-
|
|
86
|
-
type RelationshipMapClass = "derived" | "parentage" | "bond";
|
|
87
|
-
/**
|
|
88
|
-
* A pluggable kinship vocabulary. Tokens are diacritic-free, lowercase, matched WHOLE
|
|
89
|
-
* (so a token never matches inside another word) after splitting the type on
|
|
90
|
-
* non-alphanumerics ("half-brother" → ["half","brother"]). Checked DERIVED-first, so
|
|
91
|
-
* "brother on my father's side" reads as a sibling, never as a parent. These lists are
|
|
92
|
-
* closed and conservative — an unrecognized word stays a non-structural bond (the
|
|
93
|
-
* honest default). Locale packs (e.g. `compasso/locales/pt-br`) ship alternates.
|
|
94
|
-
*/
|
|
95
|
-
interface KinshipLexicon {
|
|
96
|
-
/** Kinship read from the tree (sibling/grandparent/uncle/cousin…): never a line. */
|
|
97
|
-
derived: ReadonlySet<string>;
|
|
98
|
-
/** Direct parentage words (mother/father/son…): promotable to a descent. */
|
|
99
|
-
parentage: ReadonlySet<string>;
|
|
100
|
-
/** Parentage words whose FROM endpoint is the CHILD — used only to orient a
|
|
101
|
-
* promotion when declared generations do not decide it. */
|
|
102
|
-
childWords: ReadonlySet<string>;
|
|
103
|
-
}
|
|
104
|
-
declare const KINSHIP_EN: KinshipLexicon;
|
|
105
|
-
/** Lowercase + accent-stripped tokens of a free-text relationship type. */
|
|
106
|
-
declare function relationshipTypeTokens(type: string): string[];
|
|
107
|
-
/**
|
|
108
|
-
* Classifies a free-text relationship `type` for the MAP. Pure + deterministic.
|
|
109
|
-
* Derived kinship is checked first so a compound like "brother on my father's side"
|
|
110
|
-
* is read as a sibling (derived), never promoted as a parent. The verbatim word is
|
|
111
|
-
* unaffected — this decides only whether the tie becomes a line, and which kind.
|
|
112
|
-
*/
|
|
113
|
-
declare function classifyRelationshipType(type: string, kinship?: KinshipLexicon): RelationshipMapClass;
|
|
114
|
-
|
|
115
|
-
export { GENOGRAM_SVG_LABELS_EN as G, KINSHIP_EN as K, type NodeShape as N, type ParentLink as P, type Relationship as R, UNION_STATUSES as U, GENOGRAM_TITLE_LABELS_EN as a, type GenogramInput as b, type GenogramSvgLabels as c, type GenogramTitleLabels as d, type KinshipLexicon as e, type Person as f, type PersonSex as g, type RelationshipMapClass as h, type Union as i, type UnionStatus as j, classifyRelationshipType as k, relationshipTypeTokens as r };
|