@weasel-js/diagram 1.15.2 → 1.16.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/dist/{chunk-QGL6QJE4.js → chunk-3MAKSWI2.js} +146 -149
- package/dist/chunk-3MAKSWI2.js.map +1 -0
- package/dist/{chunk-LPTNAYER.js → chunk-4TQIAU5P.js} +3 -3
- package/dist/{chunk-LPTNAYER.js.map → chunk-4TQIAU5P.js.map} +1 -1
- package/dist/{chunk-7BV2MBED.js → chunk-6EPWNUHC.js} +4 -4
- package/dist/chunk-6EPWNUHC.js.map +1 -0
- package/dist/{chunk-6YQSQXQT.js → chunk-6EZFP3SG.js} +27 -22
- package/dist/chunk-6EZFP3SG.js.map +1 -0
- package/dist/{chunk-FQVZWS24.js → chunk-6S5QNNPB.js} +3 -3
- package/dist/{chunk-FQVZWS24.js.map → chunk-6S5QNNPB.js.map} +1 -1
- package/dist/{dataTypes-1ch6cMtq.d.ts → dataTypes-knb9fWOe.d.ts} +24 -20
- package/dist/effect-audio.js +3 -3
- package/dist/effect.d.ts +2 -2
- package/dist/effect.js +6 -6
- package/dist/effect.js.map +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +2 -2
- package/dist/{layout.entry-zstuljAl.d.ts → layout.entry-CXtCbLRi.d.ts} +1 -1
- package/dist/layout.js +2 -2
- package/dist/{types-D5ybp8Xh.d.ts → types-DtWfIUIv.d.ts} +1 -1
- package/package.json +12 -12
- package/dist/chunk-6YQSQXQT.js.map +0 -1
- package/dist/chunk-7BV2MBED.js.map +0 -1
- package/dist/chunk-QGL6QJE4.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { grownBy, labelCenter, diagramEdgeOf, DIAGRAM_TRAIT_KEY, insetOf, subpathOf, portsOf, portSitesOf, routeHolds, rowHeights, sizeToBody, measureBody, layoutBody, layoutOwnsRoute, diagramNodeOf, expandGroupEdges, layoutWritesRoute, layoutOwnsPort, grid, radial, chain, force, tree, layered, planOf, DEFAULT_GROUP_INSET, bodyTrait, authoredOver, buildBody } from './chunk-
|
|
1
|
+
import { grownBy, labelCenter, diagramEdgeOf, DIAGRAM_TRAIT_KEY, insetOf, subpathOf, portsOf, portSitesOf, routeHolds, rowHeights, sizeToBody, measureBody, layoutBody, layoutOwnsRoute, diagramNodeOf, expandGroupEdges, layoutWritesRoute, layoutOwnsPort, grid, radial, chain, force, tree, layered, planOf, DEFAULT_GROUP_INSET, bodyTrait, authoredOver, buildBody } from './chunk-6EPWNUHC.js';
|
|
2
2
|
import { bodyPredicate, AUTO_POSE_DESCRIPTOR, translatePoseViaDescriptor, createTransformOp, polylineFromPoints, PathBuilder, documentDepOf, documentPose, composeAffordanceLayer, ActionDisabledReason, pageName, pageOfBounds, layoutPages, scenePoseAdapter, composeWorldPose, rebaseLocalPose, carriedDescendants, sceneCarrySource, RECT_POSE_DESCRIPTOR, resolveFill, resolveStroke, commandFill, commandStroke, transformPath, registerNodeShape, RIGID_POSE_COMPOSITION, localizeWorldPoses, pathFromD } from '@weasel-js/core';
|
|
3
3
|
import { createSettledCache, createBvh } from '@weasel-js/geom/nd';
|
|
4
4
|
import { worldCoords, PathBuilder as PathBuilder$1, polylineFromPoints as polylineFromPoints$1, portCurvePoints, PORT_REACH } from '@weasel-js/geom';
|
|
@@ -496,6 +496,14 @@ function editEdgeLabelBinding(actionId = EDIT_EDGE_LABEL_ACTION_ID) {
|
|
|
496
496
|
return { spec: { kind: "doubleClick", target: { kindOf: onBody } }, actionId, opts: { id: `${actionId}.doubleClick` } };
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
// src/dataTypes.ts
|
|
500
|
+
var DEFAULT_POOL_ACROSS = 600;
|
|
501
|
+
var DEFAULT_LANE_SIZE = 120;
|
|
502
|
+
var DEFAULT_NODE_STYLE = { fill: "#16222c", stroke: "#7ba7c7", text: "#dbe7f2" };
|
|
503
|
+
var NODE_STROKE_WIDTH = 2;
|
|
504
|
+
var LANE_STROKE_WIDTH = 1;
|
|
505
|
+
var EDGE_STROKE_WIDTH = 1.5;
|
|
506
|
+
|
|
499
507
|
// src/theme/themes.ts
|
|
500
508
|
var SANS = { family: "sans-serif", size: 12 };
|
|
501
509
|
var INK = "#1f2933";
|
|
@@ -647,6 +655,20 @@ var DIAGRAM_ROLES = [
|
|
|
647
655
|
];
|
|
648
656
|
var DIAGRAM_THEME_KEY = "diagram:theme";
|
|
649
657
|
|
|
658
|
+
// src/edgeStroke.ts
|
|
659
|
+
function edgeStrokeOf(style) {
|
|
660
|
+
const markerStart = style.markerStart ?? null;
|
|
661
|
+
const markerEnd = style.markerEnd === void 0 ? "arrow" : style.markerEnd;
|
|
662
|
+
return {
|
|
663
|
+
paint: { color: style.stroke },
|
|
664
|
+
width: style.width ?? EDGE_STROKE_WIDTH,
|
|
665
|
+
...style.dash ? { dash: style.dash } : {},
|
|
666
|
+
...style.trim !== void 0 ? { trim: style.trim } : {},
|
|
667
|
+
...markerStart !== null ? { markerStart } : {},
|
|
668
|
+
...markerEnd !== null ? { markerEnd } : {}
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
650
672
|
// src/theme/resolve.ts
|
|
651
673
|
function roleStyle(theme, role) {
|
|
652
674
|
return (role !== void 0 ? theme.roles[role] : void 0) ?? theme.roles[theme.defaultRole];
|
|
@@ -656,16 +678,7 @@ function roleEdgeStyle(theme, role) {
|
|
|
656
678
|
if (own !== void 0) return { ...theme.edge, stroke: own.stroke, label: own.stroke };
|
|
657
679
|
return { ...theme.edge, label: theme.edge.label ?? theme.label.fill };
|
|
658
680
|
}
|
|
659
|
-
|
|
660
|
-
const { stroke, width, dash, markerStart, markerEnd } = theme.edge;
|
|
661
|
-
return {
|
|
662
|
-
paint: { color: stroke },
|
|
663
|
-
width: width ?? 2,
|
|
664
|
-
...dash ? { dash } : {},
|
|
665
|
-
...markerStart ? { markerStart } : {},
|
|
666
|
-
...markerEnd !== null ? { markerEnd: markerEnd ?? "arrow" } : {}
|
|
667
|
-
};
|
|
668
|
-
}
|
|
681
|
+
var themeEdgeStroke = (theme) => edgeStrokeOf(theme.edge);
|
|
669
682
|
var themeFont = (theme) => ({ fontFamily: theme.font.family, fontSize: theme.font.size });
|
|
670
683
|
var themeLabelFamily = (theme) => theme.label.font?.family ?? theme.font.family;
|
|
671
684
|
var themeLabelFont = (theme, font = themeFont(theme)) => theme.label.font ? { fontFamily: theme.label.font.family, fontSize: theme.label.font.size } : font;
|
|
@@ -1019,6 +1032,45 @@ function withDiagramRegistry(registry = {}) {
|
|
|
1019
1032
|
};
|
|
1020
1033
|
}
|
|
1021
1034
|
|
|
1035
|
+
// src/dataColors.ts
|
|
1036
|
+
var NODE_FIELDS = ["fill", "stroke", "text"];
|
|
1037
|
+
function ownNodeStyle(colors) {
|
|
1038
|
+
const own = NODE_FIELDS.filter((f) => colors?.[f] !== void 0);
|
|
1039
|
+
return own.length > 0 ? { ownStyle: own } : {};
|
|
1040
|
+
}
|
|
1041
|
+
function ownEdgeStyle(colors) {
|
|
1042
|
+
const own = [];
|
|
1043
|
+
if (colors?.stroke !== void 0) own.push("stroke");
|
|
1044
|
+
if (colors?.label !== void 0) own.push("text");
|
|
1045
|
+
return own.length > 0 ? { ownStyle: own } : {};
|
|
1046
|
+
}
|
|
1047
|
+
function withColors(style, colors) {
|
|
1048
|
+
if (colors === void 0) return style;
|
|
1049
|
+
const out = { ...style };
|
|
1050
|
+
for (const [k, v] of Object.entries(colors)) if (v !== void 0) out[k] = v;
|
|
1051
|
+
return out;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
// src/dataStyles.ts
|
|
1055
|
+
var DEFAULT_EDGE_STYLE = { stroke: "#7ba7c7" };
|
|
1056
|
+
function dataNodeStyle(node, theme) {
|
|
1057
|
+
return withColors(theme ? roleStyle(theme, node.style) : DEFAULT_NODE_STYLE, node.colors);
|
|
1058
|
+
}
|
|
1059
|
+
function dataEdgeStyle(edge, theme) {
|
|
1060
|
+
return withColors(theme ? roleEdgeStyle(theme, edge.style) : DEFAULT_EDGE_STYLE, edge.colors);
|
|
1061
|
+
}
|
|
1062
|
+
function dataRegionStyle(region, theme, laneIndex = 0) {
|
|
1063
|
+
return withColors(themeRegionStyle(region, theme, laneIndex), region.colors);
|
|
1064
|
+
}
|
|
1065
|
+
function themeRegionStyle(r, theme, laneIndex) {
|
|
1066
|
+
if (theme === void 0) return DEFAULT_NODE_STYLE;
|
|
1067
|
+
const own = r.style !== void 0 ? theme.roles[r.style] : void 0;
|
|
1068
|
+
if (own !== void 0) return own;
|
|
1069
|
+
if (r.role === "pool") return theme.lane.header;
|
|
1070
|
+
if (r.role === "lane") return theme.lane.bodies[laneIndex % Math.max(1, theme.lane.bodies.length)] ?? theme.container;
|
|
1071
|
+
return theme.container;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1022
1074
|
// src/bodyRelayout.ts
|
|
1023
1075
|
function bodyLayoutOf(spec, trait, measure) {
|
|
1024
1076
|
if (trait.margin !== void 0 || !spec.rows.every((r) => r.kind === "label" || r.kind === "field" || r.kind === "divider")) return {};
|
|
@@ -1090,13 +1142,17 @@ function relayoutBodies(scene, ids, measure) {
|
|
|
1090
1142
|
}
|
|
1091
1143
|
}
|
|
1092
1144
|
|
|
1093
|
-
// src/
|
|
1094
|
-
var
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1145
|
+
// src/rowStyle.ts
|
|
1146
|
+
var textFace = (s, font) => ({
|
|
1147
|
+
fontFamily: s?.fontFamily ?? font.fontFamily,
|
|
1148
|
+
fontSize: s?.fontSize ?? font.fontSize,
|
|
1149
|
+
...s?.bold === true ? { fontWeight: 700 } : {},
|
|
1150
|
+
...s?.italic === true ? { fontStyle: "italic" } : {}
|
|
1151
|
+
});
|
|
1152
|
+
function rowTextStyle(row, font) {
|
|
1153
|
+
const face = textFace(row?.kind === "label" || row?.kind === "field" ? row.style : void 0, font);
|
|
1154
|
+
return row?.kind === "label" ? { ...face, align: "center" } : face;
|
|
1155
|
+
}
|
|
1100
1156
|
|
|
1101
1157
|
// src/containers/regionSpecs.ts
|
|
1102
1158
|
var NEW_POOL_LANES = 2;
|
|
@@ -1160,114 +1216,6 @@ function firstLanes(poolId, axis, at, opts, titles = Array.from({ length: NEW_PO
|
|
|
1160
1216
|
return out;
|
|
1161
1217
|
}
|
|
1162
1218
|
|
|
1163
|
-
// src/dataColors.ts
|
|
1164
|
-
var NODE_FIELDS = ["fill", "stroke", "text"];
|
|
1165
|
-
function ownNodeStyle(colors) {
|
|
1166
|
-
const own = NODE_FIELDS.filter((f) => colors?.[f] !== void 0);
|
|
1167
|
-
return own.length > 0 ? { ownStyle: own } : {};
|
|
1168
|
-
}
|
|
1169
|
-
function ownEdgeStyle(colors) {
|
|
1170
|
-
const own = [];
|
|
1171
|
-
if (colors?.stroke !== void 0) own.push("stroke");
|
|
1172
|
-
if (colors?.label !== void 0) own.push("text");
|
|
1173
|
-
return own.length > 0 ? { ownStyle: own } : {};
|
|
1174
|
-
}
|
|
1175
|
-
function withColors(style, colors) {
|
|
1176
|
-
if (colors === void 0) return style;
|
|
1177
|
-
const out = { ...style };
|
|
1178
|
-
for (const [k, v] of Object.entries(colors)) if (v !== void 0) out[k] = v;
|
|
1179
|
-
return out;
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
// src/dataStyles.ts
|
|
1183
|
-
var DEFAULT_EDGE_STYLE = { stroke: "#7ba7c7" };
|
|
1184
|
-
function dataNodeStyle(node, theme) {
|
|
1185
|
-
return withColors(theme ? roleStyle(theme, node.style) : DEFAULT_NODE_STYLE, node.colors);
|
|
1186
|
-
}
|
|
1187
|
-
function dataEdgeStyle(edge, theme) {
|
|
1188
|
-
return withColors(theme ? roleEdgeStyle(theme, edge.style) : DEFAULT_EDGE_STYLE, edge.colors);
|
|
1189
|
-
}
|
|
1190
|
-
function dataRegionStyle(region, theme, laneIndex = 0) {
|
|
1191
|
-
return withColors(themeRegionStyle(region, theme, laneIndex), region.colors);
|
|
1192
|
-
}
|
|
1193
|
-
function themeRegionStyle(r, theme, laneIndex) {
|
|
1194
|
-
if (theme === void 0) return DEFAULT_NODE_STYLE;
|
|
1195
|
-
const own = r.style !== void 0 ? theme.roles[r.style] : void 0;
|
|
1196
|
-
if (own !== void 0) return own;
|
|
1197
|
-
if (r.role === "pool") return theme.lane.header;
|
|
1198
|
-
if (r.role === "lane") return theme.lane.bodies[laneIndex % Math.max(1, theme.lane.bodies.length)] ?? theme.container;
|
|
1199
|
-
return theme.container;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
// src/edgeId.ts
|
|
1203
|
-
var idPart = (s) => s.replace(/[\\.>:/]/g, "\\$&");
|
|
1204
|
-
var edgeIdOf = (e) => {
|
|
1205
|
-
if (e.id !== void 0) return e.id;
|
|
1206
|
-
const part = (mark, p) => p === void 0 ? "" : `${mark}${idPart(p)}`;
|
|
1207
|
-
return `edge:${idPart(e.from)}${part(".", e.fromPort)}->${idPart(e.to)}${part(".", e.toPort)}${part(":", e.label)}`;
|
|
1208
|
-
};
|
|
1209
|
-
function refAt(n) {
|
|
1210
|
-
let out = "";
|
|
1211
|
-
for (let k = n + 1; k > 0; k = Math.floor((k - 1) / 26)) out = String.fromCharCode(65 + (k - 1) % 26) + out;
|
|
1212
|
-
return out;
|
|
1213
|
-
}
|
|
1214
|
-
function nextOffPageRef(used) {
|
|
1215
|
-
let n = 0;
|
|
1216
|
-
while (used.has(refAt(n))) n++;
|
|
1217
|
-
return refAt(n);
|
|
1218
|
-
}
|
|
1219
|
-
function offPageSplits(input) {
|
|
1220
|
-
const used = new Set(input.used ?? []);
|
|
1221
|
-
const out = /* @__PURE__ */ new Map();
|
|
1222
|
-
const fresh = [];
|
|
1223
|
-
for (const edge of input.edges) {
|
|
1224
|
-
const from = pageOfBounds(input.pages, edge.from);
|
|
1225
|
-
const to = pageOfBounds(input.pages, edge.to);
|
|
1226
|
-
if (from === null || to === null || from.id === to.id) {
|
|
1227
|
-
out.set(edge.id, null);
|
|
1228
|
-
continue;
|
|
1229
|
-
}
|
|
1230
|
-
const held = edge.offPage?.ref;
|
|
1231
|
-
if (held !== void 0 && !used.has(held)) {
|
|
1232
|
-
used.add(held);
|
|
1233
|
-
out.set(edge.id, { ref: held, from: from.id, to: to.id });
|
|
1234
|
-
} else {
|
|
1235
|
-
out.set(edge.id, null);
|
|
1236
|
-
fresh.push({ id: edge.id, from: from.id, to: to.id });
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
for (const split of fresh) {
|
|
1240
|
-
const ref = nextOffPageRef(used);
|
|
1241
|
-
used.add(ref);
|
|
1242
|
-
out.set(split.id, { ref, from: split.from, to: split.to });
|
|
1243
|
-
}
|
|
1244
|
-
return out;
|
|
1245
|
-
}
|
|
1246
|
-
function diagramPages(data) {
|
|
1247
|
-
return layoutPages(data.pages ?? [], data.pageLayout);
|
|
1248
|
-
}
|
|
1249
|
-
function dataOffPage(edges, pages, boxOf, look) {
|
|
1250
|
-
const input = edges.flatMap((e) => {
|
|
1251
|
-
const from = boxOf(e.from);
|
|
1252
|
-
const to = boxOf(e.to);
|
|
1253
|
-
return from === void 0 || to === void 0 ? [] : [{ id: e.id, from, to }];
|
|
1254
|
-
});
|
|
1255
|
-
const splits = /* @__PURE__ */ new Map();
|
|
1256
|
-
const tags = [];
|
|
1257
|
-
for (const [id, split] of offPageSplits({ pages, edges: input })) {
|
|
1258
|
-
if (split === null) continue;
|
|
1259
|
-
splits.set(id, split);
|
|
1260
|
-
tags.push(...offPageTagSpecs(id, split, pages, { ...look, layer: "main" }));
|
|
1261
|
-
}
|
|
1262
|
-
return { splits, tags };
|
|
1263
|
-
}
|
|
1264
|
-
function scenePageSplits(data, placedAt, specs, edges, look) {
|
|
1265
|
-
const pages = diagramPages(data);
|
|
1266
|
-
if (pages.length === 0) return null;
|
|
1267
|
-
const groups = new Map(specs.filter((s) => diagramGroupOf(s) !== null).map((s) => [String(s.id), s.pose]));
|
|
1268
|
-
return dataOffPage(edges, pages, (id) => placedAt.get(id) ?? groups.get(id), look());
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
1219
|
// src/groupTree.ts
|
|
1272
1220
|
function nestGroups(declared, isNode) {
|
|
1273
1221
|
const groupIds = new Set(declared.map((g) => g.id));
|
|
@@ -1426,18 +1374,75 @@ function push(index, key, edge) {
|
|
|
1426
1374
|
if (list === void 0) index.set(key, [edge]);
|
|
1427
1375
|
else list.push(edge);
|
|
1428
1376
|
}
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
fontSize: s?.fontSize ?? font.fontSize,
|
|
1434
|
-
...s?.bold === true ? { fontWeight: 700 } : {},
|
|
1435
|
-
...s?.italic === true ? { fontStyle: "italic" } : {}
|
|
1436
|
-
});
|
|
1437
|
-
function rowTextStyle(row, font) {
|
|
1438
|
-
const face = textFace(row?.kind === "label" || row?.kind === "field" ? row.style : void 0, font);
|
|
1439
|
-
return row?.kind === "label" ? { ...face, align: "center" } : face;
|
|
1377
|
+
function refAt(n) {
|
|
1378
|
+
let out = "";
|
|
1379
|
+
for (let k = n + 1; k > 0; k = Math.floor((k - 1) / 26)) out = String.fromCharCode(65 + (k - 1) % 26) + out;
|
|
1380
|
+
return out;
|
|
1440
1381
|
}
|
|
1382
|
+
function nextOffPageRef(used) {
|
|
1383
|
+
let n = 0;
|
|
1384
|
+
while (used.has(refAt(n))) n++;
|
|
1385
|
+
return refAt(n);
|
|
1386
|
+
}
|
|
1387
|
+
function offPageSplits(input) {
|
|
1388
|
+
const used = new Set(input.used ?? []);
|
|
1389
|
+
const out = /* @__PURE__ */ new Map();
|
|
1390
|
+
const fresh = [];
|
|
1391
|
+
for (const edge of input.edges) {
|
|
1392
|
+
const from = pageOfBounds(input.pages, edge.from);
|
|
1393
|
+
const to = pageOfBounds(input.pages, edge.to);
|
|
1394
|
+
if (from === null || to === null || from.id === to.id) {
|
|
1395
|
+
out.set(edge.id, null);
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
const held = edge.offPage?.ref;
|
|
1399
|
+
if (held !== void 0 && !used.has(held)) {
|
|
1400
|
+
used.add(held);
|
|
1401
|
+
out.set(edge.id, { ref: held, from: from.id, to: to.id });
|
|
1402
|
+
} else {
|
|
1403
|
+
out.set(edge.id, null);
|
|
1404
|
+
fresh.push({ id: edge.id, from: from.id, to: to.id });
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
for (const split of fresh) {
|
|
1408
|
+
const ref = nextOffPageRef(used);
|
|
1409
|
+
used.add(ref);
|
|
1410
|
+
out.set(split.id, { ref, from: split.from, to: split.to });
|
|
1411
|
+
}
|
|
1412
|
+
return out;
|
|
1413
|
+
}
|
|
1414
|
+
function diagramPages(data) {
|
|
1415
|
+
return layoutPages(data.pages ?? [], data.pageLayout);
|
|
1416
|
+
}
|
|
1417
|
+
function dataOffPage(edges, pages, boxOf, look) {
|
|
1418
|
+
const input = edges.flatMap((e) => {
|
|
1419
|
+
const from = boxOf(e.from);
|
|
1420
|
+
const to = boxOf(e.to);
|
|
1421
|
+
return from === void 0 || to === void 0 ? [] : [{ id: e.id, from, to }];
|
|
1422
|
+
});
|
|
1423
|
+
const splits = /* @__PURE__ */ new Map();
|
|
1424
|
+
const tags = [];
|
|
1425
|
+
for (const [id, split] of offPageSplits({ pages, edges: input })) {
|
|
1426
|
+
if (split === null) continue;
|
|
1427
|
+
splits.set(id, split);
|
|
1428
|
+
tags.push(...offPageTagSpecs(id, split, pages, { ...look, layer: "main" }));
|
|
1429
|
+
}
|
|
1430
|
+
return { splits, tags };
|
|
1431
|
+
}
|
|
1432
|
+
function scenePageSplits(data, placedAt, specs, edges, look) {
|
|
1433
|
+
const pages = diagramPages(data);
|
|
1434
|
+
if (pages.length === 0) return null;
|
|
1435
|
+
const groups = new Map(specs.filter((s) => diagramGroupOf(s) !== null).map((s) => [String(s.id), s.pose]));
|
|
1436
|
+
return dataOffPage(edges, pages, (id) => placedAt.get(id) ?? groups.get(id), look());
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
// src/edgeId.ts
|
|
1440
|
+
var idPart = (s) => s.replace(/[\\.>:/]/g, "\\$&");
|
|
1441
|
+
var edgeIdOf = (e) => {
|
|
1442
|
+
if (e.id !== void 0) return e.id;
|
|
1443
|
+
const part = (mark, p) => p === void 0 ? "" : `${mark}${idPart(p)}`;
|
|
1444
|
+
return `edge:${idPart(e.from)}${part(".", e.fromPort)}->${idPart(e.to)}${part(".", e.toPort)}${part(":", e.label)}`;
|
|
1445
|
+
};
|
|
1441
1446
|
|
|
1442
1447
|
// src/routeWrites.ts
|
|
1443
1448
|
var ROUTE_TOLERANCE = 1e-3;
|
|
@@ -2086,8 +2091,6 @@ function edgeSpecs(edges, ctx) {
|
|
|
2086
2091
|
const laidOut = e.waypoints === void 0 && waypoints !== void 0;
|
|
2087
2092
|
const own = ctx.opts.edgeStyle?.(e);
|
|
2088
2093
|
const style = own !== void 0 ? withColors(own, e.colors) : dataEdgeStyle(e, ctx.theme);
|
|
2089
|
-
const markerStart = style.markerStart ?? null;
|
|
2090
|
-
const markerEnd = style.markerEnd === void 0 ? "arrow" : style.markerEnd;
|
|
2091
2094
|
const split = ctx.splits?.get(id);
|
|
2092
2095
|
specs.push({
|
|
2093
2096
|
id,
|
|
@@ -2106,13 +2109,7 @@ function edgeSpecs(edges, ctx) {
|
|
|
2106
2109
|
...ownEdgeStyle(e.colors),
|
|
2107
2110
|
...split !== void 0 ? { offPage: split } : {}
|
|
2108
2111
|
},
|
|
2109
|
-
stroke:
|
|
2110
|
-
paint: { color: style.stroke },
|
|
2111
|
-
width: style.width ?? EDGE_STROKE_WIDTH,
|
|
2112
|
-
...style.dash ? { dash: style.dash } : {},
|
|
2113
|
-
...markerStart !== null ? { markerStart } : {},
|
|
2114
|
-
...markerEnd !== null ? { markerEnd } : {}
|
|
2115
|
-
}
|
|
2112
|
+
stroke: edgeStrokeOf(style)
|
|
2116
2113
|
},
|
|
2117
2114
|
dependsOn: [e.from, e.to],
|
|
2118
2115
|
derivePath: EDGE_DERIVE_PATH
|
|
@@ -2321,6 +2318,6 @@ function layOut(seeds, edges, groups, boxes, opts, room) {
|
|
|
2321
2318
|
return { placed, plan: layout?.plan === void 0 ? null : plan, remapped };
|
|
2322
2319
|
}
|
|
2323
2320
|
|
|
2324
|
-
export { ANCHOR_DERIVE_POSE, CONTAINER_HEADER, CONTAINER_LAYOUTS, DEFAULT_EDGE_STYLE, DEFAULT_FONT, DEFAULT_GROUP_STYLE, DEFAULT_LANE_SIZE, DEFAULT_NODE_STYLE, DEFAULT_POOL_ACROSS, DIAGRAM_ANCHOR, DIAGRAM_CONTAINER_LAYOUT, DIAGRAM_EDGE, DIAGRAM_GROUP, DIAGRAM_LABEL, DIAGRAM_LANE_COLUMNS_LAYOUT, DIAGRAM_LANE_ROWS_LAYOUT, DIAGRAM_OFF_PAGE_TAG, DIAGRAM_POOL_COLUMNS_LAYOUT, DIAGRAM_POOL_ROWS_LAYOUT, DIAGRAM_ROLES, DIAGRAM_THEMES, DIAGRAM_THEME_KEY, EDGE_DERIVE_PATH, EDGE_STROKE_WIDTH, EDIT_EDGE_LABEL_ACTION_ID, END_LABEL_PLACEMENT, GLYPH, GROUP_DERIVE_POSE, LABEL_DERIVE_POSE, LABEL_DRAG_AFFORDANCE_KIND, LABEL_DRAG_LAYER_ID, LABEL_PLACEMENT, LANE_HEADER_SIZE, LANE_STROKE_WIDTH, LAYOUTS, LAYOUT_ACTION_ID, MIN_LANE_SIZE, NODE_STROKE_WIDTH, OFF_PAGE_STUB, OFF_PAGE_TAG_DERIVE_POSE, OFF_PAGE_TAG_PADDING, POOL_HEADER_SIZE, ROUTERS, anchorDerivePose, applyLayout, avoid, bezier, bodyBox, bodyLayoutOf, boxAround, boxCenter, boxIndex, boxesMeeting, buildGraph, containerShape, createLayoutAction, dataEdgeStyle, dataNodeStyle, dataOffPage, dataRegionStyle, diagramAnchorOf, diagramContainerLayout, diagramContainerOf, diagramGroupOf, diagramLabelOf, diagramMarkOf, diagramPages, diagramScene, diagramThemeFrom, diagramThemeOf, draggableLabels, dropEmptyEdgeLabel, edgeDerivePath, edgeIdOf, edgeLabelSpec, edgeRouter, editEdgeLabelAction, editEdgeLabelBinding, editableLabels, endAims, endLabelIdOf, firstLanes, groupDerivePose, groupLabelIdOf, groupMinWidth, headerBox, keyedIndex, labelDerivePose, labelDragLayer, labelScratchOf, labelSize, labelStyleOf, labelUnder, laneHeader, laneOutlineOf, laneStackLayout, layoutDiagram, layoutPoses, markShape, nestGroups, nextOffPageRef, offPageFarText, offPageSplits, offPageTagData, offPageTagDerivePose, offPageTagId, offPageTagLook, offPageTagOf, offPageTagSize, offPageTagSpec, offPageTagSpecs, offPageTagText, orthogonal, poolHeader, recordedRows, regionSpecs, registerMarkShape, relayoutBodies, resolveEnd, roleEdgeStyle, roleStyle, routeWrites, routerOf, routesOf, rowTextStyle, selfLoop, stackedLanes, straight, themeDocValue, themeEdgeStroke, themeFont, themeLabelFamily, themeLabelFont, themeLabelStyle, titleIdOf, titleInFrame, titlePose, withColors, withDiagramRegistry, withHops };
|
|
2325
|
-
//# sourceMappingURL=chunk-
|
|
2326
|
-
//# sourceMappingURL=chunk-
|
|
2321
|
+
export { ANCHOR_DERIVE_POSE, CONTAINER_HEADER, CONTAINER_LAYOUTS, DEFAULT_EDGE_STYLE, DEFAULT_FONT, DEFAULT_GROUP_STYLE, DEFAULT_LANE_SIZE, DEFAULT_NODE_STYLE, DEFAULT_POOL_ACROSS, DIAGRAM_ANCHOR, DIAGRAM_CONTAINER_LAYOUT, DIAGRAM_EDGE, DIAGRAM_GROUP, DIAGRAM_LABEL, DIAGRAM_LANE_COLUMNS_LAYOUT, DIAGRAM_LANE_ROWS_LAYOUT, DIAGRAM_OFF_PAGE_TAG, DIAGRAM_POOL_COLUMNS_LAYOUT, DIAGRAM_POOL_ROWS_LAYOUT, DIAGRAM_ROLES, DIAGRAM_THEMES, DIAGRAM_THEME_KEY, EDGE_DERIVE_PATH, EDGE_STROKE_WIDTH, EDIT_EDGE_LABEL_ACTION_ID, END_LABEL_PLACEMENT, GLYPH, GROUP_DERIVE_POSE, LABEL_DERIVE_POSE, LABEL_DRAG_AFFORDANCE_KIND, LABEL_DRAG_LAYER_ID, LABEL_PLACEMENT, LANE_HEADER_SIZE, LANE_STROKE_WIDTH, LAYOUTS, LAYOUT_ACTION_ID, MIN_LANE_SIZE, NODE_STROKE_WIDTH, OFF_PAGE_STUB, OFF_PAGE_TAG_DERIVE_POSE, OFF_PAGE_TAG_PADDING, POOL_HEADER_SIZE, ROUTERS, anchorDerivePose, applyLayout, avoid, bezier, bodyBox, bodyLayoutOf, boxAround, boxCenter, boxIndex, boxesMeeting, buildGraph, containerShape, createLayoutAction, dataEdgeStyle, dataNodeStyle, dataOffPage, dataRegionStyle, diagramAnchorOf, diagramContainerLayout, diagramContainerOf, diagramGroupOf, diagramLabelOf, diagramMarkOf, diagramPages, diagramScene, diagramThemeFrom, diagramThemeOf, draggableLabels, dropEmptyEdgeLabel, edgeDerivePath, edgeIdOf, edgeLabelSpec, edgeRouter, edgeStrokeOf, editEdgeLabelAction, editEdgeLabelBinding, editableLabels, endAims, endLabelIdOf, firstLanes, groupDerivePose, groupLabelIdOf, groupMinWidth, headerBox, keyedIndex, labelDerivePose, labelDragLayer, labelScratchOf, labelSize, labelStyleOf, labelUnder, laneHeader, laneOutlineOf, laneStackLayout, layoutDiagram, layoutPoses, markShape, nestGroups, nextOffPageRef, offPageFarText, offPageSplits, offPageTagData, offPageTagDerivePose, offPageTagId, offPageTagLook, offPageTagOf, offPageTagSize, offPageTagSpec, offPageTagSpecs, offPageTagText, orthogonal, poolHeader, recordedRows, regionSpecs, registerMarkShape, relayoutBodies, resolveEnd, roleEdgeStyle, roleStyle, routeWrites, routerOf, routesOf, rowTextStyle, selfLoop, stackedLanes, straight, themeDocValue, themeEdgeStroke, themeFont, themeLabelFamily, themeLabelFont, themeLabelStyle, titleIdOf, titleInFrame, titlePose, withColors, withDiagramRegistry, withHops };
|
|
2322
|
+
//# sourceMappingURL=chunk-3MAKSWI2.js.map
|
|
2323
|
+
//# sourceMappingURL=chunk-3MAKSWI2.js.map
|