@diagrammo/dgmo 0.48.2 → 0.49.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/.cursorrules +8 -3
- package/.github/copilot-instructions.md +8 -3
- package/.windsurfrules +8 -3
- package/SKILL.md +8 -3
- package/dist/advanced.d.ts +444 -1
- package/dist/advanced.js +208 -146
- package/dist/auto.css +63 -0
- package/dist/auto.js +202 -102
- package/dist/auto.mjs +6849 -824
- package/dist/block.css +63 -0
- package/dist/block.d.ts +13 -5
- package/dist/block.js +137 -57
- package/dist/{charts-d3-QOZHKTCT.js → charts-d3-EW3YQTEA.js} +9 -8
- package/dist/chunk-26RVGM44.js +331 -0
- package/dist/{chunk-44CM72SQ.js → chunk-2WMBWZY2.js} +3 -3
- package/dist/{chunk-L66GEFB6.js → chunk-35BBZDFE.js} +4 -4
- package/dist/{chunk-4GRI7MEB.js → chunk-3BIAFYD2.js} +6 -6
- package/dist/chunk-3NFJWFNP.js +1474 -0
- package/dist/{chunk-76OWZ3BA.js → chunk-4BD7EVPK.js} +2 -2
- package/dist/{chunk-MITI6NOL.js → chunk-4FIV4K4Z.js} +9 -9
- package/dist/chunk-4HVNZ7WF.js +574 -0
- package/dist/{chunk-X5LCYCL5.js → chunk-4NQ3IKUM.js} +2 -2
- package/dist/{chunk-PWIHZ6NJ.js → chunk-4UDKKGHH.js} +4 -4
- package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
- package/dist/chunk-4YNP6O47.js +607 -0
- package/dist/{chunk-3MQQNXPD.js → chunk-5FGDJIJX.js} +3 -3
- package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
- package/dist/chunk-5XCM7UUW.js +261 -0
- package/dist/{chunk-RYEGFMUO.js → chunk-5ZZLLBFK.js} +2 -2
- package/dist/{chunk-EB6FPQUP.js → chunk-65RTDUZH.js} +3 -3
- package/dist/chunk-6CLKNXVP.js +664 -0
- package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
- package/dist/{chunk-ZGR7ULFJ.js → chunk-6SA7FJE4.js} +31 -19
- package/dist/{chunk-LIOHW36Z.js → chunk-6VE3VLWM.js} +3 -3
- package/dist/{chunk-AN2MOO5T.js → chunk-7OVSJI2V.js} +3 -3
- package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
- package/dist/{chunk-FCIIHT24.js → chunk-7VLUGEMJ.js} +7 -7
- package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
- package/dist/{chunk-3R5POCTZ.js → chunk-AJ2PEY7J.js} +6 -6
- package/dist/{chunk-PBHE5UG6.js → chunk-ALRHIR6I.js} +46 -12
- package/dist/{chunk-7JEGTRLD.js → chunk-B57V3DWN.js} +3 -3
- package/dist/{chunk-ILKORZ3H.js → chunk-BCT5G2VN.js} +7 -7
- package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
- package/dist/{chunk-ZBWMSD5N.js → chunk-BGJV5ATD.js} +4 -4
- package/dist/{chunk-G2H74XJZ.js → chunk-BPIJLRYE.js} +8 -8
- package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
- package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
- package/dist/{chunk-QEBUY5NY.js → chunk-CEHZOPGM.js} +4 -4
- package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
- package/dist/{chunk-5QXL4NYS.js → chunk-CLR4A2N2.js} +10 -5
- package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
- package/dist/{chunk-SML67VPV.js → chunk-D5AVQCDN.js} +3 -3
- package/dist/{chunk-2LACINWN.js → chunk-DDTJ5N7Q.js} +9 -9
- package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
- package/dist/{chunk-B65G5DNL.js → chunk-EYN7VFKL.js} +3 -3
- package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
- package/dist/{chunk-RVMRZAPB.js → chunk-F743CM2N.js} +3 -3
- package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
- package/dist/{chunk-WCSOJFU3.js → chunk-FMKTYMP4.js} +3 -3
- package/dist/{chunk-RTLBSQ3G.js → chunk-FUCAB3KQ.js} +3 -3
- package/dist/{chunk-SGZYXELT.js → chunk-GB3YZTAM.js} +9 -6
- package/dist/{chunk-QLCCJEJI.js → chunk-HBVD67XG.js} +2 -2
- package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
- package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
- package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
- package/dist/chunk-IAEC4KLA.js +492 -0
- package/dist/{chunk-J5FIXQRT.js → chunk-IBC35BTK.js} +4 -4
- package/dist/{chunk-NURGB5Z4.js → chunk-IFK3GIUW.js} +2 -2
- package/dist/{chunk-FANX6UJR.js → chunk-IHLSHCPZ.js} +11 -11
- package/dist/{chunk-GMR5MFHJ.js → chunk-IUK7AGD4.js} +2 -2
- package/dist/chunk-IVKC4GID.js +32 -0
- package/dist/{chunk-OJR3MQYV.js → chunk-JFPY3UJ7.js} +296 -57
- package/dist/{chunk-5MLYVTYM.js → chunk-K6HNAY5V.js} +2 -2
- package/dist/{chunk-P235SVAH.js → chunk-KQAEKMIX.js} +2 -2
- package/dist/{chunk-7DTWEFUE.js → chunk-KUBBJ2CD.js} +10 -10
- package/dist/{chunk-BUVJFRPY.js → chunk-KV6Y2HE6.js} +4 -4
- package/dist/{chunk-OURHMODR.js → chunk-LG4TWW4U.js} +13 -13
- package/dist/{chunk-XAKEUMEJ.js → chunk-LVHPTBO3.js} +3 -3
- package/dist/{chunk-ERLBPDGU.js → chunk-MJCG5K2O.js} +2 -2
- package/dist/{chunk-THXCFRTU.js → chunk-N4J5KGWG.js} +12 -12
- package/dist/{chunk-MZSBFAPJ.js → chunk-NVT6C2VE.js} +9 -9
- package/dist/{chunk-AELOBFW5.js → chunk-O5MQPK7E.js} +3 -3
- package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
- package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
- package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
- package/dist/{chunk-B7JUCQUA.js → chunk-PU3AUQPA.js} +4 -4
- package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
- package/dist/chunk-QQJUTGQH.js +135 -0
- package/dist/{chunk-HSH73DP6.js → chunk-RI4NIMFP.js} +99 -39
- package/dist/{chunk-33LCUH4H.js → chunk-RTERS6S5.js} +3 -3
- package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
- package/dist/chunk-SGHSY3LU.js +377 -0
- package/dist/{chunk-SRTU6HMQ.js → chunk-SJEGO2QL.js} +8 -8
- package/dist/chunk-SQDFK5ZQ.js +273 -0
- package/dist/{chunk-PZMETGLY.js → chunk-SVDWQGX2.js} +296 -121
- package/dist/{chunk-Z5CGSFJB.js → chunk-T7IKPCMI.js} +4 -4
- package/dist/chunk-TC3YWBFO.js +233 -0
- package/dist/{chunk-EVCVDTXE.js → chunk-TLKMTQYL.js} +3 -3
- package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
- package/dist/{chunk-IZMRON6C.js → chunk-UVCXZEGU.js} +2 -2
- package/dist/{chunk-CKNVO24D.js → chunk-UWDO3O52.js} +2 -2
- package/dist/{chunk-RJE5JTVK.js → chunk-VC3TR4NL.js} +7 -7
- package/dist/{chunk-CI2G3OEB.js → chunk-X2CH42BN.js} +9 -9
- package/dist/{chunk-6HO5ZTXK.js → chunk-XCC2RENT.js} +2 -2
- package/dist/chunk-XHVV4NVW.js +51 -0
- package/dist/{chunk-ZJEL4H2R.js → chunk-XJ7J6WOO.js} +9 -9
- package/dist/{chunk-ULOEATBZ.js → chunk-XKTN7CZF.js} +106 -29
- package/dist/{chunk-IPWPWM6R.js → chunk-YM2BSPYW.js} +111 -10
- package/dist/{chunk-BUPDIHML.js → chunk-YRVLP7UU.js} +3 -3
- package/dist/{chunk-T2OE3YQB.js → chunk-YTN572Q2.js} +3 -3
- package/dist/{chunk-WVAJFAIA.js → chunk-YYX3SU6H.js} +3 -3
- package/dist/{chunk-MO5YHHMQ.js → chunk-ZDUQGL3N.js} +2 -2
- package/dist/{chunk-Y3J7VR52.js → chunk-ZNQX6QWH.js} +30 -2
- package/dist/{chunk-UWN33VNX.js → chunk-ZREZOIGS.js} +8 -8
- package/dist/{chunk-6SM5NJQH.js → chunk-ZTLWVRNS.js} +4 -4
- package/dist/{chunk-RUNNI6VE.js → chunk-ZXL6MB4R.js} +3 -3
- package/dist/cli.cjs +159 -122
- package/dist/dgmo-router-ODKPEJ3P.js +79 -0
- package/dist/dimensions-WSIJXT5Q.js +22 -0
- package/dist/editor.js +4 -1
- package/dist/element.js +203 -103
- package/dist/element.mjs +6849 -824
- package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-IVZN7CQN.js} +4 -4
- package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GMI2U3DD.js} +9 -9
- package/dist/highlight.js +7 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +193 -232
- package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
- package/dist/{layout-5RA6QWR6.js → layout-4Z5JM7PT.js} +6 -6
- package/dist/layout-6RDJHS6E.js +9 -0
- package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
- package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
- package/dist/{layout-HWDSRX5E.js → layout-D42XE4RE.js} +6 -6
- package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
- package/dist/layout-FGQWRYYW.js +14 -0
- package/dist/layout-GZ2CWONU.js +14 -0
- package/dist/layout-HQMBPJVS.js +10 -0
- package/dist/{layout-UM5F4DJB.js → layout-K2ZN3Q42.js} +5 -5
- package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
- package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
- package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
- package/dist/layout-S3EK4IYO.js +14 -0
- package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
- package/dist/{parser-KNSQSKQO.js → parser-4BKIFG2C.js} +5 -5
- package/dist/{parser-OV7NOBW6.js → parser-4ROBKVUR.js} +4 -4
- package/dist/parser-667RGSUW.js +13 -0
- package/dist/{parser-IXSZZQHY.js → parser-BL7Z72EY.js} +4 -4
- package/dist/{parser-AQETEVRW.js → parser-CLMFZWCC.js} +4 -4
- package/dist/{parser-XKRP7QKP.js → parser-D6ONJQFR.js} +3 -3
- package/dist/{parser-2EWECDSA.js → parser-DERPY5KC.js} +4 -4
- package/dist/{parser-4OGOBJJ4.js → parser-GFSOPDB7.js} +4 -4
- package/dist/{parser-2MFP2H2E.js → parser-HVJFTOXL.js} +3 -3
- package/dist/{parser-VQP2UJ6W.js → parser-IKZFTLOJ.js} +3 -3
- package/dist/parser-J3P2D6IP.js +13 -0
- package/dist/{parser-PQ3POX45.js → parser-JD7OQ2E6.js} +4 -4
- package/dist/{parser-O5J4VBII.js → parser-K647FRI4.js} +3 -3
- package/dist/{parser-NGU3ETO6.js → parser-KPMN5KKE.js} +4 -4
- package/dist/{parser-4FL2CMDG.js → parser-MBJSBTL5.js} +4 -4
- package/dist/{parser-TFZFBVWN.js → parser-MCJWF5G3.js} +3 -3
- package/dist/{parser-NRAI6O25.js → parser-MRBPXXIV.js} +4 -4
- package/dist/{parser-6BTRLKRZ.js → parser-OBQG655V.js} +4 -4
- package/dist/{parser-3STE62GB.js → parser-QJYS7KQQ.js} +4 -4
- package/dist/{parser-XDVELHRK.js → parser-SMBJO3XN.js} +4 -4
- package/dist/{parser-TRTHDFPP.js → parser-TITK4YW6.js} +5 -5
- package/dist/{parser-I6KXEYFK.js → parser-TNYX5S7E.js} +4 -4
- package/dist/{parser-Y6WTBU76.js → parser-UBGPTIZD.js} +3 -3
- package/dist/parser-UGA23PYK.js +14 -0
- package/dist/{parser-N5O4IHUN.js → parser-WISPH7LW.js} +4 -4
- package/dist/{parser-CFZD5IBL.js → parser-XWUDFJ7P.js} +4 -4
- package/dist/parser-ZKF5K2H2.js +15 -0
- package/dist/{parser-ZSDPZYQP.js → parser-ZYC3XGNS.js} +4 -4
- package/dist/{renderer-AWWAF6XD.js → renderer-4IUPINAE.js} +10 -10
- package/dist/renderer-6L3NBEY5.js +24 -0
- package/dist/{renderer-ZRNG54CW.js → renderer-6T3KK4S3.js} +11 -11
- package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
- package/dist/{renderer-6EEZHMH4.js → renderer-A5VFZQQK.js} +9 -9
- package/dist/{renderer-5MYBMBYO.js → renderer-BB5PREMY.js} +5 -5
- package/dist/{renderer-BYCNMBF7.js → renderer-CGW7QPNA.js} +10 -10
- package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
- package/dist/{renderer-7MVLWWQD.js → renderer-DKESNMU5.js} +9 -9
- package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
- package/dist/{renderer-VACVQYML.js → renderer-LWGJFT3D.js} +8 -8
- package/dist/{renderer-PGX2TKVS.js → renderer-MFJ7HY2H.js} +8 -8
- package/dist/{renderer-B2OMQIQG.js → renderer-MJDDU27W.js} +15 -15
- package/dist/{renderer-4JHRUBE6.js → renderer-QL5KO6SK.js} +10 -10
- package/dist/{renderer-W4M6QLIJ.js → renderer-QNHUXCRL.js} +14 -14
- package/dist/{renderer-ZGNTUWC4.js → renderer-ROV756WT.js} +8 -8
- package/dist/{renderer-YY2OSF6E.js → renderer-SQ3JUAI7.js} +9 -9
- package/dist/renderer-THD6V5TL.js +22 -0
- package/dist/{renderer-5NDVNDAZ.js → renderer-TPIBXNOS.js} +9 -9
- package/dist/{renderer-RPOA5YPZ.js → renderer-TYXRHMRI.js} +13 -13
- package/dist/{renderer-N43WR5GV.js → renderer-UZF3JROD.js} +11 -11
- package/dist/{renderer-6W5462RB.js → renderer-V3JEMWMM.js} +9 -9
- package/dist/{renderer-JGBKUCZD.js → renderer-VFUVRNLK.js} +4 -4
- package/dist/{renderer-Z7I3W2PP.js → renderer-VICQ4WNY.js} +8 -8
- package/dist/renderer-W5RMOURB.js +21 -0
- package/dist/renderer-XEKIRPI6.js +23 -0
- package/dist/{renderer-CLJHQPBJ.js → renderer-YHXPN3GF.js} +12 -12
- package/dist/renderer-radial-MHO2VDXN.js +21 -0
- package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
- package/dist/{state-parser-Z2V23ATR.js → state-parser-RX3GXOIB.js} +4 -4
- package/dist/{state-renderer-B4DQBM6M.js → state-renderer-AJUKGNWU.js} +9 -9
- package/docs/ai-integration.md +8 -3
- package/docs/language-reference.md +179 -5
- package/gallery/fixtures/family.dgmo +23 -0
- package/gallery/fixtures/sketch.dgmo +22 -0
- package/package.json +1 -1
- package/dist/chunk-ODZVHU3R.js +0 -153
- package/dist/dgmo-router-X35VLZLM.js +0 -73
- package/dist/dimensions-J3FHIMJ6.js +0 -22
- package/dist/layout-5T6RH5M6.js +0 -14
- package/dist/layout-G23F7LDH.js +0 -9
- package/dist/layout-OB3RI63S.js +0 -14
- package/dist/parser-JAL2HD4I.js +0 -13
- package/dist/renderer-SMIBCRVB.js +0 -24
- package/dist/renderer-radial-C32GPJQ7.js +0 -21
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import {
|
|
2
|
+
familyCardRows
|
|
3
|
+
} from "./chunk-IVKC4GID.js";
|
|
4
|
+
import {
|
|
5
|
+
HEADER_HEIGHT,
|
|
6
|
+
LABEL_FONT_SIZE,
|
|
7
|
+
META_FONT_SIZE,
|
|
8
|
+
META_LINE_HEIGHT,
|
|
9
|
+
SEPARATOR_GAP
|
|
10
|
+
} from "./chunk-3CIOJ5YJ.js";
|
|
11
|
+
import {
|
|
12
|
+
measureText
|
|
13
|
+
} from "./chunk-5LWQH6QV.js";
|
|
14
|
+
import {
|
|
15
|
+
buildCoupleQuotient,
|
|
16
|
+
rankClasses
|
|
17
|
+
} from "./chunk-QQJUTGQH.js";
|
|
18
|
+
|
|
19
|
+
// src/family/layout.ts
|
|
20
|
+
var MARGIN = 30;
|
|
21
|
+
var MIN_CARD_W = 132;
|
|
22
|
+
var CARD_H_PAD = 12;
|
|
23
|
+
var CARD_TEXT_PAD = 12;
|
|
24
|
+
var H_GAP = 60;
|
|
25
|
+
var ROW_GAP = 74;
|
|
26
|
+
var KEY_VALUE_GAP = 6;
|
|
27
|
+
var KEY_X = 10;
|
|
28
|
+
var GUTTER_WIDTH = 72;
|
|
29
|
+
function birthYear(persons, id) {
|
|
30
|
+
const b = persons.get(id)?.metadata["b"];
|
|
31
|
+
if (b === void 0) return null;
|
|
32
|
+
const n = parseInt(b, 10);
|
|
33
|
+
return Number.isFinite(n) ? n : null;
|
|
34
|
+
}
|
|
35
|
+
function sortChildrenByBirth(children, persons) {
|
|
36
|
+
return children.map((c, i) => ({ c, i, b: birthYear(persons, c.personId) })).sort((x, y) => {
|
|
37
|
+
if (x.b !== null && y.b !== null) return x.b - y.b || x.i - y.i;
|
|
38
|
+
if (x.b !== null) return -1;
|
|
39
|
+
if (y.b !== null) return 1;
|
|
40
|
+
return x.i - y.i;
|
|
41
|
+
}).map((o) => o.c);
|
|
42
|
+
}
|
|
43
|
+
function computeBloodline(unions, focusId) {
|
|
44
|
+
const childOf = /* @__PURE__ */ new Map();
|
|
45
|
+
const parentOf = /* @__PURE__ */ new Map();
|
|
46
|
+
const unionById = new Map(unions.map((u) => [u.id, u]));
|
|
47
|
+
for (const u of unions) {
|
|
48
|
+
for (const p of u.parents)
|
|
49
|
+
(parentOf.get(p) ?? parentOf.set(p, []).get(p)).push(u.id);
|
|
50
|
+
for (const c of u.children)
|
|
51
|
+
(childOf.get(c.personId) ?? childOf.set(c.personId, []).get(c.personId)).push(u.id);
|
|
52
|
+
}
|
|
53
|
+
const set = /* @__PURE__ */ new Set([focusId]);
|
|
54
|
+
const up = [focusId];
|
|
55
|
+
while (up.length) {
|
|
56
|
+
const id = up.pop();
|
|
57
|
+
for (const uid of childOf.get(id) ?? [])
|
|
58
|
+
for (const p of unionById.get(uid).parents)
|
|
59
|
+
if (!set.has(p)) {
|
|
60
|
+
set.add(p);
|
|
61
|
+
up.push(p);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const down = [focusId];
|
|
65
|
+
while (down.length) {
|
|
66
|
+
const id = down.pop();
|
|
67
|
+
for (const uid of parentOf.get(id) ?? [])
|
|
68
|
+
for (const c of unionById.get(uid).children)
|
|
69
|
+
if (!set.has(c.personId)) {
|
|
70
|
+
set.add(c.personId);
|
|
71
|
+
down.push(c.personId);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const id of [...set])
|
|
75
|
+
for (const uid of parentOf.get(id) ?? [])
|
|
76
|
+
for (const p of unionById.get(uid).parents) set.add(p);
|
|
77
|
+
return set;
|
|
78
|
+
}
|
|
79
|
+
function cardSize(p) {
|
|
80
|
+
const rows = familyCardRows(p);
|
|
81
|
+
const labeled = rows.filter((r) => !r.year);
|
|
82
|
+
const maxKeyW = labeled.length ? Math.max(...labeled.map((r) => measureText(`${r.key}: `, META_FONT_SIZE))) : 0;
|
|
83
|
+
const valueX = KEY_X + maxKeyW + KEY_VALUE_GAP;
|
|
84
|
+
let contentRight = 0;
|
|
85
|
+
for (const r of rows) {
|
|
86
|
+
const right = r.year ? KEY_X + measureText(r.value, META_FONT_SIZE) : valueX + measureText(r.value, META_FONT_SIZE);
|
|
87
|
+
contentRight = Math.max(contentRight, right);
|
|
88
|
+
}
|
|
89
|
+
const labelW = measureText(p.label, LABEL_FONT_SIZE);
|
|
90
|
+
const width = Math.max(
|
|
91
|
+
MIN_CARD_W,
|
|
92
|
+
labelW + CARD_TEXT_PAD * 2,
|
|
93
|
+
contentRight + CARD_TEXT_PAD
|
|
94
|
+
);
|
|
95
|
+
const height = rows.length > 0 ? HEADER_HEIGHT + SEPARATOR_GAP + rows.length * META_LINE_HEIGHT + CARD_H_PAD : HEADER_HEIGHT + CARD_H_PAD;
|
|
96
|
+
return { width, height };
|
|
97
|
+
}
|
|
98
|
+
function orderRow(persons, parentUnions, unionParents, unionChildren, unionOrder) {
|
|
99
|
+
const disco = /* @__PURE__ */ new Map();
|
|
100
|
+
let seq = 0;
|
|
101
|
+
const visit = (id) => {
|
|
102
|
+
if (disco.has(id)) return;
|
|
103
|
+
disco.set(id, seq++);
|
|
104
|
+
for (const uid of parentUnions.get(id) ?? []) {
|
|
105
|
+
for (const sp of unionParents.get(uid) ?? []) visit(sp);
|
|
106
|
+
for (const ch of unionChildren.get(uid) ?? []) visit(ch);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
for (const uid of unionOrder) {
|
|
110
|
+
for (const p of unionParents.get(uid) ?? []) visit(p);
|
|
111
|
+
}
|
|
112
|
+
for (const id of persons.keys()) visit(id);
|
|
113
|
+
return disco;
|
|
114
|
+
}
|
|
115
|
+
function orderRowSpouses(ids, spouseAdj, discoOf) {
|
|
116
|
+
const inRow = new Set(ids);
|
|
117
|
+
const nbrs = (id) => [...spouseAdj.get(id) ?? []].filter((n) => inRow.has(n));
|
|
118
|
+
const visited = /* @__PURE__ */ new Set();
|
|
119
|
+
const components = [];
|
|
120
|
+
for (const seed of [...ids].sort((a, b) => discoOf(a) - discoOf(b))) {
|
|
121
|
+
if (visited.has(seed)) continue;
|
|
122
|
+
const comp = [];
|
|
123
|
+
const stack = [seed];
|
|
124
|
+
visited.add(seed);
|
|
125
|
+
while (stack.length) {
|
|
126
|
+
const v = stack.pop();
|
|
127
|
+
comp.push(v);
|
|
128
|
+
for (const w of nbrs(v))
|
|
129
|
+
if (!visited.has(w)) {
|
|
130
|
+
visited.add(w);
|
|
131
|
+
stack.push(w);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (comp.length === 1) {
|
|
135
|
+
components.push(comp);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const start = comp.filter((id) => nbrs(id).length <= 1).sort((a, b) => discoOf(a) - discoOf(b))[0] ?? comp.slice().sort((a, b) => discoOf(a) - discoOf(b))[0];
|
|
139
|
+
const path = [];
|
|
140
|
+
const seen = /* @__PURE__ */ new Set();
|
|
141
|
+
let cur = start;
|
|
142
|
+
while (cur !== void 0 && !seen.has(cur)) {
|
|
143
|
+
seen.add(cur);
|
|
144
|
+
path.push(cur);
|
|
145
|
+
cur = nbrs(cur).filter((n) => !seen.has(n)).sort((a, b) => discoOf(a) - discoOf(b))[0];
|
|
146
|
+
}
|
|
147
|
+
for (const id of comp) if (!seen.has(id)) path.push(id);
|
|
148
|
+
components.push(path);
|
|
149
|
+
}
|
|
150
|
+
components.sort(
|
|
151
|
+
(x, y) => Math.min(...x.map(discoOf)) - Math.min(...y.map(discoOf))
|
|
152
|
+
);
|
|
153
|
+
return components.flat();
|
|
154
|
+
}
|
|
155
|
+
function focusFamily(parsed, focusId) {
|
|
156
|
+
if (!parsed.persons.has(focusId)) {
|
|
157
|
+
return { persons: parsed.persons, unions: parsed.unions, parents: [] };
|
|
158
|
+
}
|
|
159
|
+
const childOf = /* @__PURE__ */ new Map();
|
|
160
|
+
const parentOf = /* @__PURE__ */ new Map();
|
|
161
|
+
const unionById = new Map(parsed.unions.map((u) => [u.id, u]));
|
|
162
|
+
for (const u of parsed.unions) {
|
|
163
|
+
for (const p of u.parents)
|
|
164
|
+
(parentOf.get(p) ?? parentOf.set(p, []).get(p)).push(u.id);
|
|
165
|
+
for (const c of u.children)
|
|
166
|
+
(childOf.get(c.personId) ?? childOf.set(c.personId, []).get(c.personId)).push(u.id);
|
|
167
|
+
}
|
|
168
|
+
const visible = /* @__PURE__ */ new Set([focusId]);
|
|
169
|
+
const down = [focusId];
|
|
170
|
+
while (down.length) {
|
|
171
|
+
const id = down.pop();
|
|
172
|
+
for (const uid of parentOf.get(id) ?? [])
|
|
173
|
+
for (const c of unionById.get(uid).children)
|
|
174
|
+
if (!visible.has(c.personId)) {
|
|
175
|
+
visible.add(c.personId);
|
|
176
|
+
down.push(c.personId);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const id of [...visible])
|
|
180
|
+
for (const uid of parentOf.get(id) ?? [])
|
|
181
|
+
for (const p of unionById.get(uid).parents) visible.add(p);
|
|
182
|
+
const parentIds = /* @__PURE__ */ new Set();
|
|
183
|
+
for (const uid of childOf.get(focusId) ?? [])
|
|
184
|
+
for (const p of unionById.get(uid).parents) parentIds.add(p);
|
|
185
|
+
const parents = [...parentIds].map((id) => parsed.persons.get(id)).filter((p) => p !== void 0);
|
|
186
|
+
const persons = /* @__PURE__ */ new Map();
|
|
187
|
+
for (const [id, p] of parsed.persons) if (visible.has(id)) persons.set(id, p);
|
|
188
|
+
const unions = parsed.unions.filter((u) => u.parents.every((p) => visible.has(p))).map((u) => ({
|
|
189
|
+
...u,
|
|
190
|
+
children: u.children.filter((c) => visible.has(c.personId))
|
|
191
|
+
}));
|
|
192
|
+
return { persons, unions, parents };
|
|
193
|
+
}
|
|
194
|
+
function layoutFamily(parsed, focusId) {
|
|
195
|
+
const focused = focusId ? focusFamily(parsed, focusId) : null;
|
|
196
|
+
const persons = focused ? focused.persons : parsed.persons;
|
|
197
|
+
const unions = (focused ? focused.unions : parsed.unions).map((u) => ({ ...u, children: sortChildrenByBirth(u.children, persons) }));
|
|
198
|
+
const focusParents = focused ? focused.parents : [];
|
|
199
|
+
const highlightId = parsed.options["highlight"] || null;
|
|
200
|
+
const litSet = highlightId ? computeBloodline(unions, highlightId) : null;
|
|
201
|
+
const showGen = parsed.options["generations"] === "true";
|
|
202
|
+
const ANCESTOR_STAGGER = 20;
|
|
203
|
+
const ANCESTOR_BAND = focusParents.length > 0 ? 34 + Math.max(0, focusParents.length - 1) * ANCESTOR_STAGGER : 0;
|
|
204
|
+
const quotient = buildCoupleQuotient(persons, unions);
|
|
205
|
+
const classRow = quotient.cycle ? /* @__PURE__ */ new Map() : rankClasses(quotient);
|
|
206
|
+
const rowOf = (id) => {
|
|
207
|
+
const c = quotient.classOf.get(id);
|
|
208
|
+
return c === void 0 ? 0 : classRow.get(c) ?? 0;
|
|
209
|
+
};
|
|
210
|
+
const parentUnions = /* @__PURE__ */ new Map();
|
|
211
|
+
const unionParents = /* @__PURE__ */ new Map();
|
|
212
|
+
const unionChildren = /* @__PURE__ */ new Map();
|
|
213
|
+
const unionOrder = [];
|
|
214
|
+
for (const u of unions) {
|
|
215
|
+
unionOrder.push(u.id);
|
|
216
|
+
unionParents.set(u.id, [...u.parents]);
|
|
217
|
+
unionChildren.set(
|
|
218
|
+
u.id,
|
|
219
|
+
u.children.map((c) => c.personId)
|
|
220
|
+
);
|
|
221
|
+
for (const p of u.parents) {
|
|
222
|
+
(parentUnions.get(p) ?? parentUnions.set(p, []).get(p)).push(u.id);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const disco = orderRow(
|
|
226
|
+
persons,
|
|
227
|
+
parentUnions,
|
|
228
|
+
unionParents,
|
|
229
|
+
unionChildren,
|
|
230
|
+
unionOrder
|
|
231
|
+
);
|
|
232
|
+
const sizes = /* @__PURE__ */ new Map();
|
|
233
|
+
for (const [id, p] of persons) sizes.set(id, cardSize(p));
|
|
234
|
+
const rowPersons = /* @__PURE__ */ new Map();
|
|
235
|
+
let maxRow = 0;
|
|
236
|
+
for (const id of persons.keys()) {
|
|
237
|
+
const r = rowOf(id);
|
|
238
|
+
maxRow = Math.max(maxRow, r);
|
|
239
|
+
(rowPersons.get(r) ?? rowPersons.set(r, []).get(r)).push(id);
|
|
240
|
+
}
|
|
241
|
+
const spouseAdj = /* @__PURE__ */ new Map();
|
|
242
|
+
for (const u of unions) {
|
|
243
|
+
if (u.parents.length !== 2) continue;
|
|
244
|
+
const [a, b] = u.parents;
|
|
245
|
+
(spouseAdj.get(a) ?? spouseAdj.set(a, /* @__PURE__ */ new Set()).get(a)).add(b);
|
|
246
|
+
(spouseAdj.get(b) ?? spouseAdj.set(b, /* @__PURE__ */ new Set()).get(b)).add(a);
|
|
247
|
+
}
|
|
248
|
+
const discoOf = (id) => disco.get(id) ?? 0;
|
|
249
|
+
for (const [r, arr] of rowPersons) {
|
|
250
|
+
rowPersons.set(r, orderRowSpouses(arr, spouseAdj, discoOf));
|
|
251
|
+
}
|
|
252
|
+
const rowHeight = /* @__PURE__ */ new Map();
|
|
253
|
+
for (let r = 0; r <= maxRow; r++) {
|
|
254
|
+
let h = 0;
|
|
255
|
+
for (const id of rowPersons.get(r) ?? [])
|
|
256
|
+
h = Math.max(h, sizes.get(id).height);
|
|
257
|
+
rowHeight.set(r, h);
|
|
258
|
+
}
|
|
259
|
+
const rowY = /* @__PURE__ */ new Map();
|
|
260
|
+
{
|
|
261
|
+
let acc = MARGIN + ANCESTOR_BAND;
|
|
262
|
+
for (let r = 0; r <= maxRow; r++) {
|
|
263
|
+
rowY.set(r, acc);
|
|
264
|
+
acc += (rowHeight.get(r) ?? 0) + ROW_GAP;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const centerX = /* @__PURE__ */ new Map();
|
|
268
|
+
for (let r = 0; r <= maxRow; r++) {
|
|
269
|
+
let acc = 0;
|
|
270
|
+
for (const id of rowPersons.get(r) ?? []) {
|
|
271
|
+
const w = sizes.get(id).width;
|
|
272
|
+
centerX.set(id, acc + w / 2);
|
|
273
|
+
acc += w + H_GAP;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const resolveRow = (ids, desired) => {
|
|
277
|
+
let prevRight = -Infinity;
|
|
278
|
+
for (const id of ids) {
|
|
279
|
+
const half = sizes.get(id).width / 2;
|
|
280
|
+
let c = desired.get(id) ?? centerX.get(id);
|
|
281
|
+
const minC = prevRight + H_GAP + half;
|
|
282
|
+
if (c < minC) c = minC;
|
|
283
|
+
centerX.set(id, c);
|
|
284
|
+
prevRight = c + half;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
const childrenBlockCenter = (uid) => {
|
|
288
|
+
const cs = (unionChildren.get(uid) ?? []).filter((c) => centerX.has(c)).map((c) => centerX.get(c));
|
|
289
|
+
if (cs.length === 0) return void 0;
|
|
290
|
+
return (Math.min(...cs) + Math.max(...cs)) / 2;
|
|
291
|
+
};
|
|
292
|
+
const rowOfPerson = /* @__PURE__ */ new Map();
|
|
293
|
+
for (let r = 0; r <= maxRow; r++)
|
|
294
|
+
for (const id of rowPersons.get(r) ?? []) rowOfPerson.set(id, r);
|
|
295
|
+
for (let iter = 0; iter < 4; iter++) {
|
|
296
|
+
for (let r = maxRow - 1; r >= 0; r--) {
|
|
297
|
+
const desiredParts = /* @__PURE__ */ new Map();
|
|
298
|
+
const add = (id, x) => {
|
|
299
|
+
(desiredParts.get(id) ?? desiredParts.set(id, []).get(id)).push(x);
|
|
300
|
+
};
|
|
301
|
+
for (const u of unions) {
|
|
302
|
+
const onRow = u.parents.filter((p) => rowOfPerson.get(p) === r);
|
|
303
|
+
if (onRow.length === 0) continue;
|
|
304
|
+
const cc = childrenBlockCenter(u.id);
|
|
305
|
+
if (cc === void 0) continue;
|
|
306
|
+
if (onRow.length === 2) {
|
|
307
|
+
const lr = [...onRow].sort(
|
|
308
|
+
(a, b) => centerX.get(a) - centerX.get(b)
|
|
309
|
+
);
|
|
310
|
+
const [l, rr] = lr;
|
|
311
|
+
const d = sizes.get(l).width / 2 + H_GAP + sizes.get(rr).width / 2;
|
|
312
|
+
add(l, cc - d / 2);
|
|
313
|
+
add(rr, cc + d / 2);
|
|
314
|
+
} else {
|
|
315
|
+
for (const p of onRow) add(p, cc);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const desired = /* @__PURE__ */ new Map();
|
|
319
|
+
for (const [id, xs] of desiredParts)
|
|
320
|
+
desired.set(id, xs.reduce((a, b) => a + b, 0) / xs.length);
|
|
321
|
+
resolveRow(rowPersons.get(r) ?? [], desired);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const unionMid = (u) => {
|
|
325
|
+
const ps = u.parents.filter((p) => centerX.has(p));
|
|
326
|
+
return ps.reduce((s, p) => s + centerX.get(p), 0) / ps.length;
|
|
327
|
+
};
|
|
328
|
+
for (let pass = 0; pass < 2; pass++) {
|
|
329
|
+
for (let r = 1; r <= maxRow; r++) {
|
|
330
|
+
const desired = /* @__PURE__ */ new Map();
|
|
331
|
+
for (const u of unions) {
|
|
332
|
+
const kids = u.children.map((c) => c.personId).filter((id) => rowOfPerson.get(id) === r && centerX.has(id)).sort((a, b) => centerX.get(a) - centerX.get(b));
|
|
333
|
+
if (kids.length === 0 || u.parents.every((p) => !centerX.has(p)))
|
|
334
|
+
continue;
|
|
335
|
+
const blockW = kids.reduce((s, id) => s + sizes.get(id).width, 0) + H_GAP * (kids.length - 1);
|
|
336
|
+
let left = unionMid(u) - blockW / 2;
|
|
337
|
+
for (const id of kids) {
|
|
338
|
+
const w = sizes.get(id).width;
|
|
339
|
+
desired.set(id, left + w / 2);
|
|
340
|
+
left += w + H_GAP;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
resolveRow(rowPersons.get(r) ?? [], desired);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
let minLeft = Infinity;
|
|
347
|
+
for (const id of persons.keys())
|
|
348
|
+
minLeft = Math.min(minLeft, centerX.get(id) - sizes.get(id).width / 2);
|
|
349
|
+
const gutter = showGen ? GUTTER_WIDTH : 0;
|
|
350
|
+
const dx = (Number.isFinite(minLeft) ? MARGIN - minLeft : MARGIN) + gutter;
|
|
351
|
+
const nodes = [];
|
|
352
|
+
const topY = /* @__PURE__ */ new Map();
|
|
353
|
+
const bottomY = /* @__PURE__ */ new Map();
|
|
354
|
+
for (let r = 0; r <= maxRow; r++) {
|
|
355
|
+
for (const id of rowPersons.get(r) ?? []) {
|
|
356
|
+
const p = persons.get(id);
|
|
357
|
+
const s = sizes.get(id);
|
|
358
|
+
const x = centerX.get(id) - s.width / 2 + dx;
|
|
359
|
+
const y = rowY.get(r);
|
|
360
|
+
centerX.set(id, x + s.width / 2);
|
|
361
|
+
topY.set(id, y);
|
|
362
|
+
bottomY.set(id, y + s.height);
|
|
363
|
+
nodes.push({
|
|
364
|
+
id: p.id,
|
|
365
|
+
label: p.label,
|
|
366
|
+
sex: p.sex,
|
|
367
|
+
metadata: p.metadata,
|
|
368
|
+
...p.color !== void 0 && { color: p.color },
|
|
369
|
+
tagMetadata: p.tagMetadata,
|
|
370
|
+
x,
|
|
371
|
+
y,
|
|
372
|
+
width: s.width,
|
|
373
|
+
height: s.height,
|
|
374
|
+
row: r,
|
|
375
|
+
...p.placeholder && { placeholder: true },
|
|
376
|
+
...litSet && !litSet.has(id) && { dimmed: true },
|
|
377
|
+
lineNumber: p.lineNumber
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
let contentRightEdge = 0;
|
|
382
|
+
for (const n of nodes)
|
|
383
|
+
contentRightEdge = Math.max(contentRightEdge, n.x + n.width);
|
|
384
|
+
const bars = [];
|
|
385
|
+
for (const u of unions) {
|
|
386
|
+
if (u.parents.length !== 2) continue;
|
|
387
|
+
const [a, b] = u.parents;
|
|
388
|
+
if (!centerX.has(a) || !centerX.has(b)) continue;
|
|
389
|
+
const rowTop = Math.min(topY.get(a), topY.get(b));
|
|
390
|
+
const ay = rowTop + HEADER_HEIGHT / 2;
|
|
391
|
+
const ax = centerX.get(a);
|
|
392
|
+
const bx = centerX.get(b);
|
|
393
|
+
const x1 = Math.min(ax, bx);
|
|
394
|
+
const x2 = Math.max(ax, bx);
|
|
395
|
+
const leftId = ax <= bx ? a : b;
|
|
396
|
+
const rightId = ax <= bx ? b : a;
|
|
397
|
+
const gapCenter = (centerX.get(leftId) + sizes.get(leftId).width / 2 + (centerX.get(rightId) - sizes.get(rightId).width / 2)) / 2;
|
|
398
|
+
bars.push({
|
|
399
|
+
unionId: u.id,
|
|
400
|
+
x1,
|
|
401
|
+
x2,
|
|
402
|
+
y: ay,
|
|
403
|
+
midX: (x1 + x2) / 2,
|
|
404
|
+
labelX: gapCenter,
|
|
405
|
+
...u.metadata["m"] !== void 0 && { year: u.metadata["m"] },
|
|
406
|
+
...u.divorced && { divorced: true },
|
|
407
|
+
...litSet && !(litSet.has(a) && litSet.has(b)) && { dimmed: true },
|
|
408
|
+
lineNumber: u.lineNumber
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
const barByUnion = new Map(bars.map((bar) => [bar.unionId, bar]));
|
|
412
|
+
const edges = [];
|
|
413
|
+
for (const u of unions) {
|
|
414
|
+
if (u.children.length === 0) continue;
|
|
415
|
+
let anchorX;
|
|
416
|
+
let anchorY;
|
|
417
|
+
const bar = barByUnion.get(u.id);
|
|
418
|
+
if (bar) {
|
|
419
|
+
anchorX = bar.midX;
|
|
420
|
+
anchorY = bar.y;
|
|
421
|
+
} else {
|
|
422
|
+
const p = u.parents[0];
|
|
423
|
+
if (p === void 0 || !centerX.has(p)) continue;
|
|
424
|
+
anchorX = centerX.get(p);
|
|
425
|
+
anchorY = bottomY.get(p);
|
|
426
|
+
}
|
|
427
|
+
const kids = u.children.filter((c) => centerX.has(c.personId));
|
|
428
|
+
if (kids.length === 0) continue;
|
|
429
|
+
const childTop = Math.min(...kids.map((c) => topY.get(c.personId)));
|
|
430
|
+
const parentsBottom = Math.max(
|
|
431
|
+
...u.parents.filter((p) => bottomY.has(p)).map((p) => bottomY.get(p))
|
|
432
|
+
);
|
|
433
|
+
const midY = (parentsBottom + childTop) / 2;
|
|
434
|
+
for (const c of kids) {
|
|
435
|
+
const cx = centerX.get(c.personId);
|
|
436
|
+
const cTop = topY.get(c.personId);
|
|
437
|
+
edges.push({
|
|
438
|
+
unionId: u.id,
|
|
439
|
+
childId: c.personId,
|
|
440
|
+
points: [
|
|
441
|
+
{ x: anchorX, y: anchorY },
|
|
442
|
+
{ x: anchorX, y: midY },
|
|
443
|
+
{ x: cx, y: midY },
|
|
444
|
+
{ x: cx, y: cTop }
|
|
445
|
+
],
|
|
446
|
+
adopted: c.adopted,
|
|
447
|
+
...litSet && !litSet.has(c.personId) && { dimmed: true }
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const ancestors = [];
|
|
452
|
+
let focusAnchor;
|
|
453
|
+
if (focusId && focusParents.length > 0 && centerX.has(focusId)) {
|
|
454
|
+
const fx = centerX.get(focusId);
|
|
455
|
+
const fTop = topY.get(focusId);
|
|
456
|
+
focusAnchor = { x: fx, y: fTop };
|
|
457
|
+
focusParents.forEach((p, i) => {
|
|
458
|
+
ancestors.push({
|
|
459
|
+
id: p.id,
|
|
460
|
+
label: p.label,
|
|
461
|
+
sex: p.sex,
|
|
462
|
+
...p.color !== void 0 && { color: p.color },
|
|
463
|
+
x: fx,
|
|
464
|
+
y: MARGIN + 10 + i * ANCESTOR_STAGGER
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
const width = contentRightEdge + MARGIN;
|
|
469
|
+
const lastR = maxRow;
|
|
470
|
+
const height = (rowY.get(lastR) ?? MARGIN) + (rowHeight.get(lastR) ?? 0) + MARGIN;
|
|
471
|
+
const rows = [];
|
|
472
|
+
for (let r = 0; r <= maxRow; r++) {
|
|
473
|
+
if (!rowPersons.get(r)?.length) continue;
|
|
474
|
+
rows.push({ row: r, y: rowY.get(r), height: rowHeight.get(r) ?? 0 });
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
nodes,
|
|
478
|
+
bars,
|
|
479
|
+
edges,
|
|
480
|
+
ancestors,
|
|
481
|
+
...focusAnchor !== void 0 && { focusAnchor },
|
|
482
|
+
rows,
|
|
483
|
+
width,
|
|
484
|
+
height
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export {
|
|
489
|
+
focusFamily,
|
|
490
|
+
layoutFamily
|
|
491
|
+
};
|
|
492
|
+
//# sourceMappingURL=chunk-IAEC4KLA.js.map
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
LEGEND_PILL_FONT_SIZE,
|
|
12
12
|
LEGEND_PILL_PAD,
|
|
13
13
|
measureLegendText
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HQCHYB5F.js";
|
|
15
15
|
import {
|
|
16
16
|
measureText
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5LWQH6QV.js";
|
|
18
18
|
import {
|
|
19
19
|
injectDefaultTagMetadata,
|
|
20
20
|
resolveTagColor,
|
|
21
21
|
tagAttrKey
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-HBVD67XG.js";
|
|
23
23
|
|
|
24
24
|
// src/org/layout.ts
|
|
25
25
|
import { hierarchy, tree } from "d3-hierarchy";
|
|
@@ -810,4 +810,4 @@ function layoutOrg(parsed, hiddenCounts, activeTagGroup, hiddenAttributes, expan
|
|
|
810
810
|
export {
|
|
811
811
|
layoutOrg
|
|
812
812
|
};
|
|
813
|
-
//# sourceMappingURL=chunk-
|
|
813
|
+
//# sourceMappingURL=chunk-IBC35BTK.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
parseFirstLine,
|
|
6
6
|
splitNameAndMeta,
|
|
7
7
|
warnUnknownMetaKeys
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZNQX6QWH.js";
|
|
9
9
|
import {
|
|
10
10
|
makeDgmoError,
|
|
11
11
|
makeFail,
|
|
@@ -332,4 +332,4 @@ function assignGlobalNumbers(result) {
|
|
|
332
332
|
export {
|
|
333
333
|
parseTechRadar
|
|
334
334
|
};
|
|
335
|
-
//# sourceMappingURL=chunk-
|
|
335
|
+
//# sourceMappingURL=chunk-IFK3GIUW.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
renderCollapseBar,
|
|
7
7
|
renderNodeCard
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AHGF2YYA.js";
|
|
9
9
|
import {
|
|
10
10
|
CARD_RADIUS,
|
|
11
11
|
COLLAPSE_BAR_HEIGHT,
|
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
} from "./chunk-3CIOJ5YJ.js";
|
|
26
26
|
import {
|
|
27
27
|
layoutOrg
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import {
|
|
30
|
-
renderIntegratedLegend
|
|
31
|
-
} from "./chunk-PWIHZ6NJ.js";
|
|
28
|
+
} from "./chunk-IBC35BTK.js";
|
|
32
29
|
import {
|
|
33
30
|
ScaleContext
|
|
34
31
|
} from "./chunk-YYVTBZZC.js";
|
|
32
|
+
import {
|
|
33
|
+
renderIntegratedLegend
|
|
34
|
+
} from "./chunk-4UDKKGHH.js";
|
|
35
35
|
import {
|
|
36
36
|
getMaxLegendReservedHeight
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7UEMZREK.js";
|
|
38
38
|
import {
|
|
39
39
|
TITLE_FONT_SIZE,
|
|
40
40
|
TITLE_FONT_WEIGHT
|
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
LEGEND_EYE_SIZE,
|
|
50
50
|
LEGEND_GROUP_GAP,
|
|
51
51
|
LEGEND_HEIGHT
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-HQCHYB5F.js";
|
|
53
53
|
import {
|
|
54
54
|
measureText
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-5LWQH6QV.js";
|
|
56
56
|
import {
|
|
57
57
|
parseOrg
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-F743CM2N.js";
|
|
59
59
|
import {
|
|
60
60
|
contrastText,
|
|
61
61
|
mix,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
resolveTagColor,
|
|
67
67
|
tagAttrKey
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-HBVD67XG.js";
|
|
69
69
|
|
|
70
70
|
// src/org/renderer.ts
|
|
71
71
|
import * as d3Selection from "d3-selection";
|
|
@@ -484,4 +484,4 @@ export {
|
|
|
484
484
|
renderOrg,
|
|
485
485
|
renderOrgForExport
|
|
486
486
|
};
|
|
487
|
-
//# sourceMappingURL=chunk-
|
|
487
|
+
//# sourceMappingURL=chunk-IHLSHCPZ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
splitNameAndMeta,
|
|
4
4
|
warnUnknownMetaKeys,
|
|
5
5
|
withTagAliases
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZNQX6QWH.js";
|
|
7
7
|
import {
|
|
8
8
|
makeDgmoError
|
|
9
9
|
} from "./chunk-CXK4DZH3.js";
|
|
@@ -336,4 +336,4 @@ export {
|
|
|
336
336
|
parseTimelineDate,
|
|
337
337
|
parseTimelineEventLine
|
|
338
338
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-IUK7AGD4.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/family/card-model.ts
|
|
2
|
+
var LABELED_KEYS = [
|
|
3
|
+
["bp", "Born"],
|
|
4
|
+
["dp", "Died"],
|
|
5
|
+
["occupation", "Occupation"],
|
|
6
|
+
["military", "Military"],
|
|
7
|
+
["education", "Education"],
|
|
8
|
+
["religion", "Religion"],
|
|
9
|
+
["burial", "Burial"]
|
|
10
|
+
];
|
|
11
|
+
function familyDisplayLabel(p) {
|
|
12
|
+
return !p.placeholder && p.metadata["d"] ? `\u2020 ${p.label}` : p.label;
|
|
13
|
+
}
|
|
14
|
+
function familyCardRows(p) {
|
|
15
|
+
const rows = [];
|
|
16
|
+
const b = p.metadata["b"];
|
|
17
|
+
const d = p.metadata["d"];
|
|
18
|
+
if (b && d) rows.push({ key: "", value: `${b} \u2013 ${d}`, year: true });
|
|
19
|
+
else if (b) rows.push({ key: "", value: `b. ${b}`, year: true });
|
|
20
|
+
else if (d) rows.push({ key: "", value: `d. ${d}`, year: true });
|
|
21
|
+
for (const [key, label] of LABELED_KEYS) {
|
|
22
|
+
const v = p.metadata[key];
|
|
23
|
+
if (v) rows.push({ key: label, value: v, year: false });
|
|
24
|
+
}
|
|
25
|
+
return rows;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
familyDisplayLabel,
|
|
30
|
+
familyCardRows
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-IVKC4GID.js.map
|