@eventcatalog/core 5.9.1 → 5.10.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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-3PWCUWQC.js → chunk-5QOG7UYZ.js} +1 -1
- package/dist/{chunk-KGFAIGOT.js → chunk-EETSYUKN.js} +1 -1
- package/dist/{chunk-A3256YCN.js → chunk-EGOTM5ZG.js} +1 -1
- package/dist/{chunk-YBM7MCOY.js → chunk-EXBUNFIM.js} +1 -1
- package/dist/{chunk-JDSFD7IC.js → chunk-ZE2RPUNY.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/development/guides/resources/entities/05-entity-maps.md +5 -0
- package/dist/docs/development/guides/resources/entities/06-global-entity-map.md +101 -0
- package/dist/docs/development/guides/resources/entities/{06-reference.md → 07-reference.md} +2 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +8 -8
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/MDX/EntityMap/CatalogEntityMap.tsx +301 -0
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +61 -61
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +72 -72
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +1 -1
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +2 -2
- package/eventcatalog/src/features/studio/pages/webmcp-relay.ts +1 -1
- package/eventcatalog/src/features/studio/webmcp-relay/README.md +1 -1
- package/eventcatalog/src/features/studio/webmcp-relay/embed.js +1 -2
- package/eventcatalog/src/features/studio/webmcp-relay/widget.html +2 -1
- package/eventcatalog/src/features/studio/webmcp-relay/widget.js +2 -1
- package/eventcatalog/src/pages/visualiser/entity-map/index.astro +47 -0
- package/eventcatalog/src/pages/visualiser/graph/index.astro +2 -2
- package/eventcatalog/src/stores/sidebar-store/state.ts +10 -1
- package/eventcatalog/src/utils/node-graphs/catalog-entity-map-view.ts +82 -0
- package/eventcatalog/src/utils/node-graphs/catalog-entity-map.ts +113 -0
- package/eventcatalog/src/utils/node-graphs/domain-entity-map.ts +17 -61
- package/eventcatalog/src/utils/node-graphs/entity-layout.ts +53 -0
- package/eventcatalog/src/utils/node-graphs/flow-lanes.ts +2 -2
- package/package.json +5 -5
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How entity maps are laid out: ELK's force layout, each entity sized by how many properties it has.
|
|
3
|
+
* Kept apart from the graph builders (which read the catalog's collections), so the catalog's entity
|
|
4
|
+
* map can lay out what it shows in the browser the same way.
|
|
5
|
+
*/
|
|
6
|
+
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
7
|
+
import { getNodeSize } from '@eventcatalog/visualiser/layout';
|
|
8
|
+
|
|
9
|
+
const elk = new ELK();
|
|
10
|
+
|
|
11
|
+
/** Places entities with ELK's force layout, sized by how many properties they have */
|
|
12
|
+
export const layoutEntityNodes = async (nodes: any[], edges: any[]) => {
|
|
13
|
+
// Prepare ELK graph structure
|
|
14
|
+
// Sized as the visualiser estimates them (a row for each property), so the catalog and the browser agree
|
|
15
|
+
const elkNodes = nodes.map((node: any) => ({ id: node.id, ...getNodeSize(node) }));
|
|
16
|
+
|
|
17
|
+
const elkEdges = edges.map((edge: any) => ({
|
|
18
|
+
id: edge.id,
|
|
19
|
+
sources: [edge.source],
|
|
20
|
+
targets: [edge.target],
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
const elkGraph = {
|
|
24
|
+
id: 'root',
|
|
25
|
+
layoutOptions: {
|
|
26
|
+
'elk.algorithm': 'force',
|
|
27
|
+
'elk.force.iterations': '300',
|
|
28
|
+
'elk.spacing.nodeNode': '45',
|
|
29
|
+
'elk.spacing.componentComponent': '50',
|
|
30
|
+
'elk.padding': '[top=30,left=30,bottom=30,right=30]',
|
|
31
|
+
'elk.separateConnectedComponents': 'true',
|
|
32
|
+
},
|
|
33
|
+
children: elkNodes,
|
|
34
|
+
edges: elkEdges,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Run ELK layout
|
|
38
|
+
const layoutedGraph = await elk.layout(elkGraph);
|
|
39
|
+
|
|
40
|
+
// Apply positions to nodes
|
|
41
|
+
const positionedNodes = nodes.map((node: any) => {
|
|
42
|
+
const elkNode = layoutedGraph.children?.find((n: any) => n.id === node.id);
|
|
43
|
+
return {
|
|
44
|
+
...node,
|
|
45
|
+
position: {
|
|
46
|
+
x: elkNode?.x || 0,
|
|
47
|
+
y: elkNode?.y || 0,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return positionedNodes;
|
|
53
|
+
};
|
|
@@ -30,8 +30,8 @@ type Resource = { data: { id: string; name?: string; owners?: (string | { id: st
|
|
|
30
30
|
|
|
31
31
|
// Lanes use the latest version of each domain and system (as the collection
|
|
32
32
|
// utils do when they don't ask for every version)
|
|
33
|
-
const isLatest = (entry: { filePath?: string }) => !entry.filePath?.includes('versioned');
|
|
34
|
-
const toLane = (entry: Resource): Lane => ({ id: entry.data.id, name: entry.data.name || entry.data.id });
|
|
33
|
+
export const isLatest = (entry: { filePath?: string }) => !entry.filePath?.includes('versioned');
|
|
34
|
+
export const toLane = (entry: Resource): Lane => ({ id: entry.data.id, name: entry.data.name || entry.data.id });
|
|
35
35
|
const pointerIds = (pointers?: { id: string }[]) => (pointers || []).map((pointer) => pointer.id);
|
|
36
36
|
|
|
37
37
|
/**
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "5.
|
|
10
|
+
"version": "5.10.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@hocuspocus/provider": "^4.7.0",
|
|
64
64
|
"@hocuspocus/server": "^4.7.0",
|
|
65
65
|
"@iconify-json/logos": "^1.2.4",
|
|
66
|
-
"@mcp-b/webmcp-polyfill": "
|
|
66
|
+
"@mcp-b/webmcp-polyfill": "6.0.3",
|
|
67
67
|
"@mermaid-js/layout-elk": "^0.2.0",
|
|
68
68
|
"@modelcontextprotocol/client": "2.3.1",
|
|
69
69
|
"@modelcontextprotocol/ext-apps": "2.0.3",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"diff2html": "^3.4.56",
|
|
96
96
|
"dotenv": "^16.5.0",
|
|
97
97
|
"elkjs": "^0.10.0",
|
|
98
|
-
"glob": "^13.0.
|
|
98
|
+
"glob": "^13.0.7",
|
|
99
99
|
"gray-matter": "^4.0.3",
|
|
100
100
|
"hono": "^4.13.7",
|
|
101
101
|
"html-to-image": "^1.11.11",
|
|
@@ -143,9 +143,9 @@
|
|
|
143
143
|
"zod": "^4.6.6",
|
|
144
144
|
"@eventcatalog/exporters": "0.1.4",
|
|
145
145
|
"@eventcatalog/fitness": "0.1.1",
|
|
146
|
+
"@eventcatalog/linter": "1.3.1",
|
|
146
147
|
"@eventcatalog/sdk": "2.32.0",
|
|
147
|
-
"@eventcatalog/visualiser": "^5.
|
|
148
|
-
"@eventcatalog/linter": "1.3.1"
|
|
148
|
+
"@eventcatalog/visualiser": "^5.3.0"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
151
|
"@astrojs/check": "^0.9.10",
|