You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of installing `@mermaid-js/layout-elk` as a separate package, we've integrated the essential code directly into the design system for the following reasons:
17
+
18
+
1.**Single ELK instance**: Uses our bundled `elkjs` 0.11.0 (compatible with the original 0.9.3)
19
+
2.**No duplication**: Console repo already has `elkjs` for react-flow layouts
20
+
3.**Simplicity**: Everything bundled together
21
+
4.**Full control**: Direct access to the sophisticated mermaid-specific ELK layout logic
22
+
23
+
## Files
24
+
25
+
-**`layouts.ts`**: ELK layout loader definitions for mermaid registration
26
+
-**`render.ts`**: Main rendering logic with mermaid-specific ELK optimizations (1090+ lines)
27
+
-**`geometry.ts`**: Node/edge intersection and boundary calculations
28
+
-**`find-common-ancestor.ts`**: Tree traversal utilities for subgraph handling
29
+
30
+
## Modifications
31
+
32
+
The code has been adapted to:
33
+
34
+
- Use our bundled `elkjs` 0.11.0 from the design system
35
+
- Follow our TypeScript and formatting conventions
36
+
- Remove package-specific build configurations
37
+
38
+
## Updates
39
+
40
+
This code is relatively stable. If updating to a newer version of `@mermaid-js/layout-elk`:
41
+
42
+
1. Download the new version's source
43
+
2. Copy the relevant files from `src/`
44
+
3. Ensure imports point to our bundled `elkjs`
45
+
4. Run formatting/linting to match our conventions
0 commit comments