forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a9452c
commit 028ff78
Showing
9 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
diff --git a/datahub-web-react/src/app/lineage/utils/layoutTree.ts b/datahub-web-react/src/app/lineage/utils/layoutTree.ts | ||
index cc70400704..4d34103b9d 100644 | ||
--- a/datahub-web-react/src/app/lineage/utils/layoutTree.ts | ||
+++ b/datahub-web-react/src/app/lineage/utils/layoutTree.ts | ||
@@ -32,6 +32,20 @@ function getParentRelationship(direction: Direction, parent: VizNode | null, nod | ||
return directionRelationships?.find((r) => r?.entity?.urn === node?.urn); | ||
} | ||
|
||
+function firstAppearanceIndices(arr) { | ||
+ const seen = new Set(); // To track which strings have been seen | ||
+ const result = [] as number[]; | ||
+ | ||
+ for (let i = 0; i < arr.length; i++) { | ||
+ if (!seen.has(arr[i])) { | ||
+ seen.add(arr[i]); // Add the string to the set | ||
+ result.push(i); // Save the index | ||
+ } | ||
+ } | ||
+ | ||
+ return result; | ||
+} | ||
+ | ||
function layoutNodesForOneDirection( | ||
data: NodeData, | ||
direction: Direction, | ||
@@ -54,12 +68,10 @@ function layoutNodesForOneDirection( | ||
while (nodesInCurrentLayer.length > 0) { | ||
// if we've already added a node to the viz higher up dont add it again | ||
const urnsToAddInCurrentLayer = Array.from(new Set(nodesInCurrentLayer.map(({ node }) => node.urn || ''))); | ||
- const nodesToAddInCurrentLayer = urnsToAddInCurrentLayer | ||
- .filter((urn, pos) => urnsToAddInCurrentLayer.indexOf(urn) === pos) | ||
- .filter((urn) => !nodesByUrn[urn || '']); | ||
+ const positionsToAddInCurrentLayer = firstAppearanceIndices(urnsToAddInCurrentLayer); | ||
|
||
const filteredNodesInCurrentLayer = nodesInCurrentLayer | ||
- .filter(({ node }) => nodesToAddInCurrentLayer.indexOf(node.urn || '') > -1) | ||
+ .filter((_, idx) => positionsToAddInCurrentLayer.indexOf(idx) > -1) | ||
.filter(({ node }) => node.status?.removed !== true); | ||
|
||
const layerSize = filteredNodesInCurrentLayer.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,9 @@ query getChart($urn: String!) { | |
canEditLineage | ||
canEditEmbed | ||
} | ||
subTypes { | ||
typeNames | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters