diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts index 28772adf99b4..db3b9ffc2aaf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts @@ -117,17 +117,10 @@ export const getELKLayoutedElements = async ( const nodeHeight = getNodeHeight(node, isColumnOnlyFilterActive, columns); - const nodeDepth = node.data?.nodeDepth; - return { id: node.id, width: NODE_WIDTH, height: nodeHeight, - ...(nodeDepth !== undefined && { - layoutOptions: { - 'elk.partitioning.partition': String(nodeDepth), - }, - }), }; }); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.test.ts index f73166935636..59dcfb6ac202 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.test.ts @@ -32,8 +32,8 @@ describe('ELKLayout', () => { 'elk.direction': 'RIGHT', 'elk.spacing.nodeNode': '80', 'elk.layered.spacing.nodeNodeBetweenLayers': '200', - 'elk.layered.nodePlacement.strategy': 'SIMPLE', - 'elk.partitioning.activate': 'true', + 'elk.layered.nodePlacement.strategy': 'BRANDES_KOEPF', + 'elk.layered.nodePlacement.bk.fixedAlignment': 'BALANCED', }); }); @@ -344,13 +344,18 @@ describe('ELKLayout', () => { ).toBe('200'); }); - it('uses simple node placement strategy', () => { + it('uses brandes-koepf node placement with balanced alignment', () => { expect(ELKLayout.layoutOptions['elk.layered.nodePlacement.strategy']).toBe( - 'SIMPLE' + 'BRANDES_KOEPF' ); + expect( + ELKLayout.layoutOptions['elk.layered.nodePlacement.bk.fixedAlignment'] + ).toBe('BALANCED'); }); - it('activates partitioning', () => { - expect(ELKLayout.layoutOptions['elk.partitioning.activate']).toBe('true'); + it('does not activate partitioning so ELK derives layers from edges', () => { + expect( + ELKLayout.layoutOptions['elk.partitioning.activate'] + ).toBeUndefined(); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.ts b/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.ts index f61d077b008b..130d2b4c5366 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.ts @@ -24,8 +24,15 @@ class ELKLayout { 'elk.direction': 'RIGHT', 'elk.spacing.nodeNode': '80', 'elk.layered.spacing.nodeNodeBetweenLayers': '200', - 'elk.layered.nodePlacement.strategy': 'SIMPLE', - 'elk.partitioning.activate': 'true', + // Let ELK derive layers from edge topology instead of pinning nodes to a + // backend-provided nodeDepth. Partitioning forced a multi-branch node into + // the column of its first depth, misaligning its other edges. + 'elk.layered.nodePlacement.strategy': 'BRANDES_KOEPF', + // BALANCED averages Brandes-Köpf's four extreme alignments into a centroid. + // Without it, a symmetric source (e.g. equal upstream/downstream branches) + // has multiple optimal placements and ELK snaps to a top-aligned corner + // instead of sitting vertically centered between its neighbors. + 'elk.layered.nodePlacement.bk.fixedAlignment': 'BALANCED', }; constructor() {}