schematex 0.5.2 → 0.6.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.
Files changed (174) hide show
  1. package/README.md +75 -1
  2. package/dist/ai/ai-sdk.cjs +22 -22
  3. package/dist/ai/ai-sdk.d.cts +3 -3
  4. package/dist/ai/ai-sdk.d.ts +3 -3
  5. package/dist/ai/ai-sdk.js +17 -17
  6. package/dist/ai/index.cjs +34 -26
  7. package/dist/ai/index.d.cts +4 -4
  8. package/dist/ai/index.d.ts +4 -4
  9. package/dist/ai/index.js +17 -17
  10. package/dist/{api-Cr_MxttI.d.ts → api-XWHHAhQI.d.ts} +3 -40
  11. package/dist/{api-C5SECOxZ.d.cts → api-qVDutqXH.d.cts} +3 -40
  12. package/dist/browser.cjs +23 -23
  13. package/dist/browser.d.cts +3 -3
  14. package/dist/browser.d.ts +3 -3
  15. package/dist/browser.js +17 -17
  16. package/dist/{chunk-4QPDZJAL.cjs → chunk-25ZON47K.cjs} +11484 -9030
  17. package/dist/chunk-25ZON47K.cjs.map +1 -0
  18. package/dist/{chunk-N7W5KZK7.cjs → chunk-2L4YXZAZ.cjs} +4 -4
  19. package/dist/{chunk-N7W5KZK7.cjs.map → chunk-2L4YXZAZ.cjs.map} +1 -1
  20. package/dist/{chunk-ZYRCPSBU.js → chunk-3IE7KZY4.js} +4 -4
  21. package/dist/{chunk-ZYRCPSBU.js.map → chunk-3IE7KZY4.js.map} +1 -1
  22. package/dist/{chunk-ZX74KJPM.js → chunk-3VB5AT4R.js} +3 -3
  23. package/dist/{chunk-ZX74KJPM.js.map → chunk-3VB5AT4R.js.map} +1 -1
  24. package/dist/{chunk-S2KJRHDZ.cjs → chunk-4UFR2LB6.cjs} +13 -13
  25. package/dist/{chunk-S2KJRHDZ.cjs.map → chunk-4UFR2LB6.cjs.map} +1 -1
  26. package/dist/{chunk-QTNPMIO2.cjs → chunk-6JI6FWLZ.cjs} +341 -35
  27. package/dist/chunk-6JI6FWLZ.cjs.map +1 -0
  28. package/dist/{chunk-OK5ZS3LU.js → chunk-7AFW2J6J.js} +11445 -8998
  29. package/dist/chunk-7AFW2J6J.js.map +1 -0
  30. package/dist/{chunk-UFTYX73U.js → chunk-7F76AWOI.js} +339 -35
  31. package/dist/chunk-7F76AWOI.js.map +1 -0
  32. package/dist/{chunk-BW4KGTV7.cjs → chunk-C5C5EF3W.cjs} +4 -4
  33. package/dist/{chunk-BW4KGTV7.cjs.map → chunk-C5C5EF3W.cjs.map} +1 -1
  34. package/dist/{chunk-VJGMEGMR.js → chunk-DOK7LKLO.js} +125 -13
  35. package/dist/chunk-DOK7LKLO.js.map +1 -0
  36. package/dist/{chunk-3M6WB62Y.cjs → chunk-ECD5XHBM.cjs} +139 -7
  37. package/dist/chunk-ECD5XHBM.cjs.map +1 -0
  38. package/dist/{chunk-L3CTXXVZ.js → chunk-FBS3PACU.js} +3 -3
  39. package/dist/{chunk-L3CTXXVZ.js.map → chunk-FBS3PACU.js.map} +1 -1
  40. package/dist/{chunk-QUKVGHN4.cjs → chunk-FKJBXGWP.cjs} +4 -4
  41. package/dist/{chunk-QUKVGHN4.cjs.map → chunk-FKJBXGWP.cjs.map} +1 -1
  42. package/dist/{chunk-SZK376QB.js → chunk-H4MT5TJP.js} +3 -3
  43. package/dist/{chunk-SZK376QB.js.map → chunk-H4MT5TJP.js.map} +1 -1
  44. package/dist/{chunk-3M6T7KB4.js → chunk-HAZALB7U.js} +3 -3
  45. package/dist/{chunk-3M6T7KB4.js.map → chunk-HAZALB7U.js.map} +1 -1
  46. package/dist/{chunk-VFZOPRQP.cjs → chunk-HWVBHU3O.cjs} +5 -5
  47. package/dist/{chunk-VFZOPRQP.cjs.map → chunk-HWVBHU3O.cjs.map} +1 -1
  48. package/dist/{chunk-D7EHZFK4.cjs → chunk-L7POWM5B.cjs} +138 -2
  49. package/dist/chunk-L7POWM5B.cjs.map +1 -0
  50. package/dist/{chunk-6OSUNBZY.js → chunk-LGABFD3L.js} +135 -7
  51. package/dist/chunk-LGABFD3L.js.map +1 -0
  52. package/dist/{chunk-2VNMKOUO.js → chunk-LRI4RH2N.js} +135 -3
  53. package/dist/chunk-LRI4RH2N.js.map +1 -0
  54. package/dist/{chunk-VDSYMSUY.js → chunk-MVIEIKOI.js} +3 -3
  55. package/dist/{chunk-VDSYMSUY.js.map → chunk-MVIEIKOI.js.map} +1 -1
  56. package/dist/{chunk-ZL5RB4UV.js → chunk-N5B242WY.js} +3 -3
  57. package/dist/{chunk-ZL5RB4UV.js.map → chunk-N5B242WY.js.map} +1 -1
  58. package/dist/{chunk-VKPCR7BG.js → chunk-P63S7P6N.js} +770 -12
  59. package/dist/chunk-P63S7P6N.js.map +1 -0
  60. package/dist/{chunk-YLEVMOK2.cjs → chunk-R66QG3XT.cjs} +5 -4
  61. package/dist/{chunk-YLEVMOK2.cjs.map → chunk-R66QG3XT.cjs.map} +1 -1
  62. package/dist/{chunk-I55HO32M.js → chunk-RJMCWT7Z.js} +3 -3
  63. package/dist/{chunk-I55HO32M.js.map → chunk-RJMCWT7Z.js.map} +1 -1
  64. package/dist/{chunk-TZTCIAYW.cjs → chunk-S3RMAXH5.cjs} +137 -25
  65. package/dist/chunk-S3RMAXH5.cjs.map +1 -0
  66. package/dist/{chunk-IBRW3UOA.js → chunk-TWLKXV2O.js} +3 -3
  67. package/dist/{chunk-IBRW3UOA.js.map → chunk-TWLKXV2O.js.map} +1 -1
  68. package/dist/{chunk-VCH7RI5H.js → chunk-UWA5MWCI.js} +4 -4
  69. package/dist/chunk-UWA5MWCI.js.map +1 -0
  70. package/dist/{chunk-RYVV5UVI.cjs → chunk-V4GILQR6.cjs} +4 -4
  71. package/dist/{chunk-RYVV5UVI.cjs.map → chunk-V4GILQR6.cjs.map} +1 -1
  72. package/dist/{chunk-QMTWG6JL.cjs → chunk-V4RO5KYY.cjs} +6 -4
  73. package/dist/chunk-V4RO5KYY.cjs.map +1 -0
  74. package/dist/{chunk-VZ5LDNHK.cjs → chunk-VTSH4YPT.cjs} +12 -12
  75. package/dist/{chunk-VZ5LDNHK.cjs.map → chunk-VTSH4YPT.cjs.map} +1 -1
  76. package/dist/{chunk-UUBNQV2T.cjs → chunk-WQDIZH2Z.cjs} +12 -12
  77. package/dist/{chunk-UUBNQV2T.cjs.map → chunk-WQDIZH2Z.cjs.map} +1 -1
  78. package/dist/{chunk-EGSUMHCS.cjs → chunk-YB4XJY5L.cjs} +12 -12
  79. package/dist/{chunk-EGSUMHCS.cjs.map → chunk-YB4XJY5L.cjs.map} +1 -1
  80. package/dist/{chunk-JHDR56XO.js → chunk-YS6CGUNH.js} +3 -3
  81. package/dist/{chunk-JHDR56XO.js.map → chunk-YS6CGUNH.js.map} +1 -1
  82. package/dist/{chunk-HK56GQQP.cjs → chunk-YVDUEUFV.cjs} +773 -13
  83. package/dist/chunk-YVDUEUFV.cjs.map +1 -0
  84. package/dist/{types-WTr9W5Ud.d.ts → diagnostics-DRxhodP6.d.cts} +74 -2
  85. package/dist/{types-WTr9W5Ud.d.cts → diagnostics-DRxhodP6.d.ts} +74 -2
  86. package/dist/diagrams/blockdiagram/index.d.cts +1 -1
  87. package/dist/diagrams/blockdiagram/index.d.ts +1 -1
  88. package/dist/diagrams/circuit/index.cjs +8 -8
  89. package/dist/diagrams/circuit/index.d.cts +1 -1
  90. package/dist/diagrams/circuit/index.d.ts +1 -1
  91. package/dist/diagrams/circuit/index.js +2 -2
  92. package/dist/diagrams/ecomap/index.cjs +7 -7
  93. package/dist/diagrams/ecomap/index.d.cts +1 -1
  94. package/dist/diagrams/ecomap/index.d.ts +1 -1
  95. package/dist/diagrams/ecomap/index.js +2 -2
  96. package/dist/diagrams/entity/index.cjs +6 -6
  97. package/dist/diagrams/entity/index.d.cts +1 -1
  98. package/dist/diagrams/entity/index.d.ts +1 -1
  99. package/dist/diagrams/entity/index.js +2 -2
  100. package/dist/diagrams/fishbone/index.cjs +8 -8
  101. package/dist/diagrams/fishbone/index.d.cts +1 -1
  102. package/dist/diagrams/fishbone/index.d.ts +1 -1
  103. package/dist/diagrams/fishbone/index.js +2 -2
  104. package/dist/diagrams/flowchart/index.cjs +8 -8
  105. package/dist/diagrams/flowchart/index.d.cts +2 -2
  106. package/dist/diagrams/flowchart/index.d.ts +2 -2
  107. package/dist/diagrams/flowchart/index.js +2 -2
  108. package/dist/diagrams/genogram/index.cjs +9 -9
  109. package/dist/diagrams/genogram/index.d.cts +1 -1
  110. package/dist/diagrams/genogram/index.d.ts +1 -1
  111. package/dist/diagrams/genogram/index.js +2 -2
  112. package/dist/diagrams/ladder/index.cjs +6 -6
  113. package/dist/diagrams/ladder/index.d.cts +1 -1
  114. package/dist/diagrams/ladder/index.d.ts +1 -1
  115. package/dist/diagrams/ladder/index.js +2 -2
  116. package/dist/diagrams/logic/index.cjs +6 -6
  117. package/dist/diagrams/logic/index.d.cts +1 -1
  118. package/dist/diagrams/logic/index.d.ts +1 -1
  119. package/dist/diagrams/logic/index.js +2 -2
  120. package/dist/diagrams/orgchart/index.cjs +7 -7
  121. package/dist/diagrams/orgchart/index.d.cts +1 -1
  122. package/dist/diagrams/orgchart/index.d.ts +1 -1
  123. package/dist/diagrams/orgchart/index.js +2 -2
  124. package/dist/diagrams/pedigree/index.cjs +7 -7
  125. package/dist/diagrams/pedigree/index.d.cts +1 -1
  126. package/dist/diagrams/pedigree/index.d.ts +1 -1
  127. package/dist/diagrams/pedigree/index.js +2 -2
  128. package/dist/diagrams/phylo/index.cjs +7 -7
  129. package/dist/diagrams/phylo/index.d.cts +1 -1
  130. package/dist/diagrams/phylo/index.d.ts +1 -1
  131. package/dist/diagrams/phylo/index.js +2 -2
  132. package/dist/diagrams/sld/index.cjs +14 -6
  133. package/dist/diagrams/sld/index.d.cts +14 -2
  134. package/dist/diagrams/sld/index.d.ts +14 -2
  135. package/dist/diagrams/sld/index.js +2 -2
  136. package/dist/diagrams/sociogram/index.cjs +6 -6
  137. package/dist/diagrams/sociogram/index.d.cts +1 -1
  138. package/dist/diagrams/sociogram/index.d.ts +1 -1
  139. package/dist/diagrams/sociogram/index.js +2 -2
  140. package/dist/diagrams/timing/index.d.cts +1 -1
  141. package/dist/diagrams/timing/index.d.ts +1 -1
  142. package/dist/diagrams/venn/index.cjs +9 -9
  143. package/dist/diagrams/venn/index.d.cts +1 -1
  144. package/dist/diagrams/venn/index.d.ts +1 -1
  145. package/dist/diagrams/venn/index.js +2 -2
  146. package/dist/{index-C30zQWZI.d.ts → index-BRIkOPnd.d.cts} +60 -2
  147. package/dist/{index-BD2yDfQM.d.cts → index-C7SN-FB3.d.ts} +60 -2
  148. package/dist/index.cjs +342 -54
  149. package/dist/index.cjs.map +1 -1
  150. package/dist/index.d.cts +38 -4
  151. package/dist/index.d.ts +38 -4
  152. package/dist/index.js +283 -16
  153. package/dist/index.js.map +1 -1
  154. package/dist/react.cjs +17 -17
  155. package/dist/react.d.cts +2 -2
  156. package/dist/react.d.ts +2 -2
  157. package/dist/react.js +16 -16
  158. package/dist/{tools-BHWaJPOl.d.ts → tools-BVeUNdsU.d.ts} +12 -4
  159. package/dist/{tools-DlpuE76u.d.cts → tools-DdhP1kWY.d.cts} +12 -4
  160. package/package.json +1 -1
  161. package/dist/chunk-2VNMKOUO.js.map +0 -1
  162. package/dist/chunk-3M6WB62Y.cjs.map +0 -1
  163. package/dist/chunk-4QPDZJAL.cjs.map +0 -1
  164. package/dist/chunk-6OSUNBZY.js.map +0 -1
  165. package/dist/chunk-D7EHZFK4.cjs.map +0 -1
  166. package/dist/chunk-HK56GQQP.cjs.map +0 -1
  167. package/dist/chunk-OK5ZS3LU.js.map +0 -1
  168. package/dist/chunk-QMTWG6JL.cjs.map +0 -1
  169. package/dist/chunk-QTNPMIO2.cjs.map +0 -1
  170. package/dist/chunk-TZTCIAYW.cjs.map +0 -1
  171. package/dist/chunk-UFTYX73U.js.map +0 -1
  172. package/dist/chunk-VCH7RI5H.js.map +0 -1
  173. package/dist/chunk-VJGMEGMR.js.map +0 -1
  174. package/dist/chunk-VKPCR7BG.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { firstContentLine } from './chunk-2KTQ75LN.js';
2
2
  import { parseLegendDirective, applyLegendOverrides, renderLegend } from './chunk-FO7BLCEW.js';
3
- import { resolveGenogramTheme, STROKE_WIDTH, cssCustomProperties } from './chunk-2VNMKOUO.js';
3
+ import { resolveGenogramTheme, STROKE_WIDTH, cssCustomProperties } from './chunk-LRI4RH2N.js';
4
4
  import { title, text, group, pattern, path, circle, el, defs, polygon, rect, line, desc, svgRoot } from './chunk-SYYBKDL7.js';
5
5
 
6
6
  // src/diagrams/genogram/parser.ts
@@ -416,6 +416,13 @@ function splitIdAndProps(trimmed) {
416
416
  function propsTokens(propsStr) {
417
417
  return splitProps(propsStr).map((t) => t.trim().toLowerCase());
418
418
  }
419
+ function unquote(value) {
420
+ return value.replace(/^["'“「『]|["'”」』]$/g, "").trim();
421
+ }
422
+ function yearOf(value) {
423
+ const m = value.match(/(\d{4})/);
424
+ return m ? parseInt(m[1], 10) : void 0;
425
+ }
419
426
  function splitProps(propsStr) {
420
427
  const result = [];
421
428
  let current = "";
@@ -480,6 +487,35 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
480
487
  } else if (key === "death") {
481
488
  const deathNum = parseInt(value, 10);
482
489
  if (!isNaN(deathNum)) individual.deathYear = deathNum;
490
+ } else if (key === "dob") {
491
+ const v = unquote(value);
492
+ individual.dob = v;
493
+ const yr = yearOf(v);
494
+ if (yr !== void 0 && individual.birthYear === void 0) {
495
+ individual.birthYear = yr;
496
+ }
497
+ } else if (key === "dod") {
498
+ const v = unquote(value);
499
+ individual.dod = v;
500
+ const yr = yearOf(v);
501
+ if (yr !== void 0 && individual.deathYear === void 0) {
502
+ individual.deathYear = yr;
503
+ }
504
+ if (individual.status === "alive") individual.status = "deceased";
505
+ } else if (key === "note") {
506
+ individual.note = unquote(value);
507
+ } else if (key === "birth") {
508
+ const v = value.trim().toLowerCase();
509
+ if (v === "out-of-wedlock" || v === "adopted" || v === "legitimate") {
510
+ individual.birthStatus = v;
511
+ } else {
512
+ throw new ParseError(
513
+ `Invalid birth status '${value}'. Valid: legitimate, out-of-wedlock, adopted`,
514
+ lineNum,
515
+ 1,
516
+ lineText
517
+ );
518
+ }
483
519
  } else if (key === "label") {
484
520
  individual.label = value.replace(/^"|"$/g, "");
485
521
  } else if (key === "sibling-of") {
@@ -502,7 +538,7 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
502
538
  }
503
539
  } else {
504
540
  throw new ParseError(
505
- `Unknown property '${token}'. Valid: male, female, unknown, deceased, stillborn, miscarriage, abortion, adopted, foster, guardian, twin-identical, twin-fraternal, index, unknown-siblings, a 4-digit year, conditions:..., age:N, death:YYYY, label:"...", sibling-of:ID, or key:value`,
541
+ `Unknown property '${token}'. Valid: male, female, unknown, deceased, stillborn, miscarriage, abortion, adopted, foster, guardian, twin-identical, twin-fraternal, index, unknown-siblings, a 4-digit year, conditions:..., age:N, death:YYYY, dob:"YYYY-MM-DD", dod:"YYYY-MM-DD", note:"...", birth:out-of-wedlock|adopted, label:"...", sibling-of:ID, or key:value`,
506
542
  lineNum,
507
543
  1,
508
544
  lineText
@@ -594,6 +630,10 @@ function mergeIndividual(existing, incoming, lineNum, lineText) {
594
630
  label: mergedLabel,
595
631
  birthYear: incoming.birthYear ?? existing.birthYear,
596
632
  deathYear: incoming.deathYear ?? existing.deathYear,
633
+ dob: incoming.dob ?? existing.dob,
634
+ dod: incoming.dod ?? existing.dod,
635
+ note: incoming.note ?? existing.note,
636
+ birthStatus: incoming.birthStatus ?? existing.birthStatus,
597
637
  age: incoming.age ?? existing.age,
598
638
  conditions: incoming.conditions ?? existing.conditions,
599
639
  heritage: incoming.heritage ?? existing.heritage,
@@ -866,13 +906,24 @@ function orderGeneration(nodeIds, _genIdx, graph, familyUnits) {
866
906
  }
867
907
  var LABEL_HEIGHT = 20;
868
908
  var LABEL_GAP = 6;
909
+ var CAPTION_LINE = 13;
910
+ function captionExtra(graph) {
911
+ let maxLines = 0;
912
+ for (const ind of graph.individuals.values()) {
913
+ let lines = 0;
914
+ if (ind.dob || ind.dod || ind.birthStatus) lines++;
915
+ if (ind.note) lines++;
916
+ if (lines > maxLines) maxLines = lines;
917
+ }
918
+ return maxLines * CAPTION_LINE;
919
+ }
869
920
  function assignPositions(orderedGens, graph, config) {
870
921
  const positions = /* @__PURE__ */ new Map();
871
922
  const { nodeWidth, nodeSpacingX } = config;
872
923
  const half = nodeWidth / 2;
873
924
  const coupleGap = nodeWidth + nodeSpacingX * 0.6;
874
925
  const familyGap = nodeWidth + nodeSpacingX * 1.5;
875
- const genStepY = config.nodeHeight + LABEL_HEIGHT + LABEL_GAP + config.nodeSpacingY;
926
+ const genStepY = config.nodeHeight + LABEL_HEIGHT + LABEL_GAP + config.nodeSpacingY + captionExtra(graph);
876
927
  for (const gen of orderedGens) {
877
928
  const y = gen.index * genStepY + half;
878
929
  const segments = buildSegments(gen.nodeIds, gen.index, graph);
@@ -1135,7 +1186,7 @@ function resolveOverlaps(positions, orderedGens, config, graph) {
1135
1186
  function computeEdges(graph, positions, config) {
1136
1187
  const edges = [];
1137
1188
  const half = config.nodeWidth / 2;
1138
- const dropY_offset = config.nodeHeight / 2 + LABEL_HEIGHT + LABEL_GAP + config.nodeSpacingY * 0.35;
1189
+ const dropY_offset = config.nodeHeight / 2 + LABEL_HEIGHT + LABEL_GAP + config.nodeSpacingY * 0.35 + captionExtra(graph);
1139
1190
  for (const fu of graph.familyUnits) {
1140
1191
  const posA = positions.get(fu.partners[0]);
1141
1192
  const posB = positions.get(fu.partners[1]);
@@ -1272,13 +1323,24 @@ function packageResult(positions, edges, graph, config) {
1272
1323
  }
1273
1324
  return {
1274
1325
  width: maxX + padding,
1275
- height: maxY + padding + LABEL_GAP + LABEL_HEIGHT + 10,
1326
+ height: maxY + padding + LABEL_GAP + LABEL_HEIGHT + 10 + captionExtra(graph),
1276
1327
  nodes,
1277
1328
  edges: shiftedEdges
1278
1329
  };
1279
1330
  }
1280
1331
  function estimateLabelText(ind) {
1281
1332
  const name = ind.label || ind.id;
1333
+ if (ind.dob || ind.dod || ind.birthStatus || ind.note) {
1334
+ const candidates = [name];
1335
+ const born = ind.dob ?? (ind.birthYear ? String(ind.birthYear) : void 0);
1336
+ const died = ind.dod ?? (ind.deathYear ? String(ind.deathYear) : void 0);
1337
+ const dateParts = [];
1338
+ if (born) dateParts.push(`[*] ${born}`);
1339
+ if (died || ind.status === "deceased") dateParts.push(`\u2020 ${died ?? ""}`);
1340
+ if (dateParts.length) candidates.push(dateParts.join(" "));
1341
+ if (ind.note) candidates.push(ind.note);
1342
+ return candidates.reduce((a, b) => b.length > a.length ? b : a, name);
1343
+ }
1282
1344
  if (ind.birthYear && ind.deathYear) return `${name} (${ind.birthYear}\u2013${ind.deathYear})`;
1283
1345
  if (ind.birthYear) return `${name} (b. ${ind.birthYear})`;
1284
1346
  return name;
@@ -2257,6 +2319,8 @@ function buildStyles(config) {
2257
2319
  .schematex-genogram-female .schematex-genogram-shape { fill: ${t.femaleFill}; }
2258
2320
  .schematex-genogram-unknown .schematex-genogram-shape { fill: ${t.unknownFill}; }
2259
2321
  .schematex-genogram-label { font-family: ${config.fontFamily}; font-size: ${config.fontSize}px; text-anchor: middle; fill: ${t.text}; }
2322
+ .schematex-genogram-vitals { font-family: ${config.fontFamily}; font-size: ${Math.max(9, config.fontSize - 1)}px; text-anchor: middle; fill: ${t.textMuted}; }
2323
+ .schematex-genogram-note { font-family: ${config.fontFamily}; font-size: ${Math.max(9, config.fontSize - 1)}px; font-style: italic; text-anchor: middle; fill: ${t.textMuted}; }
2260
2324
  .schematex-genogram-edge { stroke: ${t.neutral}; stroke-width: ${STROKE_WIDTH.normal}; fill: none; stroke-linecap: round; stroke-linejoin: round; }
2261
2325
  .schematex-genogram-edge-cohabiting path { stroke-dasharray: 6,4; }
2262
2326
  .schematex-genogram-edge-cohabiting-ended path { stroke-dasharray: 6,4; }
@@ -2563,16 +2627,22 @@ function renderSiblingOfBrackets(layout, ast) {
2563
2627
  }
2564
2628
  function renderLabels(nodes, config) {
2565
2629
  const labels = [];
2630
+ const captionStep = config.fontSize + 1;
2566
2631
  for (const node of nodes) {
2567
2632
  const ind = node.individual;
2568
2633
  const label = ind.label || ind.id;
2569
2634
  const cx = node.x + node.width / 2;
2570
2635
  const labelY = node.y + node.height + 6 + config.fontSize;
2571
- let labelText = label.charAt(0).toUpperCase() + label.slice(1);
2572
- if (ind.birthYear && ind.deathYear) {
2573
- labelText += ` (${ind.birthYear}\u2013${ind.deathYear})`;
2574
- } else if (ind.birthYear) {
2575
- labelText += ` (b. ${ind.birthYear})`;
2636
+ const nameText = label.charAt(0).toUpperCase() + label.slice(1);
2637
+ const datesLine = vitalDatesLine(ind);
2638
+ const usesGenealogy = datesLine !== null || !!ind.note;
2639
+ let nameLabel = nameText;
2640
+ if (!usesGenealogy) {
2641
+ if (ind.birthYear && ind.deathYear) {
2642
+ nameLabel += ` (${ind.birthYear}\u2013${ind.deathYear})`;
2643
+ } else if (ind.birthYear) {
2644
+ nameLabel += ` (b. ${ind.birthYear})`;
2645
+ }
2576
2646
  }
2577
2647
  labels.push(
2578
2648
  text(
@@ -2582,12 +2652,54 @@ function renderLabels(nodes, config) {
2582
2652
  class: "schematex-genogram-label",
2583
2653
  "data-individual-id": ind.id
2584
2654
  },
2585
- labelText
2655
+ nameLabel
2586
2656
  )
2587
2657
  );
2658
+ let lineY = labelY;
2659
+ if (datesLine !== null) {
2660
+ lineY += captionStep;
2661
+ labels.push(
2662
+ text(
2663
+ {
2664
+ x: cx,
2665
+ y: lineY,
2666
+ class: "schematex-genogram-vitals",
2667
+ "data-individual-id": ind.id
2668
+ },
2669
+ datesLine
2670
+ )
2671
+ );
2672
+ }
2673
+ if (ind.note) {
2674
+ lineY += captionStep;
2675
+ labels.push(
2676
+ text(
2677
+ {
2678
+ x: cx,
2679
+ y: lineY,
2680
+ class: "schematex-genogram-note",
2681
+ "data-individual-id": ind.id
2682
+ },
2683
+ ind.note
2684
+ )
2685
+ );
2686
+ }
2588
2687
  }
2589
2688
  return group({ class: "schematex-genogram-labels" }, labels);
2590
2689
  }
2690
+ function vitalDatesLine(ind) {
2691
+ const bornText = ind.dob ?? (ind.birthYear ? String(ind.birthYear) : void 0);
2692
+ const diedText = ind.dod ?? (ind.deathYear ? String(ind.deathYear) : void 0);
2693
+ const isDeceased = ind.status === "deceased" || diedText !== void 0;
2694
+ const hasFullDate = !!ind.dob || !!ind.dod;
2695
+ if (!hasFullDate && !ind.birthStatus) return null;
2696
+ const bornGlyph = ind.birthStatus === "adopted" ? "[*]" : ind.birthStatus === "out-of-wedlock" ? "(*)" : "*";
2697
+ const parts = [];
2698
+ if (bornText) parts.push(`${bornGlyph} ${bornText}`);
2699
+ else if (ind.birthStatus) parts.push(bornGlyph);
2700
+ if (isDeceased) parts.push(diedText ? `\u2020 ${diedText}` : "\u2020");
2701
+ return parts.length > 0 ? parts.join(" ") : null;
2702
+ }
2591
2703
 
2592
2704
  // src/diagrams/genogram/index.ts
2593
2705
  var genogram = {
@@ -2617,5 +2729,5 @@ var genogram = {
2617
2729
  };
2618
2730
 
2619
2731
  export { ParseError, genogram, getRequiredDefs, layoutGenogram, parseGenogram, renderGenogram, renderIndividualSymbol };
2620
- //# sourceMappingURL=chunk-VJGMEGMR.js.map
2621
- //# sourceMappingURL=chunk-VJGMEGMR.js.map
2732
+ //# sourceMappingURL=chunk-DOK7LKLO.js.map
2733
+ //# sourceMappingURL=chunk-DOK7LKLO.js.map