fix: resolve TypeScript errors in mermaid-layout-elk

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-09-04 14:57:24 +05:30
parent f81e63663c
commit 0dd46a3543

View File

@@ -1,10 +1,4 @@
import type { import type { InternalHelpers, LayoutData, RenderOptions, SVG, SVGGroup } from 'mermaid';
InternalHelpers,
LayoutData,
RenderOptions,
SVG,
SVGGroup,
} from '@mermaid-chart/mermaid';
// @ts-ignore TODO: Investigate D3 issue // @ts-ignore TODO: Investigate D3 issue
import { curveLinear } from 'd3'; import { curveLinear } from 'd3';
import ELK from 'elkjs/lib/elk.bundled.js'; import ELK from 'elkjs/lib/elk.bundled.js';
@@ -78,6 +72,7 @@ export const render = async (
// A subgraph // A subgraph
const child: NodeWithVertex & { children: NodeWithVertex[] } = { const child: NodeWithVertex & { children: NodeWithVertex[] } = {
...node, ...node,
domId: undefined,
children: [], children: [],
}; };
// Let elk render with the copy // Let elk render with the copy
@@ -900,7 +895,7 @@ export const render = async (
'elk.separateConnectedComponents': true, 'elk.separateConnectedComponents': true,
'elk.alg.layered.options.EdgeStraighteningStrategy': 'NONE', 'elk.alg.layered.options.EdgeStraighteningStrategy': 'NONE',
// 'elk.layered.considerModelOrder.strategy': 'NODES_AND_EDGES', // NODES_AND_EDGES // 'elk.layered.considerModelOrder.strategy': 'NODES_AND_EDGES', // NODES_AND_EDGES
'elk.layered.considerModelOrder.strategy': 'EDGES', // NODES_AND_EDGES // 'elk.layered.considerModelOrder.strategy': 'EDGES', // NODES_AND_EDGES
'elk.layered.wrapping.cutting.strategy': 'ARD', // NODES_AND_EDGES 'elk.layered.wrapping.cutting.strategy': 'ARD', // NODES_AND_EDGES
}, },
children: [], children: [],