Skip to content

Commit d33bdbb

Browse files
authored
Merge pull request #48 from Fszta/fix/lineage-fix-exposures-edges-alignment
fix(lineage): align exposure edges horizontally with model edges
2 parents 3721929 + 38fed02 commit d33bdbb

File tree

1 file changed

+11
-4
lines changed
  • dbt_column_lineage/lineage/display/html/static/js

1 file changed

+11
-4
lines changed

dbt_column_lineage/lineage/display/html/static/js/utils.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,18 @@ function createExposureEdgePath(d, state, config) {
129129
let sourceX, sourceY, targetX, targetY;
130130

131131
if (sourceNode.type === 'column') {
132+
const sourceModelName = sourceNode.model;
133+
const sourceModel = state.models.find(m => m && m.name === sourceModelName);
134+
if (!sourceModel) return '';
135+
132136
const sourcePos = state.columnPositions.get(d.source);
133137
if (!sourcePos || typeof sourcePos.x !== 'number' || isNaN(sourcePos.x) ||
134138
typeof sourcePos.y !== 'number' || isNaN(sourcePos.y)) return '';
135-
sourceX = sourcePos.x;
136-
sourceY = sourcePos.y;
139+
140+
sourceX = sourceModel.x + config.box.width - config.box.padding;
141+
sourceY = sourceModel.columnsCollapsed
142+
? sourceModel.y - sourceModel.height/2 + config.box.titleHeight + 14
143+
: sourcePos.y;
137144
} else {
138145
return '';
139146
}
@@ -143,8 +150,8 @@ function createExposureEdgePath(d, state, config) {
143150
if (!exposure || typeof exposure.x !== 'number' || isNaN(exposure.x) ||
144151
typeof exposure.y !== 'number' || isNaN(exposure.y) ||
145152
typeof exposure.height !== 'number' || isNaN(exposure.height)) return '';
146-
targetX = exposure.x + config.box.width / 2;
147-
targetY = exposure.y - exposure.height / 2;
153+
targetX = exposure.x + config.box.padding;
154+
targetY = exposure.y;
148155
} else {
149156
return '';
150157
}

0 commit comments

Comments
 (0)