@tienne/gestalt 0.149.0 → 0.151.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/package.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/skills/architecture/SKILL.md +103 -16
- package/dist/plugin/skills/architecture/references/domain-flow.md +1 -1
- package/dist/plugin/skills/architecture/references/merge-analyses.md +4 -3
- package/dist/plugin/skills/architecture/references/rerun.md +5 -5
- package/dist/schemas/architecture-ir.schema.json +18 -1
- package/dist/src/architecture/commit-policy.d.ts +31 -0
- package/dist/src/architecture/commit-policy.d.ts.map +1 -0
- package/dist/src/architecture/commit-policy.js +95 -0
- package/dist/src/architecture/commit-policy.js.map +1 -0
- package/dist/src/architecture/csp.d.ts +14 -0
- package/dist/src/architecture/csp.d.ts.map +1 -0
- package/dist/src/architecture/csp.js +56 -0
- package/dist/src/architecture/csp.js.map +1 -0
- package/dist/src/architecture/delta-renderer.d.ts.map +1 -1
- package/dist/src/architecture/delta-renderer.js +12 -9
- package/dist/src/architecture/delta-renderer.js.map +1 -1
- package/dist/src/architecture/delta.d.ts +2 -1
- package/dist/src/architecture/delta.d.ts.map +1 -1
- package/dist/src/architecture/delta.js +4 -2
- package/dist/src/architecture/delta.js.map +1 -1
- package/dist/src/architecture/did-you-mean.d.ts +14 -0
- package/dist/src/architecture/did-you-mean.d.ts.map +1 -0
- package/dist/src/architecture/did-you-mean.js +63 -0
- package/dist/src/architecture/did-you-mean.js.map +1 -0
- package/dist/src/architecture/drilldown.d.ts +53 -1
- package/dist/src/architecture/drilldown.d.ts.map +1 -1
- package/dist/src/architecture/drilldown.js +441 -32
- package/dist/src/architecture/drilldown.js.map +1 -1
- package/dist/src/architecture/endpoint-match.d.ts +33 -2
- package/dist/src/architecture/endpoint-match.d.ts.map +1 -1
- package/dist/src/architecture/endpoint-match.js +295 -42
- package/dist/src/architecture/endpoint-match.js.map +1 -1
- package/dist/src/architecture/git-facts.d.ts +54 -0
- package/dist/src/architecture/git-facts.d.ts.map +1 -0
- package/dist/src/architecture/git-facts.js +225 -0
- package/dist/src/architecture/git-facts.js.map +1 -0
- package/dist/src/architecture/html-client.d.ts +9 -0
- package/dist/src/architecture/html-client.d.ts.map +1 -1
- package/dist/src/architecture/html-client.js +397 -40
- package/dist/src/architecture/html-client.js.map +1 -1
- package/dist/src/architecture/html-renderer.d.ts +2 -0
- package/dist/src/architecture/html-renderer.d.ts.map +1 -1
- package/dist/src/architecture/html-renderer.js +230 -24
- package/dist/src/architecture/html-renderer.js.map +1 -1
- package/dist/src/architecture/html-theme.d.ts +17 -10
- package/dist/src/architecture/html-theme.d.ts.map +1 -1
- package/dist/src/architecture/html-theme.js +271 -137
- package/dist/src/architecture/html-theme.js.map +1 -1
- package/dist/src/architecture/index.d.ts +3 -0
- package/dist/src/architecture/index.d.ts.map +1 -1
- package/dist/src/architecture/index.js +3 -0
- package/dist/src/architecture/index.js.map +1 -1
- package/dist/src/architecture/ir-schema.d.ts +296 -264
- package/dist/src/architecture/ir-schema.d.ts.map +1 -1
- package/dist/src/architecture/ir-schema.js +75 -0
- package/dist/src/architecture/ir-schema.js.map +1 -1
- package/dist/src/architecture/layout-tuning.d.ts +49 -0
- package/dist/src/architecture/layout-tuning.d.ts.map +1 -0
- package/dist/src/architecture/layout-tuning.js +51 -0
- package/dist/src/architecture/layout-tuning.js.map +1 -0
- package/dist/src/architecture/layout.d.ts +35 -3
- package/dist/src/architecture/layout.d.ts.map +1 -1
- package/dist/src/architecture/layout.js +75 -15
- package/dist/src/architecture/layout.js.map +1 -1
- package/dist/src/architecture/live-ask.d.ts +35 -0
- package/dist/src/architecture/live-ask.d.ts.map +1 -0
- package/dist/src/architecture/live-ask.js +69 -0
- package/dist/src/architecture/live-ask.js.map +1 -0
- package/dist/src/architecture/live-client.d.ts +17 -0
- package/dist/src/architecture/live-client.d.ts.map +1 -0
- package/dist/src/architecture/live-client.js +272 -0
- package/dist/src/architecture/live-client.js.map +1 -0
- package/dist/src/architecture/live-port.d.ts +17 -0
- package/dist/src/architecture/live-port.d.ts.map +1 -0
- package/dist/src/architecture/live-port.js +23 -0
- package/dist/src/architecture/live-port.js.map +1 -0
- package/dist/src/architecture/live-server.d.ts +79 -0
- package/dist/src/architecture/live-server.d.ts.map +1 -0
- package/dist/src/architecture/live-server.js +409 -0
- package/dist/src/architecture/live-server.js.map +1 -0
- package/dist/src/architecture/live-session.d.ts +13 -0
- package/dist/src/architecture/live-session.d.ts.map +1 -0
- package/dist/src/architecture/live-session.js +48 -0
- package/dist/src/architecture/live-session.js.map +1 -0
- package/dist/src/architecture/merge.d.ts +17 -0
- package/dist/src/architecture/merge.d.ts.map +1 -1
- package/dist/src/architecture/merge.js +27 -3
- package/dist/src/architecture/merge.js.map +1 -1
- package/dist/src/architecture/packs/generic.d.ts +2 -2
- package/dist/src/architecture/packs/generic.js +2 -2
- package/dist/src/architecture/packs/generic.js.map +1 -1
- package/dist/src/architecture/packs/index.d.ts +2 -2
- package/dist/src/architecture/repo-visibility.d.ts +32 -0
- package/dist/src/architecture/repo-visibility.d.ts.map +1 -0
- package/dist/src/architecture/repo-visibility.js +93 -0
- package/dist/src/architecture/repo-visibility.js.map +1 -0
- package/dist/src/architecture/secret-mask.d.ts +61 -0
- package/dist/src/architecture/secret-mask.d.ts.map +1 -0
- package/dist/src/architecture/secret-mask.js +618 -0
- package/dist/src/architecture/secret-mask.js.map +1 -0
- package/dist/src/architecture/store.d.ts +88 -6
- package/dist/src/architecture/store.d.ts.map +1 -1
- package/dist/src/architecture/store.js +419 -50
- package/dist/src/architecture/store.js.map +1 -1
- package/dist/src/architecture/types.d.ts +8 -0
- package/dist/src/architecture/types.d.ts.map +1 -1
- package/dist/src/architecture/types.js.map +1 -1
- package/dist/src/architecture/validator.d.ts +75 -3
- package/dist/src/architecture/validator.d.ts.map +1 -1
- package/dist/src/architecture/validator.js +318 -45
- package/dist/src/architecture/validator.js.map +1 -1
- package/dist/src/cli/commands/conductor.d.ts.map +1 -1
- package/dist/src/cli/commands/conductor.js +50 -1
- package/dist/src/cli/commands/conductor.js.map +1 -1
- package/dist/src/conductor/recent-events.d.ts +22 -0
- package/dist/src/conductor/recent-events.d.ts.map +1 -0
- package/dist/src/conductor/recent-events.js +126 -0
- package/dist/src/conductor/recent-events.js.map +1 -0
- package/dist/src/digest/blocks.d.ts +14 -14
- package/dist/src/digest/diagram-schema.d.ts +2 -2
- package/dist/src/digest/lens-schema.d.ts +38 -38
- package/dist/src/digest/lens-source.d.ts +2 -2
- package/dist/src/digest/lens-widget-schema.d.ts +58 -58
- package/dist/src/digest/lint-lens-context.d.ts +8 -8
- package/dist/src/digest/prd-guide.d.ts +1 -1
- package/dist/src/digest/prd-schema.d.ts +18 -18
- package/dist/src/digest/schema.d.ts +1046 -1046
- package/dist/src/digest/session-request.d.ts +2 -2
- package/dist/src/humanize/detectors.d.ts.map +1 -1
- package/dist/src/humanize/detectors.js +3 -1
- package/dist/src/humanize/detectors.js.map +1 -1
- package/dist/src/lens/attach.d.ts +42 -42
- package/dist/src/mcp/schemas.d.ts +16 -8
- package/dist/src/mcp/schemas.d.ts.map +1 -1
- package/dist/src/mcp/schemas.js +11 -2
- package/dist/src/mcp/schemas.js.map +1 -1
- package/dist/src/mcp/tools/architecture-passthrough.d.ts +18 -0
- package/dist/src/mcp/tools/architecture-passthrough.d.ts.map +1 -1
- package/dist/src/mcp/tools/architecture-passthrough.js +244 -33
- package/dist/src/mcp/tools/architecture-passthrough.js.map +1 -1
- package/dist/src/research/schema.d.ts +395 -395
- package/dist/src/research/source-schema.d.ts +5 -5
- package/dist/src/research/target.d.ts +37 -37
- package/package.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/mcp.json +1 -1
- package/plugin/skills/architecture/SKILL.md +103 -16
- package/plugin/skills/architecture/references/domain-flow.md +1 -1
- package/plugin/skills/architecture/references/merge-analyses.md +4 -3
- package/plugin/skills/architecture/references/rerun.md +5 -5
- package/schemas/architecture-ir.schema.json +18 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { assignStages, computeGraphLayout, environmentRank, laneOfNode, PARTITION_RANK, pinToColumnTop, stackTree, alignColumnsTo, sinkToColumnBottom, liftColumns, stackBands, bandGroupsOf, stackFrames, frameRects, stackGroups, groupRects, computeLayout, } from './layout.js';
|
|
1
|
+
import { assignStages, computeGraphLayout, environmentRank, laneOfNode, PARTITION_RANK, pinToColumnTop, stackTree, alignColumnsTo, sinkToColumnBottom, liftColumns, stackBands, bandGroupsOf, stackFrames, frameRects, stackGroups, groupRects, computeLayout, measureCard, measurePill, UNSTAGED_LABEL, } from './layout.js';
|
|
2
|
+
import { LANE_TITLES } from './kind-text.js';
|
|
3
|
+
import { CHUNK_CARD_H, CHUNK_CARD_W, CHUNK_LAYER_GAP, DRILL_LAYER_GAP, DRILL_NODE_GAP, OUTSIDE_PER_SIDE, ROOT_COLLAPSE_MIN_CARDS, ROOT_COLLAPSE_MIN_CHUNKS, } from './layout-tuning.js';
|
|
2
4
|
import { computeFlowLevels } from './flow-layout.js';
|
|
3
5
|
import { computeInfraLayout } from './infra-layout.js';
|
|
4
6
|
import { indexMicroApps, orderedApps } from './micro-app.js';
|
|
@@ -12,8 +14,22 @@ export const INFRA_LEVEL_ID = 'infra';
|
|
|
12
14
|
const RECEIVER_RANK = 10;
|
|
13
15
|
const TABLE_RANK_AFTER_RECEIVERS = 100;
|
|
14
16
|
// 전체 레벨에서 서버를 거쳐서만 닿는 게이트웨이와 모듈. 같은 레인 안에서도 게이트웨이가 왼쪽에 선다
|
|
15
|
-
//
|
|
17
|
+
// 바깥 카드 한 열에 세우는 최대 장수. tree 드릴다운과 service, server 레벨이 같이 쓴다
|
|
16
18
|
const OUTSIDE_PER_COLUMN = 4;
|
|
19
|
+
// service와 server, lane 레벨에서 한쪽에 세우는 바깥 카드 최대 장수. 넘치면 +N으로 접는다
|
|
20
|
+
const OUTSIDE_CONTEXT_MAX = OUTSIDE_PER_SIDE;
|
|
21
|
+
// 서빙과 배포 사슬은 호출이 아니라 바깥 맥락으로 세우지 않는다. 서비스 레벨이 제 서빙 사슬을 이미 그리고 나머지는 인프라 레벨과 배포 경로 그림이 보여 준다
|
|
22
|
+
const NON_CALL_EDGE_KINDS = new Set([
|
|
23
|
+
'serves',
|
|
24
|
+
'origin',
|
|
25
|
+
'resolves_to',
|
|
26
|
+
'deploys_to',
|
|
27
|
+
'produces',
|
|
28
|
+
'builds',
|
|
29
|
+
'triggers',
|
|
30
|
+
]);
|
|
31
|
+
// layout.ts가 구간 있는 노드의 열을 구간 순번 * 이 값 + rank로 잡는다. 바깥 카드는 구간이 없어 이 값으로 안쪽 끝 열을 거꾸로 셈한다
|
|
32
|
+
const STAGE_RANK_STRIDE = 100;
|
|
17
33
|
const EXTERNAL_GATEWAY_RANK = PARTITION_RANK.app_module + 1;
|
|
18
34
|
const EXTERNAL_MODULE_RANK = PARTITION_RANK.app_module + 2;
|
|
19
35
|
// 저장소는 외부 서비스 레인 오른쪽 끝에 선다. 외부 서버도 같은 저장소를 쓰므로 그보다 뒤여야 선이 거꾸로 안 간다
|
|
@@ -491,6 +507,191 @@ function rootLevel(full, apps) {
|
|
|
491
507
|
...(groups.length > 0 ? { groups } : {}),
|
|
492
508
|
};
|
|
493
509
|
}
|
|
510
|
+
/** 덩어리 하나에 대표로 이름을 적는 카드 수 */
|
|
511
|
+
const CHUNK_TOP_NAMES = 3;
|
|
512
|
+
/**
|
|
513
|
+
* 카드가 많은 root를 레인 덩어리로 접는다. 레인 키는 배치가 쓰는 것과 같다(구간이 있으면 구간, 없으면 레인).
|
|
514
|
+
* 카드가 ROOT_COLLAPSE_MIN_CARDS장 이하이거나 덩어리가 ROOT_COLLAPSE_MIN_CHUNKS개보다 적으면 그대로 둔다.
|
|
515
|
+
* 접으면 root는 덩어리 카드와 덩어리 사이 묶음 선만 갖고 덩어리마다 lane 레벨이 생긴다
|
|
516
|
+
*/
|
|
517
|
+
function collapseRoot(g, root, staged) {
|
|
518
|
+
const ids = [...root.nodeIds].filter((id) => g.nodeById.has(id)).sort(compareStr);
|
|
519
|
+
if (ids.length <= ROOT_COLLAPSE_MIN_CARDS)
|
|
520
|
+
return { root, lanes: [] };
|
|
521
|
+
const keyOf = new Map();
|
|
522
|
+
const titleOf = new Map();
|
|
523
|
+
const rankOf = (id) => {
|
|
524
|
+
const node = g.nodeById.get(id);
|
|
525
|
+
return ((staged?.indexOf.get(id) ?? 0) * STAGE_RANK_STRIDE +
|
|
526
|
+
(root.rankOverride?.get(id) ?? PARTITION_RANK[node.kind]));
|
|
527
|
+
};
|
|
528
|
+
for (const id of ids) {
|
|
529
|
+
const node = g.nodeById.get(id);
|
|
530
|
+
if (staged !== undefined) {
|
|
531
|
+
const at = staged.indexOf.get(id);
|
|
532
|
+
keyOf.set(id, `stage-${at}`);
|
|
533
|
+
titleOf.set(`stage-${at}`, staged.labels[at] ?? UNSTAGED_LABEL);
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
const lane = root.laneOverride?.get(id) ?? root.laneOfKind?.[node.kind] ?? laneOfNode(node);
|
|
537
|
+
keyOf.set(id, lane);
|
|
538
|
+
titleOf.set(lane, LANE_TITLES[lane]);
|
|
539
|
+
}
|
|
540
|
+
const members = new Map();
|
|
541
|
+
for (const id of ids) {
|
|
542
|
+
const key = keyOf.get(id);
|
|
543
|
+
members.set(key, [...(members.get(key) ?? []), id]);
|
|
544
|
+
}
|
|
545
|
+
if (members.size < ROOT_COLLAPSE_MIN_CHUNKS)
|
|
546
|
+
return { root, lanes: [] };
|
|
547
|
+
const minRank = (key) => Math.min(...members.get(key).map(rankOf));
|
|
548
|
+
const keys = [...members.keys()].sort((a, b) => minRank(a) - minRank(b) || compareStr(a, b));
|
|
549
|
+
// 대표 카드는 root 선에 많이 걸린 순이다. 같으면 id 순이라 같은 IR이면 같은 이름이 나온다
|
|
550
|
+
const degree = new Map();
|
|
551
|
+
for (const e of root.edges) {
|
|
552
|
+
degree.set(e.from, (degree.get(e.from) ?? 0) + e.count);
|
|
553
|
+
degree.set(e.to, (degree.get(e.to) ?? 0) + e.count);
|
|
554
|
+
}
|
|
555
|
+
const chunks = keys.map((key, i) => {
|
|
556
|
+
const list = members.get(key);
|
|
557
|
+
return {
|
|
558
|
+
id: `chunk:${key}`,
|
|
559
|
+
level: `lane:${key}`,
|
|
560
|
+
title: titleOf.get(key),
|
|
561
|
+
order: i + 1,
|
|
562
|
+
memberIds: list,
|
|
563
|
+
topIds: [...list]
|
|
564
|
+
.sort((a, b) => (degree.get(b) ?? 0) - (degree.get(a) ?? 0) || compareStr(a, b))
|
|
565
|
+
.slice(0, CHUNK_TOP_NAMES),
|
|
566
|
+
};
|
|
567
|
+
});
|
|
568
|
+
const bundles = new Map();
|
|
569
|
+
for (const e of root.edges) {
|
|
570
|
+
const a = keyOf.get(e.from);
|
|
571
|
+
const b = keyOf.get(e.to);
|
|
572
|
+
if (a === undefined || b === undefined || a === b)
|
|
573
|
+
continue;
|
|
574
|
+
const id = `chunk:${a}->${b}`;
|
|
575
|
+
const cur = bundles.get(id) ?? {
|
|
576
|
+
from: `chunk:${a}`,
|
|
577
|
+
to: `chunk:${b}`,
|
|
578
|
+
count: 0,
|
|
579
|
+
members: new Set(),
|
|
580
|
+
};
|
|
581
|
+
cur.count += e.count;
|
|
582
|
+
for (const m of e.memberEdgeIds)
|
|
583
|
+
cur.members.add(m);
|
|
584
|
+
bundles.set(id, cur);
|
|
585
|
+
}
|
|
586
|
+
const chunkEdges = [...bundles.entries()]
|
|
587
|
+
.map(([id, b]) => {
|
|
588
|
+
const memberEdgeIds = [...b.members].sort(compareStr);
|
|
589
|
+
const inferred = memberEdgeIds.filter((m) => g.edgeById.get(m)?.lineStyle === 'dashed').length;
|
|
590
|
+
const allInferred = memberEdgeIds.length > 0 && inferred === memberEdgeIds.length;
|
|
591
|
+
return {
|
|
592
|
+
id,
|
|
593
|
+
from: b.from,
|
|
594
|
+
to: b.to,
|
|
595
|
+
kind: 'bundle',
|
|
596
|
+
count: b.count,
|
|
597
|
+
memberEdgeIds,
|
|
598
|
+
lineStyle: allInferred ? 'dashed' : 'solid',
|
|
599
|
+
...(inferred > 0 && !allInferred ? { inferred } : {}),
|
|
600
|
+
};
|
|
601
|
+
})
|
|
602
|
+
.sort(byId);
|
|
603
|
+
const lanes = chunks.map((c) => laneDraft(root, c));
|
|
604
|
+
return {
|
|
605
|
+
root: {
|
|
606
|
+
id: root.id,
|
|
607
|
+
kind: root.kind,
|
|
608
|
+
title: root.title,
|
|
609
|
+
trail: root.trail,
|
|
610
|
+
nodeIds: new Set(),
|
|
611
|
+
edges: chunkEdges,
|
|
612
|
+
chunks,
|
|
613
|
+
flatEdges: root.edges,
|
|
614
|
+
},
|
|
615
|
+
lanes,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* 덩어리 하나를 여는 lane 레벨. 안쪽 선은 root 선 중 양 끝이 다 덩어리 안인 것이다.
|
|
620
|
+
* 한 끝만 안인 root 선은 상대 카드를 바깥 맥락으로 세우고 한쪽에 OUTSIDE_CONTEXT_MAX장까지만 둔다
|
|
621
|
+
*/
|
|
622
|
+
function laneDraft(root, chunk) {
|
|
623
|
+
const inside = new Set(chunk.memberIds);
|
|
624
|
+
const sends = new Map();
|
|
625
|
+
const receives = new Map();
|
|
626
|
+
const edges = [];
|
|
627
|
+
for (const e of root.edges) {
|
|
628
|
+
const fromIn = inside.has(e.from);
|
|
629
|
+
const toIn = inside.has(e.to);
|
|
630
|
+
if (fromIn && toIn)
|
|
631
|
+
edges.push(e);
|
|
632
|
+
if (fromIn === toIn)
|
|
633
|
+
continue;
|
|
634
|
+
const other = fromIn ? e.to : e.from;
|
|
635
|
+
const side = fromIn ? receives : sends;
|
|
636
|
+
side.set(other, [...(side.get(other) ?? []), e]);
|
|
637
|
+
}
|
|
638
|
+
// 보내기도 하고 받기도 하는 카드는 부르는 쪽에 한 번만 세운다. withOutsideContext와 같은 규칙이다
|
|
639
|
+
for (const [id, es] of receives) {
|
|
640
|
+
const out = sends.get(id);
|
|
641
|
+
if (out === undefined)
|
|
642
|
+
continue;
|
|
643
|
+
sends.set(id, [...out, ...es]);
|
|
644
|
+
receives.delete(id);
|
|
645
|
+
}
|
|
646
|
+
const weight = (es) => es.reduce((n, e) => n + e.count, 0);
|
|
647
|
+
const pick = (side) => [...side.keys()]
|
|
648
|
+
.sort((a, b) => weight(side.get(b)) - weight(side.get(a)) || compareStr(a, b))
|
|
649
|
+
.slice(0, OUTSIDE_CONTEXT_MAX);
|
|
650
|
+
const from = pick(sends);
|
|
651
|
+
const to = pick(receives);
|
|
652
|
+
const nodeIds = new Set(inside);
|
|
653
|
+
const laneOverride = new Map(root.laneOverride);
|
|
654
|
+
for (const [list, side, lane] of [
|
|
655
|
+
[from, sends, 'outside_from'],
|
|
656
|
+
[to, receives, 'outside_to'],
|
|
657
|
+
]) {
|
|
658
|
+
for (const id of list) {
|
|
659
|
+
nodeIds.add(id);
|
|
660
|
+
laneOverride.set(id, lane);
|
|
661
|
+
edges.push(...side.get(id));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const frames = (root.frames ?? [])
|
|
665
|
+
.filter((f) => inside.has(f.head))
|
|
666
|
+
.map((f) => ({ head: f.head, members: f.members.filter((m) => inside.has(m)) }));
|
|
667
|
+
const groups = (root.groups ?? [])
|
|
668
|
+
.map((gr) => ({ label: gr.label, members: gr.members.filter((m) => inside.has(m)) }))
|
|
669
|
+
.filter((gr) => gr.members.length > 0);
|
|
670
|
+
const hasOutside = from.length > 0 || to.length > 0;
|
|
671
|
+
return {
|
|
672
|
+
id: chunk.level,
|
|
673
|
+
kind: 'lane',
|
|
674
|
+
title: chunk.title,
|
|
675
|
+
trail: [ROOT_LEVEL_ID, chunk.level],
|
|
676
|
+
nodeIds,
|
|
677
|
+
edges: [...new Map(edges.map((e) => [e.id, e])).values()].sort(byId),
|
|
678
|
+
...(root.rankOverride !== undefined ? { rankOverride: new Map(root.rankOverride) } : {}),
|
|
679
|
+
laneOverride,
|
|
680
|
+
...(root.laneOfKind !== undefined ? { laneOfKind: root.laneOfKind } : {}),
|
|
681
|
+
...(frames.length > 0 ? { frames } : {}),
|
|
682
|
+
...(groups.length > 0 ? { groups } : {}),
|
|
683
|
+
...(hasOutside
|
|
684
|
+
? {
|
|
685
|
+
outside: {
|
|
686
|
+
from,
|
|
687
|
+
to,
|
|
688
|
+
hiddenFrom: sends.size - from.length,
|
|
689
|
+
hiddenTo: receives.size - to.length,
|
|
690
|
+
},
|
|
691
|
+
}
|
|
692
|
+
: {}),
|
|
693
|
+
};
|
|
694
|
+
}
|
|
494
695
|
/** group 값이 같은 카드를 묶는다. 앱 테두리에 이미 든 카드는 뺀다. 카드가 하나여도 어디 소속인지 보이도록 테두리를 그린다 */
|
|
495
696
|
function labeledGroups(g, nodeIds, frames) {
|
|
496
697
|
const framed = new Set(frames.flatMap((f) => [f.head, ...f.members]));
|
|
@@ -879,6 +1080,112 @@ function treeOrder(layout, tree) {
|
|
|
879
1080
|
}
|
|
880
1081
|
return { root: tree.root, children };
|
|
881
1082
|
}
|
|
1083
|
+
/** 바깥 카드를 kind 순위마다 열로 나누고 한 열이 OUTSIDE_PER_COLUMN장을 넘으면 옆 열로 넘긴다 */
|
|
1084
|
+
function outsideColumns(g, ids) {
|
|
1085
|
+
const byRank = new Map();
|
|
1086
|
+
for (const id of [...ids].sort(compareStr)) {
|
|
1087
|
+
const r = PARTITION_RANK[g.nodeById.get(id).kind];
|
|
1088
|
+
byRank.set(r, [...(byRank.get(r) ?? []), id]);
|
|
1089
|
+
}
|
|
1090
|
+
return [...byRank.keys()]
|
|
1091
|
+
.sort((x, y) => x - y)
|
|
1092
|
+
.flatMap((r) => {
|
|
1093
|
+
const list = byRank.get(r);
|
|
1094
|
+
return Array.from({ length: Math.ceil(list.length / OUTSIDE_PER_COLUMN) }, (_, i) => list.slice(i * OUTSIDE_PER_COLUMN, (i + 1) * OUTSIDE_PER_COLUMN));
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* service와 server 레벨에 레벨 밖 상대 카드를 붙인다. 한 끝만 레벨 안에 있는 IR 선의 다른 끝이 대상이다.
|
|
1099
|
+
* 레벨 선(묶음 포함)이 이미 품은 IR 선은 안에서 그려진 것이라 건너뛴다. 묶음이 접어 둔 엔드포인트가 바깥 카드로 다시 튀어나오지 않게 하려는 것이다.
|
|
1100
|
+
* 레벨 주인 카드와 그 안에 든 노드도 바깥으로 치지 않는다
|
|
1101
|
+
*/
|
|
1102
|
+
function withOutsideContext(g, d, containerId) {
|
|
1103
|
+
const drawn = new Set(d.edges.flatMap((e) => e.memberEdgeIds));
|
|
1104
|
+
const contained = (id) => {
|
|
1105
|
+
for (let x = id; x !== undefined; x = g.parentOf.get(x))
|
|
1106
|
+
if (x === containerId)
|
|
1107
|
+
return true;
|
|
1108
|
+
return false;
|
|
1109
|
+
};
|
|
1110
|
+
const sends = new Map();
|
|
1111
|
+
const receives = new Map();
|
|
1112
|
+
for (const e of g.edges) {
|
|
1113
|
+
if (drawn.has(e.id) || NON_CALL_EDGE_KINDS.has(e.kind))
|
|
1114
|
+
continue;
|
|
1115
|
+
const fromIn = d.nodeIds.has(e.from);
|
|
1116
|
+
if (fromIn === d.nodeIds.has(e.to))
|
|
1117
|
+
continue;
|
|
1118
|
+
const other = fromIn ? e.to : e.from;
|
|
1119
|
+
if (contained(other))
|
|
1120
|
+
continue;
|
|
1121
|
+
const side = fromIn ? receives : sends;
|
|
1122
|
+
side.set(other, [...(side.get(other) ?? []), e]);
|
|
1123
|
+
}
|
|
1124
|
+
// 보내기도 하고 받기도 하는 카드는 호출하는 쪽에 한 번만 세우고 받는 선도 그 카드에 같이 긋는다
|
|
1125
|
+
for (const [id, es] of receives) {
|
|
1126
|
+
const out = sends.get(id);
|
|
1127
|
+
if (out === undefined)
|
|
1128
|
+
continue;
|
|
1129
|
+
sends.set(id, [...out, ...es]);
|
|
1130
|
+
receives.delete(id);
|
|
1131
|
+
}
|
|
1132
|
+
if (sends.size === 0 && receives.size === 0)
|
|
1133
|
+
return d;
|
|
1134
|
+
const pick = (side) => [...side.keys()]
|
|
1135
|
+
.sort((a, b) => side.get(b).length - side.get(a).length || compareStr(a, b))
|
|
1136
|
+
.slice(0, OUTSIDE_CONTEXT_MAX);
|
|
1137
|
+
const from = pick(sends);
|
|
1138
|
+
const to = pick(receives);
|
|
1139
|
+
const nodeIds = new Set(d.nodeIds);
|
|
1140
|
+
const laneOverride = new Map(d.laneOverride);
|
|
1141
|
+
const added = [];
|
|
1142
|
+
for (const [ids, side, lane] of [
|
|
1143
|
+
[from, sends, 'outside_from'],
|
|
1144
|
+
[to, receives, 'outside_to'],
|
|
1145
|
+
]) {
|
|
1146
|
+
for (const id of ids) {
|
|
1147
|
+
nodeIds.add(id);
|
|
1148
|
+
laneOverride.set(id, lane);
|
|
1149
|
+
added.push(...side.get(id));
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
return {
|
|
1153
|
+
...d,
|
|
1154
|
+
nodeIds,
|
|
1155
|
+
edges: [...d.edges, ...dedupe(added).map(asDetail)].sort(byId),
|
|
1156
|
+
laneOverride,
|
|
1157
|
+
outside: {
|
|
1158
|
+
from,
|
|
1159
|
+
to,
|
|
1160
|
+
hiddenFrom: sends.size - from.length,
|
|
1161
|
+
hiddenTo: receives.size - to.length,
|
|
1162
|
+
},
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* 바깥 카드의 열. 호출하는 쪽은 레벨 안 맨 왼쪽 열보다 왼쪽, 호출받는 쪽은 맨 오른쪽 열보다 오른쪽이다.
|
|
1167
|
+
* 안쪽 카드에 구간이 붙으면 layout.ts가 열을 구간 순번만큼 밀므로 그 값까지 넣어 끝 열을 잡는다
|
|
1168
|
+
*/
|
|
1169
|
+
function outsideRanks(g, d, outside, stageOf) {
|
|
1170
|
+
const out = new Set([...outside.from, ...outside.to]);
|
|
1171
|
+
const ranks = [...d.nodeIds]
|
|
1172
|
+
.filter((id) => !out.has(id) && g.nodeById.has(id))
|
|
1173
|
+
.map((id) => (stageOf?.get(id) ?? 0) * STAGE_RANK_STRIDE +
|
|
1174
|
+
(d.rankOverride?.get(id) ?? PARTITION_RANK[g.nodeById.get(id).kind]));
|
|
1175
|
+
const min = ranks.length > 0 ? Math.min(...ranks) : 0;
|
|
1176
|
+
const max = ranks.length > 0 ? Math.max(...ranks) : 0;
|
|
1177
|
+
const rankOf = new Map();
|
|
1178
|
+
const left = outsideColumns(g, outside.from);
|
|
1179
|
+
left.forEach((col, i) => {
|
|
1180
|
+
for (const id of col)
|
|
1181
|
+
rankOf.set(id, min - left.length + i);
|
|
1182
|
+
});
|
|
1183
|
+
outsideColumns(g, outside.to).forEach((col, i) => {
|
|
1184
|
+
for (const id of col)
|
|
1185
|
+
rankOf.set(id, max + 1 + i);
|
|
1186
|
+
});
|
|
1187
|
+
return rankOf;
|
|
1188
|
+
}
|
|
882
1189
|
/**
|
|
883
1190
|
* tree 전략의 레벨. 전체는 parent 없는 노드를, 자식이 있는 노드마다 그 직속 자식을 세운다.
|
|
884
1191
|
* 자손끼리의 선은 이 레벨에 선 카드까지 끌어올려 묶는다. 밖으로 나가는 선은 상대를 이 레벨의 형제 높이까지 올려 같이 세운다
|
|
@@ -953,27 +1260,14 @@ function groupDrafts(full) {
|
|
|
953
1260
|
const ranks = [...members].map((id) => PARTITION_RANK[g.nodeById.get(id).kind]);
|
|
954
1261
|
const rankOverride = new Map();
|
|
955
1262
|
const laneOverride = new Map();
|
|
956
|
-
const
|
|
957
|
-
const byRank = new Map();
|
|
958
|
-
for (const id of [...ids].sort(compareStr)) {
|
|
959
|
-
const r = PARTITION_RANK[g.nodeById.get(id).kind];
|
|
960
|
-
byRank.set(r, [...(byRank.get(r) ?? []), id]);
|
|
961
|
-
}
|
|
962
|
-
return [...byRank.keys()]
|
|
963
|
-
.sort((x, y) => x - y)
|
|
964
|
-
.flatMap((r) => {
|
|
965
|
-
const list = byRank.get(r);
|
|
966
|
-
return Array.from({ length: Math.ceil(list.length / OUTSIDE_PER_COLUMN) }, (_, i) => list.slice(i * OUTSIDE_PER_COLUMN, (i + 1) * OUTSIDE_PER_COLUMN));
|
|
967
|
-
});
|
|
968
|
-
};
|
|
969
|
-
const right = outsideColumns([...receives]);
|
|
1263
|
+
const right = outsideColumns(g, [...receives]);
|
|
970
1264
|
right.forEach((col, i) => {
|
|
971
1265
|
for (const id of col) {
|
|
972
1266
|
rankOverride.set(id, Math.max(...ranks) + 1 + i);
|
|
973
1267
|
laneOverride.set(id, 'outside_to');
|
|
974
1268
|
}
|
|
975
1269
|
});
|
|
976
|
-
const left = outsideColumns([...sendsOut].filter((id) => !receives.has(id)));
|
|
1270
|
+
const left = outsideColumns(g, [...sendsOut].filter((id) => !receives.has(id)));
|
|
977
1271
|
left.forEach((col, i) => {
|
|
978
1272
|
for (const id of col) {
|
|
979
1273
|
rankOverride.set(id, Math.min(...ranks) - left.length + i);
|
|
@@ -1094,10 +1388,12 @@ export function flowCountByService(flows) {
|
|
|
1094
1388
|
*/
|
|
1095
1389
|
async function flatRootWithInfra(validated, g, infraIds) {
|
|
1096
1390
|
const layout = await computeLayout(validated.ir, validated.drawableNodeIds, validated.drawableEdgeIds);
|
|
1391
|
+
const summary = summaryText(validated.ir.summary);
|
|
1097
1392
|
const root = {
|
|
1098
1393
|
id: ROOT_LEVEL_ID,
|
|
1099
1394
|
kind: 'root',
|
|
1100
1395
|
title: '전체',
|
|
1396
|
+
...(summary !== undefined ? { summary } : {}),
|
|
1101
1397
|
trail: [ROOT_LEVEL_ID],
|
|
1102
1398
|
nodeIds: [...g.nodeById.keys()].sort(compareStr),
|
|
1103
1399
|
edges: g.edges.map((e) => ({
|
|
@@ -1120,16 +1416,45 @@ async function flatRootWithInfra(validated, g, infraIds) {
|
|
|
1120
1416
|
flows: computeFlowLevels(validated),
|
|
1121
1417
|
};
|
|
1122
1418
|
}
|
|
1123
|
-
|
|
1419
|
+
/** 인프라 레벨 때문에만 드릴다운이 되는 그림이면 인프라 레벨에 들 노드 id를 낸다. 아니면 undefined다 */
|
|
1420
|
+
function flatInfraIds(validated, g) {
|
|
1421
|
+
if (drillsWithoutInfra(validated))
|
|
1422
|
+
return undefined;
|
|
1423
|
+
const infraIds = infraLevelNodeIds(g);
|
|
1424
|
+
return infraIds.length > 0 ? infraIds : undefined;
|
|
1425
|
+
}
|
|
1426
|
+
/** 레벨 id에서 그 레벨을 여는 노드 id를 꺼낸다. root와 infra는 여는 노드가 없다 */
|
|
1427
|
+
function levelOwnerId(level) {
|
|
1428
|
+
const prefix = `${level.kind}:`;
|
|
1429
|
+
return level.id.startsWith(prefix) ? level.id.slice(prefix.length) : undefined;
|
|
1430
|
+
}
|
|
1431
|
+
/** 공백뿐인 요약은 없는 것과 같다. 빈 칸을 실으면 화면이 빈 패널을 그린다 */
|
|
1432
|
+
function summaryText(text) {
|
|
1433
|
+
return text !== undefined && text.trim() !== '' ? text : undefined;
|
|
1434
|
+
}
|
|
1435
|
+
function levelSummary(validated, g, level) {
|
|
1436
|
+
if (level.kind === 'root')
|
|
1437
|
+
return summaryText(validated.ir.summary);
|
|
1438
|
+
const owner = levelOwnerId(level);
|
|
1439
|
+
return owner === undefined ? undefined : summaryText(g.nodeById.get(owner)?.summary);
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* computeDrilldown이 만들 레벨을 배치 없이 동기로 뽑는다. root가 맨 앞이고 나머지는 id 순이다.
|
|
1443
|
+
* 인프라 레벨은 배치 뒤에 붙고 여는 노드가 없어 뺀다
|
|
1444
|
+
*/
|
|
1445
|
+
export function drillLevelOwners(validated) {
|
|
1124
1446
|
const g = buildGraph(validated);
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1447
|
+
const drafts = flatInfraIds(validated, g) !== undefined
|
|
1448
|
+
? [{ id: ROOT_LEVEL_ID, kind: 'root' }]
|
|
1449
|
+
: levelDrafts(validated, g).drafts;
|
|
1450
|
+
return drafts.map((d) => {
|
|
1451
|
+
const ownerId = levelOwnerId(d);
|
|
1452
|
+
return { levelId: d.id, kind: d.kind, ...(ownerId !== undefined ? { ownerId } : {}) };
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
/** 배치 전 레벨 초안. root가 맨 앞이고 나머지는 id 순이다 */
|
|
1456
|
+
function levelDrafts(validated, g) {
|
|
1131
1457
|
const sorted = [...g.nodeById.values()].sort(byId);
|
|
1132
|
-
const bands = bandGroupsOf(validated.ir);
|
|
1133
1458
|
const apps = indexMicroApps(sorted, g.edges);
|
|
1134
1459
|
const tree = irVocabulary(validated.ir).drilldown === 'tree' ? groupDrafts(g) : undefined;
|
|
1135
1460
|
const drafts = tree?.drafts ?? [rootLevel(g, apps)];
|
|
@@ -1189,7 +1514,7 @@ export async function computeDrilldown(validated) {
|
|
|
1189
1514
|
rootLane: 'service',
|
|
1190
1515
|
loads: [],
|
|
1191
1516
|
});
|
|
1192
|
-
drafts.push(level);
|
|
1517
|
+
drafts.push(withOutsideContext(g, level, n.id));
|
|
1193
1518
|
enter[n.id] = level.id;
|
|
1194
1519
|
if (entry !== undefined)
|
|
1195
1520
|
enter[entry.id] = level.id;
|
|
@@ -1211,7 +1536,7 @@ export async function computeDrilldown(validated) {
|
|
|
1211
1536
|
enter[n.id] = level.id;
|
|
1212
1537
|
}
|
|
1213
1538
|
else if (n.kind === 'gateway' || n.kind === 'app_module') {
|
|
1214
|
-
const level = serverLevel(g, n);
|
|
1539
|
+
const level = withOutsideContext(g, serverLevel(g, n), n.id);
|
|
1215
1540
|
drafts.push(level);
|
|
1216
1541
|
enter[n.id] = level.id;
|
|
1217
1542
|
}
|
|
@@ -1224,14 +1549,78 @@ export async function computeDrilldown(validated) {
|
|
|
1224
1549
|
enter[n.id] = level.id;
|
|
1225
1550
|
}
|
|
1226
1551
|
}
|
|
1227
|
-
const [
|
|
1228
|
-
|
|
1552
|
+
const [first, ...rest] = drafts;
|
|
1553
|
+
if (tree !== undefined)
|
|
1554
|
+
return { drafts: [first, ...rest.sort(byId)], enter };
|
|
1555
|
+
const { root, lanes } = collapseRoot(g, first, assignStages(validated.ir));
|
|
1556
|
+
return { drafts: [root, ...[...rest, ...lanes].sort(byId)], enter };
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* 카드 id → 그 카드를 눌러 들어갈 레벨에 선 카드 수. 카드 자신과 바깥 맥락은 빼고 센다.
|
|
1560
|
+
* 배치 전 초안과 배치 뒤 레벨 양쪽에서 같은 값이 나와야 잰 카드 높이와 그린 칩 줄이 맞는다. 인프라 레벨은 타일 그림이라 세지 않는다
|
|
1561
|
+
*/
|
|
1562
|
+
export function innerCounts(levels, enter) {
|
|
1563
|
+
const byLevel = new Map(levels.map((l) => [l.id, l]));
|
|
1564
|
+
const out = {};
|
|
1565
|
+
for (const nodeId of Object.keys(enter).sort(compareStr)) {
|
|
1566
|
+
const l = byLevel.get(enter[nodeId]);
|
|
1567
|
+
if (l === undefined || l.kind === 'infra')
|
|
1568
|
+
continue;
|
|
1569
|
+
const outside = new Set([...(l.outside?.from ?? []), ...(l.outside?.to ?? [])]);
|
|
1570
|
+
const n = l.nodeIds.filter((id) => id !== nodeId && !outside.has(id)).length;
|
|
1571
|
+
if (n > 0)
|
|
1572
|
+
out[nodeId] = n;
|
|
1573
|
+
}
|
|
1574
|
+
return out;
|
|
1575
|
+
}
|
|
1576
|
+
/** 접힌 root. 덩어리 카드를 레인 순번대로 왼쪽부터 세우고 레인 띠는 그리지 않는다. 덩어리 카드가 곧 레인이라서다 */
|
|
1577
|
+
async function chunkRootLevel(validated, g, d, chunks) {
|
|
1578
|
+
const laid = await computeGraphLayout(chunks.map((c) => ({
|
|
1579
|
+
id: c.id,
|
|
1580
|
+
label: c.title,
|
|
1581
|
+
rank: c.order,
|
|
1582
|
+
lane: 'service',
|
|
1583
|
+
size: { width: CHUNK_CARD_W, height: CHUNK_CARD_H },
|
|
1584
|
+
})), d.edges, undefined, { betweenLayers: CHUNK_LAYER_GAP, node: DRILL_NODE_GAP });
|
|
1585
|
+
const summary = levelSummary(validated, g, d);
|
|
1586
|
+
return {
|
|
1587
|
+
id: d.id,
|
|
1588
|
+
kind: d.kind,
|
|
1589
|
+
title: d.title,
|
|
1590
|
+
...(summary !== undefined ? { summary } : {}),
|
|
1591
|
+
trail: d.trail,
|
|
1592
|
+
nodeIds: [],
|
|
1593
|
+
edges: d.edges,
|
|
1594
|
+
layout: { ...laid, lanes: [] },
|
|
1595
|
+
chunks: [...chunks],
|
|
1596
|
+
...(d.flatEdges !== undefined ? { flatEdges: d.flatEdges } : {}),
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
export async function computeDrilldown(validated) {
|
|
1600
|
+
const g = buildGraph(validated);
|
|
1601
|
+
const flatIds = flatInfraIds(validated, g);
|
|
1602
|
+
if (flatIds !== undefined)
|
|
1603
|
+
return flatRootWithInfra(validated, g, flatIds);
|
|
1604
|
+
const facts = computeServiceFacts([...g.nodeById.values()], g.edges);
|
|
1605
|
+
const bands = bandGroupsOf(validated.ir);
|
|
1606
|
+
const { drafts: ordered, enter } = levelDrafts(validated, g);
|
|
1229
1607
|
const levels = [];
|
|
1230
1608
|
const staged = assignStages(validated.ir);
|
|
1231
1609
|
const flowLevels = computeFlowLevels(validated);
|
|
1232
1610
|
const flowCount = flowCountByService(flowLevels);
|
|
1611
|
+
const inner = innerCounts(ordered.map((d) => ({
|
|
1612
|
+
id: d.id,
|
|
1613
|
+
kind: d.kind,
|
|
1614
|
+
nodeIds: [...d.nodeIds].filter((id) => g.nodeById.has(id)),
|
|
1615
|
+
...(d.outside !== undefined ? { outside: d.outside } : {}),
|
|
1616
|
+
})), enter);
|
|
1233
1617
|
for (const d of ordered) {
|
|
1618
|
+
if (d.chunks !== undefined) {
|
|
1619
|
+
levels.push(await chunkRootLevel(validated, g, d, d.chunks));
|
|
1620
|
+
continue;
|
|
1621
|
+
}
|
|
1234
1622
|
const nodeIds = [...d.nodeIds].filter((id) => g.nodeById.has(id)).sort(compareStr);
|
|
1623
|
+
const outsideRank = d.outside !== undefined ? outsideRanks(g, d, d.outside, staged?.indexOf) : undefined;
|
|
1235
1624
|
const layoutNodes = nodeIds.map((id) => {
|
|
1236
1625
|
const node = g.nodeById.get(id);
|
|
1237
1626
|
const f = facts.get(id);
|
|
@@ -1240,9 +1629,12 @@ export async function computeDrilldown(validated) {
|
|
|
1240
1629
|
label: node.label,
|
|
1241
1630
|
...(node.displayName !== undefined ? { displayName: node.displayName } : {}),
|
|
1242
1631
|
...(node.displayNameInferred ? { displayNameInferred: true } : {}),
|
|
1243
|
-
rank: d.rankOverride?.get(id) ?? PARTITION_RANK[node.kind],
|
|
1632
|
+
rank: outsideRank?.get(id) ?? d.rankOverride?.get(id) ?? PARTITION_RANK[node.kind],
|
|
1244
1633
|
lane: d.laneOverride?.get(id) ?? d.laneOfKind?.[node.kind] ?? laneOfNode(node),
|
|
1245
|
-
|
|
1634
|
+
// 바깥 카드에 구간을 붙이면 layout.ts가 구간 레인으로 옮겨 맨 왼쪽과 맨 오른쪽 자리를 잃는다
|
|
1635
|
+
...(staged !== undefined && !outsideRank?.has(id)
|
|
1636
|
+
? { stage: staged.indexOf.get(id) }
|
|
1637
|
+
: {}),
|
|
1246
1638
|
kind: displayKindOf(node),
|
|
1247
1639
|
...(chipTextOverride(node) !== undefined ? { chip: chipTextOverride(node) } : {}),
|
|
1248
1640
|
...(d.orderOverride?.has(id)
|
|
@@ -1255,9 +1647,23 @@ export async function computeDrilldown(validated) {
|
|
|
1255
1647
|
...(f?.prodDomain !== undefined ? { secondLine: f.prodDomain } : {}),
|
|
1256
1648
|
...(flowCount[id] !== undefined ? { flows: flowCount[id] } : {}),
|
|
1257
1649
|
...(node.description !== undefined ? { description: node.description } : {}),
|
|
1650
|
+
size: outsideRank?.has(id)
|
|
1651
|
+
? measurePill(node.label, node.displayName, displayKindOf(node), chipTextOverride(node))
|
|
1652
|
+
: measureCard(node.label, node.displayName, node.displayNameInferred, displayKindOf(node), {
|
|
1653
|
+
...(chipTextOverride(node) !== undefined ? { chip: chipTextOverride(node) } : {}),
|
|
1654
|
+
...(f !== undefined && f.platforms.length > 0 ? { platforms: f.platforms } : {}),
|
|
1655
|
+
...(f?.webHosting !== undefined ? { webHosting: f.webHosting } : {}),
|
|
1656
|
+
...(f?.prodDomain !== undefined ? { secondLine: f.prodDomain } : {}),
|
|
1657
|
+
...(flowCount[id] !== undefined ? { flows: flowCount[id] } : {}),
|
|
1658
|
+
...(node.description !== undefined ? { description: node.description } : {}),
|
|
1659
|
+
...(inner[id] !== undefined ? { inner: inner[id] } : {}),
|
|
1660
|
+
}),
|
|
1258
1661
|
};
|
|
1259
1662
|
});
|
|
1260
|
-
const laid = await computeGraphLayout(layoutNodes, d.edges, staged?.labels
|
|
1663
|
+
const laid = await computeGraphLayout(layoutNodes, d.edges, staged?.labels, {
|
|
1664
|
+
betweenLayers: DRILL_LAYER_GAP,
|
|
1665
|
+
node: DRILL_NODE_GAP,
|
|
1666
|
+
});
|
|
1261
1667
|
const pinned = d.pinTop !== undefined ? pinToColumnTop(laid, d.pinTop) : laid;
|
|
1262
1668
|
const treed = d.tree !== undefined ? stackTree(pinned, treeOrder(pinned, d.tree)) : pinned;
|
|
1263
1669
|
const aligned = d.pinTop !== undefined && d.alignToPin !== undefined
|
|
@@ -1269,14 +1675,17 @@ export async function computeDrilldown(validated) {
|
|
|
1269
1675
|
const banded = stackBands(liftColumns(grouped), bands, validated.ir.edges, d.groups);
|
|
1270
1676
|
const rects = d.frames !== undefined ? frameRects(banded, d.frames) : banded;
|
|
1271
1677
|
const layout = d.groups !== undefined ? groupRects(rects, d.groups) : rects;
|
|
1678
|
+
const summary = levelSummary(validated, g, d);
|
|
1272
1679
|
levels.push({
|
|
1273
1680
|
id: d.id,
|
|
1274
1681
|
kind: d.kind,
|
|
1275
1682
|
...(d.focusId !== undefined ? { focusId: d.focusId } : {}),
|
|
1276
1683
|
title: d.title,
|
|
1684
|
+
...(summary !== undefined ? { summary } : {}),
|
|
1277
1685
|
trail: d.trail,
|
|
1278
1686
|
nodeIds,
|
|
1279
1687
|
edges: d.edges,
|
|
1688
|
+
...(d.outside !== undefined ? { outside: d.outside } : {}),
|
|
1280
1689
|
layout,
|
|
1281
1690
|
});
|
|
1282
1691
|
}
|