@diagrammo/dgmo 0.90.0 → 0.91.1
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/dist/advanced.d.ts +156 -2
- package/dist/advanced.js +558 -115
- package/dist/block.d.ts +10 -1
- package/dist/block.js +46 -39
- package/dist/{calculator-PX3JHKAS.js → calculator-3LZUWOBK.js} +1 -1
- package/dist/chart-meta.js +12 -12
- package/dist/{charts-d3-QW4ERNUE.js → charts-d3-KSA5UKVJ.js} +3 -3
- package/dist/{chunk-64KSPLU2.js → chunk-273GB7WK.js} +4 -4
- package/dist/{chunk-EEYQFJVK.js → chunk-27KA4VV6.js} +65 -15
- package/dist/{chunk-GYBKG4Z6.js → chunk-2A4OFZ2Z.js} +2 -2
- package/dist/{chunk-YWRZG6GN.js → chunk-2AM6VA3A.js} +8 -8
- package/dist/{chunk-PQ5NW3QZ.js → chunk-2UV627GG.js} +4 -4
- package/dist/{chunk-AAC3XQWV.js → chunk-37QQXKFV.js} +8 -9
- package/dist/{chunk-5TZPIKNV.js → chunk-3SLRZKLB.js} +2 -2
- package/dist/{chunk-X3WYJ5T7.js → chunk-3YTAOMMN.js} +1 -1
- package/dist/{chunk-A5EE66RQ.js → chunk-53BJIOLF.js} +1 -1
- package/dist/{chunk-QRIW46LR.js → chunk-57L2JPP2.js} +6 -2
- package/dist/{chunk-IIOLFAGJ.js → chunk-5DIBB2QG.js} +51 -32
- package/dist/{chunk-7Z2VFRP5.js → chunk-5U6DXIMV.js} +47 -24
- package/dist/{chunk-5M6PMV5Z.js → chunk-5VPWIC6T.js} +3 -3
- package/dist/{chunk-SLO22FPS.js → chunk-634LDSN6.js} +1 -1
- package/dist/{chunk-G5BGW4BX.js → chunk-6NO3MNBC.js} +3 -3
- package/dist/{chunk-NUYWNKHH.js → chunk-6QEXWMBP.js} +12 -16
- package/dist/{chunk-POBNN5DP.js → chunk-7BBRSOKS.js} +2 -2
- package/dist/{chunk-NFWRIC2V.js → chunk-AR4QVMWG.js} +4 -1
- package/dist/{chunk-JRQ4LBQI.js → chunk-B6EUFLRP.js} +4 -4
- package/dist/{chunk-LNQDICFJ.js → chunk-CPGKRI7H.js} +5 -8
- package/dist/{chunk-ZNNVI5SR.js → chunk-CU2PZLZP.js} +53 -31
- package/dist/{chunk-LBRHDWEA.js → chunk-CVZBLHHW.js} +1 -1
- package/dist/{chunk-S4LLHDGK.js → chunk-CXIPV2FY.js} +3 -3
- package/dist/{chunk-ICYPGWOV.js → chunk-D7DXNQW5.js} +2 -2
- package/dist/{chunk-54YUDXGP.js → chunk-D7PP35BA.js} +1 -1
- package/dist/{chunk-RRBV4HIM.js → chunk-DLX7MEN4.js} +1 -1
- package/dist/{chunk-S7C32S2T.js → chunk-EDPDAUBL.js} +2 -2
- package/dist/{chunk-LC5LY5V2.js → chunk-EP7BT3HU.js} +1 -1
- package/dist/{chunk-ICZ7M6IZ.js → chunk-EQJ3U5EW.js} +1 -1
- package/dist/{chunk-K4GUO7FV.js → chunk-F2436VRR.js} +1 -1
- package/dist/{chunk-5M52RPAS.js → chunk-F26ZPBSF.js} +2 -2
- package/dist/{chunk-3BQCSQQJ.js → chunk-FJCYK4K3.js} +11 -11
- package/dist/{chunk-PXEUQ7EG.js → chunk-G22UV5AF.js} +4 -4
- package/dist/{chunk-CUY56BK4.js → chunk-G3EUQMV4.js} +3 -3
- package/dist/{chunk-I6FWHICD.js → chunk-GCDW3WAY.js} +5 -5
- package/dist/{chunk-WHRIN7N3.js → chunk-HFG7KQOY.js} +12 -14
- package/dist/{chunk-SVQDLYX7.js → chunk-HLVGZXM5.js} +1 -1
- package/dist/{chunk-3HBR3YAN.js → chunk-HSGWR2FL.js} +6 -6
- package/dist/{chunk-RNXX2GOQ.js → chunk-HWXUQCDY.js} +2 -2
- package/dist/{chunk-YE7D2S75.js → chunk-HYV6GSXM.js} +5 -2
- package/dist/{chunk-AHWA36O7.js → chunk-II4XJETG.js} +1 -1
- package/dist/{chunk-EB7AEM2H.js → chunk-IMKPFW67.js} +3 -3
- package/dist/{chunk-C4W62JZO.js → chunk-IS6WFBX7.js} +2 -2
- package/dist/{chunk-SMEVBJJJ.js → chunk-IUBCDNT2.js} +1 -1
- package/dist/{chunk-TQ644YGV.js → chunk-IWTUXGHN.js} +3 -3
- package/dist/{chunk-PNCKZFPE.js → chunk-J2SQNZ6D.js} +1 -1
- package/dist/{chunk-YKGUSW6D.js → chunk-JA2S7PHR.js} +7 -7
- package/dist/{chunk-IRVQT4GR.js → chunk-JJQWCI35.js} +2 -2
- package/dist/chunk-JJUDOR4I.js +110 -0
- package/dist/{chunk-VCHYS3RD.js → chunk-K3BYD3WU.js} +1 -1
- package/dist/{chunk-RCBHL2B5.js → chunk-KA5CSR44.js} +112 -112
- package/dist/{chunk-Y6GQQ4Y2.js → chunk-LKR4FACF.js} +1 -3
- package/dist/{chunk-IJ27L3R4.js → chunk-MA42PIGJ.js} +1 -1
- package/dist/{chunk-GQVXYRPC.js → chunk-MI6SJJQU.js} +1 -1
- package/dist/{chunk-DXPT2HPH.js → chunk-MJKQ5ZYY.js} +2 -2
- package/dist/{chunk-J3ODKAWN.js → chunk-MNL547RV.js} +5 -5
- package/dist/{chunk-2EDJPHXQ.js → chunk-N254IJM2.js} +6 -6
- package/dist/{layout-search-YKUL4VBV.js → chunk-NWPMLX2V.js} +27 -30
- package/dist/{chunk-COPSI54O.js → chunk-PSGSFRRE.js} +2 -2
- package/dist/{chunk-FDRHBQUG.js → chunk-PUZ63XZM.js} +8 -8
- package/dist/{chunk-MIVSVEK4.js → chunk-PZVTFQI2.js} +2 -2
- package/dist/{chunk-W7QN5BC5.js → chunk-Q3N7PI3B.js} +180 -7
- package/dist/{chunk-HX2KJEPD.js → chunk-QKJ6MQXW.js} +1 -3
- package/dist/{chunk-NJYA4QSN.js → chunk-QVKTAU7P.js} +1 -1
- package/dist/{chunk-EK7JYFCL.js → chunk-R7BSF7Z7.js} +1 -1
- package/dist/{chunk-PIHAUVA4.js → chunk-RHXIUUWB.js} +1 -1
- package/dist/{chunk-GXP344YZ.js → chunk-RMTOZALT.js} +6 -3
- package/dist/{chunk-CYF2X3CG.js → chunk-ROCBGUJN.js} +7 -7
- package/dist/{chunk-RY5RRKYN.js → chunk-RVTYIGWZ.js} +3 -3
- package/dist/{chunk-NMKLX57Y.js → chunk-SKF7XLCM.js} +1 -1
- package/dist/{chunk-NP2SE6MQ.js → chunk-SMTWQ66K.js} +5 -5
- package/dist/{chunk-3AX6MCI6.js → chunk-SPQVER4T.js} +2 -2
- package/dist/{chunk-A5PUOHIS.js → chunk-SWBHH2UW.js} +1 -1
- package/dist/{chunk-7TF3QOOD.js → chunk-TIVMAITN.js} +14 -0
- package/dist/{chunk-4IYJOXGS.js → chunk-TLPY4ZBI.js} +604 -430
- package/dist/{chunk-U762HK4D.js → chunk-TPEYEOXA.js} +4 -4
- package/dist/{chunk-FS2LZBHG.js → chunk-UWJP4JSZ.js} +2 -2
- package/dist/{chunk-JX4RCC6B.js → chunk-V3KHZQPK.js} +2 -2
- package/dist/{chunk-RJYFHEP4.js → chunk-VGSSAMLA.js} +2 -2
- package/dist/{chunk-HIVJBESO.js → chunk-VMD2CYVP.js} +35 -36
- package/dist/{chunk-OSIUWQ3N.js → chunk-WNTPJZU7.js} +1 -1
- package/dist/{chunk-R2PTZ6QM.js → chunk-WTE27AJT.js} +7 -7
- package/dist/{chunk-OWJVSJLA.js → chunk-XLAREWBK.js} +2 -2
- package/dist/{chunk-NY56FM55.js → chunk-XLPJJ35N.js} +2 -2
- package/dist/{chunk-DNMICILX.js → chunk-XQTRGKQ3.js} +3 -3
- package/dist/{chunk-QOZ4RVQY.js → chunk-YZG37S7L.js} +3 -3
- package/dist/{chunk-62VWZ3SE.js → chunk-ZB2Q67NO.js} +10 -10
- package/dist/completion-registry.js +2 -2
- package/dist/{compute-JAP5E2E4.js → compute-2XWFVO7K.js} +1 -1
- package/dist/{dgmo-router-BJBXSZMV.js → dgmo-router-YHBMKTXY.js} +32 -32
- package/dist/{dimensions-AMA2S7RO.js → dimensions-QMGWJQTR.js} +3 -3
- package/dist/{flowchart-parser-ADZIFVCH.js → flowchart-parser-BLJ6RA53.js} +2 -2
- package/dist/{flowchart-renderer-CAG6ZNJ6.js → flowchart-renderer-FXRQKXAK.js} +10 -6
- package/dist/index.js +37 -37
- package/dist/{layout-5VSMZPMG.js → layout-5HCEF7VO.js} +1 -1
- package/dist/{layout-VQ2USZJ3.js → layout-6PLSBB5X.js} +2 -2
- package/dist/{layout-UIV56NUA.js → layout-B7PQRAMB.js} +1 -1
- package/dist/{layout-C6MKMOBI.js → layout-CCVCLZ6S.js} +1 -1
- package/dist/{layout-T2PGKQUQ.js → layout-CRUAP7JG.js} +2 -2
- package/dist/{layout-UFB2O4AO.js → layout-G42FDCF3.js} +2 -2
- package/dist/{layout-6OSF2UGP.js → layout-IV4H2FLB.js} +2 -2
- package/dist/{layout-4RRC7XU7.js → layout-JTNRSGOS.js} +6 -3
- package/dist/{layout-H4K54IW3.js → layout-RBLD5EGX.js} +6 -3
- package/dist/{layout-SW3XWYKC.js → layout-ROAVGBUC.js} +1 -1
- package/dist/{layout-QS2SESBU.js → layout-T2DQ4M77.js} +6 -2
- package/dist/{layout-ZP7XYVXF.js → layout-YKGQRFDM.js} +2 -4
- package/dist/layout-search-L75YOBME.js +42 -0
- package/dist/{parser-NAUUUCI3.js → parser-2XCDVLSN.js} +2 -2
- package/dist/{parser-ESZ5J5IJ.js → parser-4QNRCGU5.js} +2 -2
- package/dist/{parser-W2DWCCLO.js → parser-6NSQLPTS.js} +2 -2
- package/dist/{parser-223VOHSB.js → parser-6X4GGH2R.js} +2 -2
- package/dist/{parser-B2FWP7ZO.js → parser-D6YRVV75.js} +2 -2
- package/dist/{parser-T2RVIRDG.js → parser-EY3VJWBE.js} +2 -2
- package/dist/{parser-KFIK3EOO.js → parser-EYF4ZSZO.js} +2 -2
- package/dist/{parser-2PNV7UI3.js → parser-H2DJEAPG.js} +2 -2
- package/dist/{parser-OV2WDSEV.js → parser-ILWAA3QJ.js} +2 -2
- package/dist/{parser-FV6RGALQ.js → parser-KMFMNZYI.js} +2 -2
- package/dist/{parser-LGUT7KKH.js → parser-MDSVVCJP.js} +2 -2
- package/dist/{parser-HPR7G7F6.js → parser-QL4DEPVA.js} +3 -3
- package/dist/{parser-BJDQX4KV.js → parser-UEDPLM46.js} +2 -2
- package/dist/{parser-E5HFYL7B.js → parser-UL6WN6W5.js} +2 -2
- package/dist/{parser-5ZD2NKGU.js → parser-ULSUK36C.js} +2 -2
- package/dist/{parser-57YQEEMC.js → parser-UY3K4ROB.js} +1 -1
- package/dist/{parser-MYRGCK7Q.js → parser-UYQNNQKT.js} +2 -2
- package/dist/{parser-NJ5VEZA3.js → parser-VG747VR6.js} +2 -2
- package/dist/{parser-CA5WC5HF.js → parser-VK4PNDX4.js} +2 -2
- package/dist/{parser-JFNDS5E5.js → parser-X5FQ36KJ.js} +2 -2
- package/dist/{parser-I4HZVIHX.js → parser-XO5IAXMT.js} +2 -2
- package/dist/{parser-WFY4ZJUW.js → parser-YVHO2NRM.js} +2 -2
- package/dist/{parser-J3BM2AP2.js → parser-YWZGIU3C.js} +2 -2
- package/dist/{parser-4B2PIXHI.js → parser-ZFLSULFC.js} +2 -2
- package/dist/{parser-RARXAHC7.js → parser-ZR7JAKSW.js} +1 -1
- package/dist/{renderer-3QM2DK7I.js → renderer-43IVPARP.js} +3 -3
- package/dist/{renderer-GWH5ACJ5.js → renderer-4MEZYGU6.js} +2 -2
- package/dist/{renderer-A3PMPUO6.js → renderer-54GXA3UO.js} +5 -5
- package/dist/{renderer-W22GX72R.js → renderer-7EAWN7MC.js} +4 -4
- package/dist/{renderer-IO3D5E4E.js → renderer-7SEXPBGM.js} +3 -3
- package/dist/{renderer-B3CPMS5R.js → renderer-B7B7BQM3.js} +7 -7
- package/dist/{renderer-IG72UJHW.js → renderer-I2LYSQBV.js} +3 -3
- package/dist/{renderer-OPDSKCQS.js → renderer-J2LOMTBC.js} +3 -3
- package/dist/{renderer-TTKTBB4C.js → renderer-JUH6M3XF.js} +6 -6
- package/dist/{renderer-COSJM7UG.js → renderer-KY6O5JTX.js} +33 -33
- package/dist/{renderer-PLRMST57.js → renderer-LHTDI5RV.js} +4 -4
- package/dist/{renderer-3W5T3IU6.js → renderer-LWL3IJOF.js} +3 -3
- package/dist/{renderer-SBXCPA3S.js → renderer-NCIDGJ2R.js} +5 -5
- package/dist/{renderer-AM4VZSBQ.js → renderer-OPA4JJKX.js} +4 -4
- package/dist/{renderer-O5RQHGK2.js → renderer-QMNC7TGN.js} +4 -4
- package/dist/{renderer-UVFGW2O6.js → renderer-QQNPJGAP.js} +3 -3
- package/dist/{renderer-WQ654YT5.js → renderer-R7RK7FKI.js} +1 -1
- package/dist/{renderer-TMQNTUQS.js → renderer-RFP55AW7.js} +10 -7
- package/dist/{renderer-FXCVH2M5.js → renderer-S3NFBJCY.js} +10 -7
- package/dist/{renderer-OA5D3ZKB.js → renderer-SD4ZHHAR.js} +6 -4
- package/dist/{renderer-PSMRAL72.js → renderer-SE7Z5AOL.js} +3 -3
- package/dist/{renderer-ON4PTUHJ.js → renderer-T2WUA7MC.js} +5 -5
- package/dist/{renderer-KK5BU5K2.js → renderer-TWKEZ3DD.js} +3 -3
- package/dist/{renderer-MK47ESCB.js → renderer-U5PD72G7.js} +3 -3
- package/dist/{renderer-52CHSV6S.js → renderer-VCTKBUTR.js} +5 -5
- package/dist/{renderer-PXGCR7N4.js → renderer-VNZTWATB.js} +3 -3
- package/dist/{renderer-4Z7FRQ2A.js → renderer-YDNWK6RI.js} +1 -1
- package/dist/{renderer-B4KE3NM4.js → renderer-YDOWBIUB.js} +4 -4
- package/dist/{renderer-LD2H7WGP.js → renderer-YQPZ7O2C.js} +1 -1
- package/dist/{renderer-6OOJNEQE.js → renderer-ZQ77CM6Y.js} +4 -4
- package/dist/{renderer-radial-42LVSG74.js → renderer-radial-TNNEL3YN.js} +4 -4
- package/dist/{resolver-XSXE2TRX.js → resolver-6DJLZF6Y.js} +1 -1
- package/dist/{state-parser-ROKY5KSI.js → state-parser-NIIVOU2Y.js} +2 -2
- package/dist/{state-renderer-MMG23G4W.js → state-renderer-TVLEG32M.js} +11 -7
- package/package.json +2 -2
- package/dist/chunk-6EK55ART.js +0 -116
- package/dist/chunk-HTNLLT34.js +0 -72
- /package/dist/{chunk-3FCSOYN4.js → chunk-5P2L5QXE.js} +0 -0
- /package/dist/{chunk-HJRP6PXL.js → chunk-BQVTV4LB.js} +0 -0
- /package/dist/{chunk-LYRDIVSY.js → chunk-GLCMUTO5.js} +0 -0
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-26EVL454.js";
|
|
5
5
|
import {
|
|
6
6
|
layoutGraph
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CU2PZLZP.js";
|
|
8
|
+
import {
|
|
9
|
+
appendArrowheadMarkers
|
|
10
|
+
} from "./chunk-XBJJP2HN.js";
|
|
8
11
|
import {
|
|
9
12
|
NOTE_BADGE_RADIUS,
|
|
10
13
|
noteConnectorPoints,
|
|
@@ -12,9 +15,6 @@ import {
|
|
|
12
15
|
renderNoteBox,
|
|
13
16
|
renderNoteConnector
|
|
14
17
|
} from "./chunk-KATED53P.js";
|
|
15
|
-
import {
|
|
16
|
-
appendArrowheadMarkers
|
|
17
|
-
} from "./chunk-XBJJP2HN.js";
|
|
18
18
|
import {
|
|
19
19
|
fitDiagramToCanvas
|
|
20
20
|
} from "./chunk-EPDBWATV.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-24YPR5EH.js";
|
|
24
24
|
import {
|
|
25
25
|
renderIntegratedLegend
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QVKTAU7P.js";
|
|
27
27
|
import {
|
|
28
28
|
ARROWHEAD_HEIGHT,
|
|
29
29
|
ARROWHEAD_WIDTH,
|
|
@@ -51,13 +51,13 @@ import {
|
|
|
51
51
|
} from "./chunk-ICLB27PZ.js";
|
|
52
52
|
import {
|
|
53
53
|
parseState
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-XLPJJ35N.js";
|
|
55
55
|
import {
|
|
56
56
|
resolveActiveTagGroup,
|
|
57
57
|
resolveGroupTagColor,
|
|
58
58
|
resolveTagColor,
|
|
59
59
|
tagAttrKey
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-QKJ6MQXW.js";
|
|
61
61
|
import {
|
|
62
62
|
fillModeFromOptions,
|
|
63
63
|
legendInlineRequested,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
stripDefaultModifier,
|
|
10
10
|
tagAttrKey,
|
|
11
11
|
validateTagGroupNames
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QKJ6MQXW.js";
|
|
13
13
|
import {
|
|
14
14
|
AliasRegistry,
|
|
15
15
|
KANBAN_REGISTRY,
|
|
@@ -353,7 +353,7 @@ function parseKanban(content, palette) {
|
|
|
353
353
|
validateTagGroupNames(result.tagGroups, warn, (line, msg) => {
|
|
354
354
|
const diag = makeDgmoError(line, msg);
|
|
355
355
|
result.diagnostics.push(diag);
|
|
356
|
-
|
|
356
|
+
result.error ??= formatDgmoError(diag);
|
|
357
357
|
});
|
|
358
358
|
const activeTagWarning = activeTagNoMatchMessage(
|
|
359
359
|
options["active-tag"],
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
countEdgeNodePierces,
|
|
3
|
+
countEdgeOverlaps,
|
|
4
|
+
countSplineCrossings,
|
|
5
|
+
deroutePierces,
|
|
6
|
+
searchBudget
|
|
7
|
+
} from "./chunk-NWPMLX2V.js";
|
|
8
|
+
|
|
9
|
+
// src/utils/placement-search.ts
|
|
10
|
+
var SEARCH_RANKERS = ["tight-tree", "longest-path"];
|
|
11
|
+
var SEARCH_SEEDS = 6;
|
|
12
|
+
function seeded(s) {
|
|
13
|
+
return () => {
|
|
14
|
+
s = s + 1831565813 | 0;
|
|
15
|
+
let t = Math.imul(s ^ s >>> 15, 1 | s);
|
|
16
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
17
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function shuffler(seed) {
|
|
21
|
+
const r = seeded(seed + 1);
|
|
22
|
+
return (a) => {
|
|
23
|
+
const out = a.slice();
|
|
24
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
25
|
+
const j = Math.floor(r() * (i + 1));
|
|
26
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function searchPlacement(direction, place, score) {
|
|
32
|
+
const asScored = (g) => {
|
|
33
|
+
const s = score(g);
|
|
34
|
+
return {
|
|
35
|
+
nodes: s.nodes.map((n) => ({ ...n, label: n.id })),
|
|
36
|
+
edges: s.edges,
|
|
37
|
+
groups: [],
|
|
38
|
+
width: 0,
|
|
39
|
+
height: 0
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const rest = (lay) => countEdgeOverlaps(lay) + countEdgeNodePierces(lay);
|
|
43
|
+
const along = direction === "LR" ? "x" : "y";
|
|
44
|
+
const backward = (lay) => {
|
|
45
|
+
const at = new Map(lay.nodes.map((n) => [n.label, n[along]]));
|
|
46
|
+
const out = /* @__PURE__ */ new Set();
|
|
47
|
+
lay.edges.forEach((e, i) => {
|
|
48
|
+
if (e.source === e.target) return;
|
|
49
|
+
if (at.get(e.target) < at.get(e.source) - 1) out.add(i);
|
|
50
|
+
});
|
|
51
|
+
return out;
|
|
52
|
+
};
|
|
53
|
+
let best = place("network-simplex");
|
|
54
|
+
let bestLay = asScored(best);
|
|
55
|
+
const plainX = countSplineCrossings(bestLay);
|
|
56
|
+
let bestBad = plainX + rest(bestLay);
|
|
57
|
+
if (bestBad === 0) return { g: best };
|
|
58
|
+
const plainBack = backward(bestLay);
|
|
59
|
+
const budget = searchBudget(bestLay.nodes.length, bestLay.edges.length);
|
|
60
|
+
const configs = [
|
|
61
|
+
...SEARCH_RANKERS.map((ranker) => ({ ranker })),
|
|
62
|
+
...Array.from(
|
|
63
|
+
{ length: Math.min(budget.seeds, SEARCH_SEEDS) },
|
|
64
|
+
(_, seed) => ({
|
|
65
|
+
ranker: "network-simplex",
|
|
66
|
+
seed
|
|
67
|
+
})
|
|
68
|
+
)
|
|
69
|
+
];
|
|
70
|
+
let attempts = 1;
|
|
71
|
+
for (const cfg of configs) {
|
|
72
|
+
if (bestBad === 0 || attempts >= budget.maxCandidates) break;
|
|
73
|
+
attempts++;
|
|
74
|
+
let g;
|
|
75
|
+
try {
|
|
76
|
+
g = place(
|
|
77
|
+
cfg.ranker,
|
|
78
|
+
cfg.seed === void 0 ? void 0 : shuffler(cfg.seed)
|
|
79
|
+
);
|
|
80
|
+
} catch {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const lay = asScored(g);
|
|
84
|
+
if ([...backward(lay)].some((i) => !plainBack.has(i))) continue;
|
|
85
|
+
const floor = Math.min(plainX, bestBad - 1);
|
|
86
|
+
const x = countSplineCrossings(lay, floor);
|
|
87
|
+
if (x > floor) continue;
|
|
88
|
+
const bad = x + rest(lay);
|
|
89
|
+
if (bad < bestBad) {
|
|
90
|
+
best = g;
|
|
91
|
+
bestLay = lay;
|
|
92
|
+
bestBad = bad;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const bent = deroutePierces(bestLay);
|
|
96
|
+
if (bent !== bestLay) {
|
|
97
|
+
const floor = Math.min(plainX, bestBad - 1);
|
|
98
|
+
const x = countSplineCrossings(bent, floor);
|
|
99
|
+
if (x <= floor && x + rest(bent) < bestBad)
|
|
100
|
+
return {
|
|
101
|
+
g: best,
|
|
102
|
+
edgePoints: bent.edges.map((e) => e.points)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return { g: best };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
searchPlacement
|
|
110
|
+
};
|