@open-livex-wiki/graph-ui 0.2.1 → 0.2.3
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/assets/{index-Ci04LT-F.js → index-D1VSMFf4.js} +3 -3
- package/dist/index.html +1 -1
- package/dist-lib/graph-logic/filters.d.ts +44 -0
- package/dist-lib/graph-logic/filters.d.ts.map +1 -0
- package/dist-lib/graph-logic/filters.js +178 -0
- package/dist-lib/graph-logic/filters.js.map +1 -0
- package/dist-lib/graph-logic/graph-data.d.ts +53 -0
- package/dist-lib/graph-logic/graph-data.d.ts.map +1 -0
- package/dist-lib/graph-logic/graph-data.js +129 -0
- package/dist-lib/graph-logic/graph-data.js.map +1 -0
- package/dist-lib/graph-logic/layout.d.ts +98 -0
- package/dist-lib/graph-logic/layout.d.ts.map +1 -0
- package/dist-lib/graph-logic/layout.js +362 -0
- package/dist-lib/graph-logic/layout.js.map +1 -0
- package/dist-lib/graph-logic.d.ts +3 -190
- package/dist-lib/graph-logic.d.ts.map +1 -1
- package/dist-lib/graph-logic.js +3 -665
- package/dist-lib/graph-logic.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
export const DOMAIN_CARD_PALETTES = [
|
|
2
|
+
{ bg: "#fff7ed", border: "#fdba74", text: "#7c2d12" }, // warm peach (infra / primary)
|
|
3
|
+
{ bg: "#f5f3ff", border: "#c4b5fd", text: "#3b0764" }, // soft lavender
|
|
4
|
+
{ bg: "#ecfeff", border: "#67e8f9", text: "#164e63" }, // crisp cyan/sky
|
|
5
|
+
{ bg: "#fefce8", border: "#fde047", text: "#713f12" }, // warm butter
|
|
6
|
+
{ bg: "#f0fdf4", border: "#86efac", text: "#14532d" }, // sage mint
|
|
7
|
+
{ bg: "#eff6ff", border: "#93c5fd", text: "#1e3a8a" }, // soft blue
|
|
8
|
+
{ bg: "#fdf2f8", border: "#f9a8d4", text: "#831843" }, // soft rose
|
|
9
|
+
{ bg: "#f8fafc", border: "#cbd5e1", text: "#1e293b" }, // cool slate
|
|
10
|
+
];
|
|
11
|
+
function getSceneSubCols(count) {
|
|
12
|
+
if (count <= 0)
|
|
13
|
+
return 0;
|
|
14
|
+
if (count === 1)
|
|
15
|
+
return 1;
|
|
16
|
+
if (count <= 4)
|
|
17
|
+
return 2;
|
|
18
|
+
if (count <= 18)
|
|
19
|
+
return 3;
|
|
20
|
+
return 4;
|
|
21
|
+
}
|
|
22
|
+
function getInfraSubCols(count) {
|
|
23
|
+
if (count <= 0)
|
|
24
|
+
return 0;
|
|
25
|
+
if (count === 1)
|
|
26
|
+
return 1;
|
|
27
|
+
if (count <= 4)
|
|
28
|
+
return 2;
|
|
29
|
+
if (count <= 12)
|
|
30
|
+
return 3;
|
|
31
|
+
if (count <= 24)
|
|
32
|
+
return 4;
|
|
33
|
+
return 5;
|
|
34
|
+
}
|
|
35
|
+
function computeCenteredGridPositions(count, subCols, columnCenterX, startTopY, cardWidth, cardHeight, gapX, gapY) {
|
|
36
|
+
if (count === 0 || subCols === 0) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const coords = [];
|
|
40
|
+
const totalRows = Math.ceil(count / subCols);
|
|
41
|
+
for (let row = 0; row < totalRows; row += 1) {
|
|
42
|
+
const rowStartIdx = row * subCols;
|
|
43
|
+
const itemsInRow = Math.min(subCols, count - rowStartIdx);
|
|
44
|
+
const rowWidth = itemsInRow * cardWidth + (itemsInRow - 1) * gapX;
|
|
45
|
+
const rowLeftX = columnCenterX - rowWidth / 2;
|
|
46
|
+
const centerY = startTopY + cardHeight / 2 + row * (cardHeight + gapY);
|
|
47
|
+
for (let col = 0; col < itemsInRow; col += 1) {
|
|
48
|
+
const centerX = rowLeftX + cardWidth / 2 + col * (cardWidth + gapX);
|
|
49
|
+
coords.push({ x: centerX, y: centerY });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return coords;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Computes deterministic, collision-free coordinates for Mode B (`依赖层次` / Dependency Hierarchy):
|
|
56
|
+
* - Vertical Domain Columns (infrastructure domain columns placed leftmost like `基建域`, followed
|
|
57
|
+
* by business domain columns sorted by size).
|
|
58
|
+
* - 3 Horizontal Swimlane Tiers:
|
|
59
|
+
* - `01 领域` (top band): Domain header rectangular cards centered atop each column.
|
|
60
|
+
* - `02 场景` (middle band): Multi-column sub-grids of scene cards inside owning domain columns.
|
|
61
|
+
* - `03 知识` (bottom band): Multi-column sub-grids of shared knowledge cards at the bottom.
|
|
62
|
+
*/
|
|
63
|
+
export function computeHierarchyLayout(nodes, options = {}) {
|
|
64
|
+
const domainCardWidth = options.domainCardWidth ?? 128;
|
|
65
|
+
const domainCardHeight = options.domainCardHeight ?? 36;
|
|
66
|
+
const sceneCardWidth = options.sceneCardWidth ?? 124;
|
|
67
|
+
const sceneCardHeight = options.sceneCardHeight ?? 32;
|
|
68
|
+
const infraCardWidth = options.infraCardWidth ?? 120;
|
|
69
|
+
const infraCardHeight = options.infraCardHeight ?? 30;
|
|
70
|
+
const cellGapX = options.cellGapX ?? 12;
|
|
71
|
+
const cellGapY = options.cellGapY ?? 12;
|
|
72
|
+
const columnPaddingX = options.columnPaddingX ?? 22;
|
|
73
|
+
const columnGap = options.columnGap ?? 26;
|
|
74
|
+
const routingChannelHeight = options.routingChannelHeight ?? 76;
|
|
75
|
+
const infraDomainHints = new Set(options.infrastructureDomains ?? ["business-infrastructure"]);
|
|
76
|
+
if (nodes.length === 0) {
|
|
77
|
+
return {
|
|
78
|
+
positions: {},
|
|
79
|
+
nodeBoxes: {},
|
|
80
|
+
columns: [],
|
|
81
|
+
tiers: [],
|
|
82
|
+
bounds: { minX: 0, minY: 0, maxX: 0, maxY: 0, width: 0, height: 0 },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const buckets = new Map();
|
|
86
|
+
const ensureBucket = (domainId) => {
|
|
87
|
+
let bucket = buckets.get(domainId);
|
|
88
|
+
if (!bucket) {
|
|
89
|
+
bucket = { domainId, scenes: [], infras: [] };
|
|
90
|
+
buckets.set(domainId, bucket);
|
|
91
|
+
}
|
|
92
|
+
return bucket;
|
|
93
|
+
};
|
|
94
|
+
for (const node of nodes) {
|
|
95
|
+
const bucket = ensureBucket(node.domainId);
|
|
96
|
+
if (node.type === "domain") {
|
|
97
|
+
bucket.domainNode = node;
|
|
98
|
+
}
|
|
99
|
+
else if (node.type === "scene") {
|
|
100
|
+
bucket.scenes.push(node);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
bucket.infras.push(node);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const bucket of buckets.values()) {
|
|
107
|
+
bucket.scenes.sort((a, b) => a.id.localeCompare(b.id));
|
|
108
|
+
bucket.infras.sort((a, b) => a.id.localeCompare(b.id));
|
|
109
|
+
}
|
|
110
|
+
const isInfraBucket = (bucket) => {
|
|
111
|
+
if (infraDomainHints.has(bucket.domainId)) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
if (bucket.infras.length > 0 && bucket.scenes.length === 0) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
return bucket.infras.length > bucket.scenes.length;
|
|
118
|
+
};
|
|
119
|
+
const orderedBuckets = Array.from(buckets.values()).sort((a, b) => {
|
|
120
|
+
const aInfra = isInfraBucket(a);
|
|
121
|
+
const bInfra = isInfraBucket(b);
|
|
122
|
+
if (aInfra !== bInfra) {
|
|
123
|
+
return aInfra ? -1 : 1;
|
|
124
|
+
}
|
|
125
|
+
if (aInfra) {
|
|
126
|
+
const diff = b.infras.length - a.infras.length;
|
|
127
|
+
return diff !== 0 ? diff : a.domainId.localeCompare(b.domainId);
|
|
128
|
+
}
|
|
129
|
+
const aTotal = a.scenes.length + a.infras.length;
|
|
130
|
+
const bTotal = b.scenes.length + b.infras.length;
|
|
131
|
+
if (bTotal !== aTotal) {
|
|
132
|
+
return bTotal - aTotal;
|
|
133
|
+
}
|
|
134
|
+
return a.domainId.localeCompare(b.domainId);
|
|
135
|
+
});
|
|
136
|
+
const colMetrics = orderedBuckets.map((bucket) => {
|
|
137
|
+
const sceneCols = getSceneSubCols(bucket.scenes.length);
|
|
138
|
+
const infraCols = getInfraSubCols(bucket.infras.length);
|
|
139
|
+
const sceneRows = sceneCols > 0 ? Math.ceil(bucket.scenes.length / sceneCols) : 0;
|
|
140
|
+
const infraRows = infraCols > 0 ? Math.ceil(bucket.infras.length / infraCols) : 0;
|
|
141
|
+
const sceneGridW = sceneCols > 0 ? sceneCols * sceneCardWidth + (sceneCols - 1) * cellGapX : 0;
|
|
142
|
+
const infraGridW = infraCols > 0 ? infraCols * infraCardWidth + (infraCols - 1) * cellGapX : 0;
|
|
143
|
+
const innerWidth = Math.max(domainCardWidth, sceneGridW, infraGridW);
|
|
144
|
+
const columnWidth = innerWidth + columnPaddingX * 2;
|
|
145
|
+
return {
|
|
146
|
+
bucket,
|
|
147
|
+
isInfra: isInfraBucket(bucket),
|
|
148
|
+
sceneCols,
|
|
149
|
+
infraCols,
|
|
150
|
+
sceneRows,
|
|
151
|
+
infraRows,
|
|
152
|
+
columnWidth,
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
const maxSceneRows = Math.max(0, ...colMetrics.map((m) => m.sceneRows));
|
|
156
|
+
const maxInfraRows = Math.max(0, ...colMetrics.map((m) => m.infraRows));
|
|
157
|
+
const effectiveSceneRows = Math.max(2, maxSceneRows);
|
|
158
|
+
const columnTopY = 0;
|
|
159
|
+
const topInnerPadding = 24;
|
|
160
|
+
const domainCenterY = columnTopY + topInnerPadding + domainCardHeight / 2;
|
|
161
|
+
const sceneStartTopY = columnTopY + topInnerPadding + domainCardHeight + 26;
|
|
162
|
+
const sceneBandBottomY = sceneStartTopY + effectiveSceneRows * sceneCardHeight + (effectiveSceneRows - 1) * cellGapY;
|
|
163
|
+
const infraStartTopY = sceneBandBottomY + routingChannelHeight;
|
|
164
|
+
const infraBandBottomY = maxInfraRows > 0
|
|
165
|
+
? infraStartTopY + maxInfraRows * infraCardHeight + (maxInfraRows - 1) * cellGapY
|
|
166
|
+
: infraStartTopY + infraCardHeight;
|
|
167
|
+
const columnBottomY = (maxInfraRows > 0 ? infraBandBottomY : sceneBandBottomY) + 28;
|
|
168
|
+
const columnHeight = columnBottomY - columnTopY;
|
|
169
|
+
const firstColumnLeftX = 116;
|
|
170
|
+
const positions = {};
|
|
171
|
+
const nodeBoxes = {};
|
|
172
|
+
const columns = [];
|
|
173
|
+
let cursorLeftX = firstColumnLeftX;
|
|
174
|
+
colMetrics.forEach((metric, columnIndex) => {
|
|
175
|
+
const { bucket, isInfra, sceneCols, infraCols, columnWidth } = metric;
|
|
176
|
+
const paletteIndex = isInfra
|
|
177
|
+
? 0
|
|
178
|
+
: ((columnIndex - 1 + DOMAIN_CARD_PALETTES.length) % (DOMAIN_CARD_PALETTES.length - 1)) + 1;
|
|
179
|
+
const columnCenterX = cursorLeftX + columnWidth / 2;
|
|
180
|
+
columns.push({
|
|
181
|
+
domainId: bucket.domainId,
|
|
182
|
+
title: bucket.domainNode?.title ?? bucket.domainId,
|
|
183
|
+
isInfrastructureDomain: isInfra,
|
|
184
|
+
columnIndex,
|
|
185
|
+
x: columnCenterX,
|
|
186
|
+
y: columnTopY + columnHeight / 2,
|
|
187
|
+
left: cursorLeftX,
|
|
188
|
+
top: columnTopY,
|
|
189
|
+
width: columnWidth,
|
|
190
|
+
height: columnHeight,
|
|
191
|
+
paletteIndex,
|
|
192
|
+
sceneCount: bucket.scenes.length,
|
|
193
|
+
infrastructureCount: bucket.infras.length,
|
|
194
|
+
});
|
|
195
|
+
if (bucket.domainNode) {
|
|
196
|
+
const dNode = bucket.domainNode;
|
|
197
|
+
positions[dNode.id] = { x: columnCenterX, y: domainCenterY };
|
|
198
|
+
nodeBoxes[dNode.id] = {
|
|
199
|
+
id: dNode.id,
|
|
200
|
+
type: dNode.type,
|
|
201
|
+
domainId: dNode.domainId,
|
|
202
|
+
x: columnCenterX,
|
|
203
|
+
y: domainCenterY,
|
|
204
|
+
width: domainCardWidth,
|
|
205
|
+
height: domainCardHeight,
|
|
206
|
+
left: columnCenterX - domainCardWidth / 2,
|
|
207
|
+
top: domainCenterY - domainCardHeight / 2,
|
|
208
|
+
right: columnCenterX + domainCardWidth / 2,
|
|
209
|
+
bottom: domainCenterY + domainCardHeight / 2,
|
|
210
|
+
columnIndex,
|
|
211
|
+
tier: "domain",
|
|
212
|
+
paletteIndex,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const sceneCoords = computeCenteredGridPositions(bucket.scenes.length, sceneCols, columnCenterX, sceneStartTopY, sceneCardWidth, sceneCardHeight, cellGapX, cellGapY);
|
|
216
|
+
bucket.scenes.forEach((sNode, idx) => {
|
|
217
|
+
const pt = sceneCoords[idx];
|
|
218
|
+
positions[sNode.id] = pt;
|
|
219
|
+
nodeBoxes[sNode.id] = {
|
|
220
|
+
id: sNode.id,
|
|
221
|
+
type: sNode.type,
|
|
222
|
+
domainId: sNode.domainId,
|
|
223
|
+
x: pt.x,
|
|
224
|
+
y: pt.y,
|
|
225
|
+
width: sceneCardWidth,
|
|
226
|
+
height: sceneCardHeight,
|
|
227
|
+
left: pt.x - sceneCardWidth / 2,
|
|
228
|
+
top: pt.y - sceneCardHeight / 2,
|
|
229
|
+
right: pt.x + sceneCardWidth / 2,
|
|
230
|
+
bottom: pt.y + sceneCardHeight / 2,
|
|
231
|
+
columnIndex,
|
|
232
|
+
tier: "scene",
|
|
233
|
+
paletteIndex,
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
const infraCoords = computeCenteredGridPositions(bucket.infras.length, infraCols, columnCenterX, infraStartTopY, infraCardWidth, infraCardHeight, cellGapX, cellGapY);
|
|
237
|
+
bucket.infras.forEach((kNode, idx) => {
|
|
238
|
+
const pt = infraCoords[idx];
|
|
239
|
+
positions[kNode.id] = pt;
|
|
240
|
+
nodeBoxes[kNode.id] = {
|
|
241
|
+
id: kNode.id,
|
|
242
|
+
type: kNode.type,
|
|
243
|
+
domainId: kNode.domainId,
|
|
244
|
+
x: pt.x,
|
|
245
|
+
y: pt.y,
|
|
246
|
+
width: infraCardWidth,
|
|
247
|
+
height: infraCardHeight,
|
|
248
|
+
left: pt.x - infraCardWidth / 2,
|
|
249
|
+
top: pt.y - infraCardHeight / 2,
|
|
250
|
+
right: pt.x + infraCardWidth / 2,
|
|
251
|
+
bottom: pt.y + infraCardHeight / 2,
|
|
252
|
+
columnIndex,
|
|
253
|
+
tier: "infrastructure",
|
|
254
|
+
paletteIndex,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
cursorLeftX += columnWidth + columnGap;
|
|
258
|
+
});
|
|
259
|
+
const tierWidth = 76;
|
|
260
|
+
const tierHeight = 28;
|
|
261
|
+
const tierCenterX = 46;
|
|
262
|
+
const sceneLabelY = sceneStartTopY + Math.min(sceneBandBottomY - sceneStartTopY, 180) / 2;
|
|
263
|
+
const infraLabelY = infraStartTopY + Math.min(infraBandBottomY - infraStartTopY, 180) / 2;
|
|
264
|
+
const tiers = [
|
|
265
|
+
{
|
|
266
|
+
id: "01",
|
|
267
|
+
label: "01 领域",
|
|
268
|
+
x: tierCenterX,
|
|
269
|
+
y: domainCenterY,
|
|
270
|
+
width: tierWidth,
|
|
271
|
+
height: tierHeight,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "02",
|
|
275
|
+
label: "02 场景",
|
|
276
|
+
x: tierCenterX,
|
|
277
|
+
y: sceneLabelY,
|
|
278
|
+
width: tierWidth,
|
|
279
|
+
height: tierHeight,
|
|
280
|
+
},
|
|
281
|
+
...(maxInfraRows > 0
|
|
282
|
+
? [
|
|
283
|
+
{
|
|
284
|
+
id: "03",
|
|
285
|
+
label: "03 知识",
|
|
286
|
+
x: tierCenterX,
|
|
287
|
+
y: infraLabelY,
|
|
288
|
+
width: tierWidth,
|
|
289
|
+
height: tierHeight,
|
|
290
|
+
},
|
|
291
|
+
]
|
|
292
|
+
: []),
|
|
293
|
+
];
|
|
294
|
+
const minX = 0;
|
|
295
|
+
const minY = columnTopY;
|
|
296
|
+
const maxX = Math.max(firstColumnLeftX, cursorLeftX - columnGap);
|
|
297
|
+
const maxY = columnBottomY;
|
|
298
|
+
return {
|
|
299
|
+
positions,
|
|
300
|
+
nodeBoxes,
|
|
301
|
+
columns,
|
|
302
|
+
tiers,
|
|
303
|
+
bounds: {
|
|
304
|
+
minX,
|
|
305
|
+
minY,
|
|
306
|
+
maxX,
|
|
307
|
+
maxY,
|
|
308
|
+
width: maxX - minX,
|
|
309
|
+
height: maxY - minY,
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Computes deterministic radial initial coordinates for Mode A (`有机布局` / Organic Layout) so
|
|
315
|
+
* Cytoscape's force-directed solver converges cleanly with shared knowledge near the core and
|
|
316
|
+
* business domains + scenes radiating around it without tangled overlap.
|
|
317
|
+
*/
|
|
318
|
+
export function computeOrganicSeedPositions(nodes) {
|
|
319
|
+
const positions = {};
|
|
320
|
+
if (nodes.length === 0) {
|
|
321
|
+
return positions;
|
|
322
|
+
}
|
|
323
|
+
const infras = nodes
|
|
324
|
+
.filter((n) => n.type === "infrastructure")
|
|
325
|
+
.slice()
|
|
326
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
327
|
+
const domainIds = Array.from(new Set(nodes.map((n) => n.domainId))).sort((a, b) => a.localeCompare(b));
|
|
328
|
+
// Place shared infrastructure nodes in a gentle inner spiral near (0, 0)
|
|
329
|
+
infras.forEach((node, idx) => {
|
|
330
|
+
const angle = idx * 2.399963; // golden angle
|
|
331
|
+
const radius = 55 + Math.sqrt(idx + 1) * 48;
|
|
332
|
+
positions[node.id] = {
|
|
333
|
+
x: Math.cos(angle) * radius,
|
|
334
|
+
y: Math.sin(angle) * radius,
|
|
335
|
+
};
|
|
336
|
+
});
|
|
337
|
+
// Place domains around an outer ring and fan each domain's scenes around its hub
|
|
338
|
+
const domainRingRadius = Math.max(260, 140 + Math.sqrt(nodes.length) * 45);
|
|
339
|
+
domainIds.forEach((domainId, dIdx) => {
|
|
340
|
+
const baseAngle = (2 * Math.PI * dIdx) / Math.max(1, domainIds.length) - Math.PI / 2;
|
|
341
|
+
const hubX = Math.cos(baseAngle) * domainRingRadius;
|
|
342
|
+
const hubY = Math.sin(baseAngle) * domainRingRadius;
|
|
343
|
+
const domainNode = nodes.find((n) => n.type === "domain" && n.domainId === domainId);
|
|
344
|
+
if (domainNode) {
|
|
345
|
+
positions[domainNode.id] = { x: hubX, y: hubY };
|
|
346
|
+
}
|
|
347
|
+
const domainScenes = nodes
|
|
348
|
+
.filter((n) => n.type === "scene" && n.domainId === domainId)
|
|
349
|
+
.slice()
|
|
350
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
351
|
+
domainScenes.forEach((scene, sIdx) => {
|
|
352
|
+
const localAngle = baseAngle + (sIdx - (domainScenes.length - 1) / 2) * 0.42 + (sIdx % 2 === 0 ? -0.08 : 0.08);
|
|
353
|
+
const localRadius = 110 + Math.floor(sIdx / 4) * 72;
|
|
354
|
+
positions[scene.id] = {
|
|
355
|
+
x: hubX + Math.cos(localAngle) * localRadius,
|
|
356
|
+
y: hubY + Math.sin(localAngle) * localRadius,
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
return positions;
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/graph-logic/layout.ts"],"names":[],"mappings":"AAkFA,MAAM,CAAC,MAAM,oBAAoB,GAA6B;IAC5D,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,+BAA+B;IACtF,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EA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,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;aAC5D,KAAK,EAAE;aACP,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE5C,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACnC,MAAM,UAAU,GACd,SAAS,GAAG,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC9F,MAAM,WAAW,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACpD,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG;gBACpB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,WAAW;gBAC5C,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,WAAW;aAC7C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,191 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type FreshnessStatus = "fresh" | "stale" | "unverified";
|
|
5
|
-
export type HealthFilter = "all" | "stale" | "fresh" | "unverified" | "pending" | "low_confidence";
|
|
6
|
-
export type GraphNodeWithFreshness = GraphNode & {
|
|
7
|
-
freshnessStatus?: FreshnessStatus;
|
|
8
|
-
};
|
|
9
|
-
export interface NodeFreshnessBadgeMeta {
|
|
10
|
-
status: FreshnessStatus;
|
|
11
|
-
label: string;
|
|
12
|
-
description: string;
|
|
13
|
-
}
|
|
14
|
-
export interface GraphFilterCriteria {
|
|
15
|
-
domainId?: string;
|
|
16
|
-
nodeType?: NodeTypeFilter;
|
|
17
|
-
health?: HealthFilter;
|
|
18
|
-
query?: string;
|
|
19
|
-
showBelongsTo?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface FilteredGraphResult {
|
|
22
|
-
nodes: GraphNode[];
|
|
23
|
-
edges: GraphEdge[];
|
|
24
|
-
matchedNodeIds: Set<string>;
|
|
25
|
-
visibleNodeIds: Set<string>;
|
|
26
|
-
}
|
|
27
|
-
export interface HierarchyLayoutOptions {
|
|
28
|
-
domainCardWidth?: number;
|
|
29
|
-
domainCardHeight?: number;
|
|
30
|
-
sceneCardWidth?: number;
|
|
31
|
-
sceneCardHeight?: number;
|
|
32
|
-
infraCardWidth?: number;
|
|
33
|
-
infraCardHeight?: number;
|
|
34
|
-
cellGapX?: number;
|
|
35
|
-
cellGapY?: number;
|
|
36
|
-
columnPaddingX?: number;
|
|
37
|
-
columnGap?: number;
|
|
38
|
-
routingChannelHeight?: number;
|
|
39
|
-
infrastructureDomains?: string[];
|
|
40
|
-
}
|
|
41
|
-
export interface HierarchyNodeBox {
|
|
42
|
-
id: string;
|
|
43
|
-
type: GraphNodeType;
|
|
44
|
-
domainId: string;
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
width: number;
|
|
48
|
-
height: number;
|
|
49
|
-
left: number;
|
|
50
|
-
top: number;
|
|
51
|
-
right: number;
|
|
52
|
-
bottom: number;
|
|
53
|
-
columnIndex: number;
|
|
54
|
-
tier: "domain" | "scene" | "infrastructure";
|
|
55
|
-
paletteIndex: number;
|
|
56
|
-
}
|
|
57
|
-
export interface HierarchyColumnBox {
|
|
58
|
-
domainId: string;
|
|
59
|
-
title: string;
|
|
60
|
-
isInfrastructureDomain: boolean;
|
|
61
|
-
columnIndex: number;
|
|
62
|
-
x: number;
|
|
63
|
-
y: number;
|
|
64
|
-
left: number;
|
|
65
|
-
top: number;
|
|
66
|
-
width: number;
|
|
67
|
-
height: number;
|
|
68
|
-
paletteIndex: number;
|
|
69
|
-
sceneCount: number;
|
|
70
|
-
infrastructureCount: number;
|
|
71
|
-
}
|
|
72
|
-
export interface HierarchyTierLabel {
|
|
73
|
-
id: "01" | "02" | "03";
|
|
74
|
-
label: string;
|
|
75
|
-
x: number;
|
|
76
|
-
y: number;
|
|
77
|
-
width: number;
|
|
78
|
-
height: number;
|
|
79
|
-
}
|
|
80
|
-
export interface HierarchyLayoutResult {
|
|
81
|
-
positions: Record<string, {
|
|
82
|
-
x: number;
|
|
83
|
-
y: number;
|
|
84
|
-
}>;
|
|
85
|
-
nodeBoxes: Record<string, HierarchyNodeBox>;
|
|
86
|
-
columns: HierarchyColumnBox[];
|
|
87
|
-
tiers: HierarchyTierLabel[];
|
|
88
|
-
bounds: {
|
|
89
|
-
minX: number;
|
|
90
|
-
minY: number;
|
|
91
|
-
maxX: number;
|
|
92
|
-
maxY: number;
|
|
93
|
-
width: number;
|
|
94
|
-
height: number;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export interface DomainPalette {
|
|
98
|
-
bg: string;
|
|
99
|
-
border: string;
|
|
100
|
-
text: string;
|
|
101
|
-
}
|
|
102
|
-
export declare const DOMAIN_CARD_PALETTES: readonly DomainPalette[];
|
|
103
|
-
/**
|
|
104
|
-
* Parses and validates a `livex-graph/v1` payload while preserving optional `freshnessStatus`
|
|
105
|
-
* metadata across schema versions.
|
|
106
|
-
*/
|
|
107
|
-
export declare function parseGraphDataPayload(raw: unknown): {
|
|
108
|
-
success: true;
|
|
109
|
-
data: GraphData;
|
|
110
|
-
} | {
|
|
111
|
-
success: false;
|
|
112
|
-
message: string;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Returns true if the node is marked stale either via `stale: true` or `freshnessStatus: "stale"`.
|
|
116
|
-
*/
|
|
117
|
-
export declare function isNodeStale(node: GraphNodeWithFreshness): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Resolves explicit, honest freshness badge semantics (`stale` vs `fresh` vs `unverified`) so
|
|
120
|
-
* static snapshots built without `--repos-dir` never falsely claim live source verification.
|
|
121
|
-
*/
|
|
122
|
-
export declare function resolveNodeFreshness(node: GraphNodeWithFreshness): NodeFreshnessBadgeMeta;
|
|
123
|
-
/**
|
|
124
|
-
* Formats the node count status indicator (`显示 X / Y 节点` when filtered, `Y 节点` when unfiltered).
|
|
125
|
-
*/
|
|
126
|
-
export declare function formatNodeCountIndicator(visibleDataNodeCount: number, totalDataNodeCount: number): string;
|
|
127
|
-
/**
|
|
128
|
-
* Builds the relative API endpoint URL used by `olw graph serve --no-markdown` to lazily fetch a
|
|
129
|
-
* node's full Markdown body on demand.
|
|
130
|
-
*/
|
|
131
|
-
export declare function buildNodeMarkdownEndpoint(nodeId: string): string;
|
|
132
|
-
export type LazyMarkdownResult = {
|
|
133
|
-
status: "loaded";
|
|
134
|
-
markdown: string;
|
|
135
|
-
} | {
|
|
136
|
-
status: "unavailable";
|
|
137
|
-
} | {
|
|
138
|
-
status: "aborted";
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Lazily fetches a node's Markdown body from `./api/nodes/<encodedId>/markdown` with in-memory
|
|
142
|
-
* caching and graceful static-hosting fallback when built with `--no-markdown`.
|
|
143
|
-
*/
|
|
144
|
-
export declare function fetchNodeMarkdownLazy(nodeId: string, options?: {
|
|
145
|
-
cache?: Map<string, string>;
|
|
146
|
-
fetchImpl?: typeof fetch;
|
|
147
|
-
signal?: AbortSignal;
|
|
148
|
-
}): Promise<LazyMarkdownResult>;
|
|
149
|
-
/**
|
|
150
|
-
* Checks whether a single GraphNode matches a free-text search query across title, ID, domainId,
|
|
151
|
-
* sceneId, aliases, and summary.
|
|
152
|
-
*/
|
|
153
|
-
export declare function matchesSearchQuery(node: GraphNode, rawQuery: string): boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Searches and ranks graph nodes for instant typeahead / command-K lookup.
|
|
156
|
-
*/
|
|
157
|
-
export declare function searchGraphNodes(data: GraphData, rawQuery: string, limit?: number): GraphNode[];
|
|
158
|
-
export declare function matchesHealthFilter(node: GraphNode, health: HealthFilter): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Filters graph nodes and edges deterministically according to domain, type, health, search query,
|
|
161
|
-
* and `belongs_to` edge visibility.
|
|
162
|
-
*/
|
|
163
|
-
export declare function filterGraphElements(data: GraphData, criteria?: GraphFilterCriteria): FilteredGraphResult;
|
|
164
|
-
/**
|
|
165
|
-
* Computes the 1-hop neighborhood (`belongs_to` + upstream `dependsOn` + downstream `dependents`)
|
|
166
|
-
* around a focused node for interactive highlighting.
|
|
167
|
-
*/
|
|
168
|
-
export declare function computeNeighborhood(nodes: readonly GraphNode[], edges: readonly GraphEdge[], focusNodeId: string): {
|
|
169
|
-
nodeIds: Set<string>;
|
|
170
|
-
edgeIds: Set<string>;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Computes deterministic, collision-free coordinates for Mode B (`依赖层次` / Dependency Hierarchy):
|
|
174
|
-
* - Vertical Domain Columns (infrastructure domain columns placed leftmost like `基建域`, followed
|
|
175
|
-
* by business domain columns sorted by size).
|
|
176
|
-
* - 3 Horizontal Swimlane Tiers:
|
|
177
|
-
* - `01 领域` (top band): Domain header rectangular cards centered atop each column.
|
|
178
|
-
* - `02 场景` (middle band): Multi-column sub-grids of scene cards inside owning domain columns.
|
|
179
|
-
* - `03 知识` (bottom band): Multi-column sub-grids of shared knowledge cards at the bottom.
|
|
180
|
-
*/
|
|
181
|
-
export declare function computeHierarchyLayout(nodes: readonly GraphNode[], options?: HierarchyLayoutOptions): HierarchyLayoutResult;
|
|
182
|
-
/**
|
|
183
|
-
* Computes deterministic radial initial coordinates for Mode A (`有机布局` / Organic Layout) so
|
|
184
|
-
* Cytoscape's force-directed solver converges cleanly with shared knowledge near the core and
|
|
185
|
-
* business domains + scenes radiating around it without tangled overlap.
|
|
186
|
-
*/
|
|
187
|
-
export declare function computeOrganicSeedPositions(nodes: readonly GraphNode[]): Record<string, {
|
|
188
|
-
x: number;
|
|
189
|
-
y: number;
|
|
190
|
-
}>;
|
|
1
|
+
export { computeNeighborhood, type FilteredGraphResult, filterGraphElements, formatNodeCountIndicator, type GraphFilterCriteria, type HealthFilter, matchesHealthFilter, matchesSearchQuery, type NodeTypeFilter, searchGraphNodes, } from "./graph-logic/filters.js";
|
|
2
|
+
export { buildNodeMarkdownEndpoint, type FreshnessStatus, fetchNodeMarkdownLazy, type GraphNodeWithFreshness, isNodeStale, type LazyMarkdownResult, type NodeFreshnessBadgeMeta, parseGraphDataPayload, resolveNodeFreshness, } from "./graph-logic/graph-data.js";
|
|
3
|
+
export { computeHierarchyLayout, computeOrganicSeedPositions, DOMAIN_CARD_PALETTES, type DomainPalette, type HierarchyColumnBox, type HierarchyLayoutOptions, type HierarchyLayoutResult, type HierarchyNodeBox, type HierarchyTierLabel, type LayoutMode, } from "./graph-logic/layout.js";
|
|
191
4
|
//# sourceMappingURL=graph-logic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-logic.d.ts","sourceRoot":"","sources":["../src/graph-logic.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"graph-logic.d.ts","sourceRoot":"","sources":["../src/graph-logic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,cAAc,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC"}
|