Skip to content

Commit 6e750ff

Browse files
Dep edge fixes
1 parent 26f45e7 commit 6e750ff

5 files changed

Lines changed: 38 additions & 19 deletions

File tree

‎src/public/dist/bundle.js‎

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/public/dist/bundle.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/public/js/components/treeDiagram/component/Edge/CodeCrumbEdge.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const CodeCrumbedFlowEdge = props => {
8484
[targetPt.x, targetPt.y]
8585
];
8686
} else {
87-
const nLength = sourceName.length < 10 ? sourceName.length * SYMBOL_WIDTH + 6 : 30;
87+
const nLength = sourceName.length < 10 ? sourceName.length * SYMBOL_WIDTH + 8 : 100;
8888
polylinePoints = [
8989
[sourcePt.x, sourcePt.y],
9090
[sourcePt.x, sourcePt.y - padding],

‎src/public/js/components/treeDiagram/component/Edge/DepenenciesEdge.js‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,26 @@ const getConnectionLineToFirstSource = (
5151
const vPadding = (V_SPACE / 2) * directionY;
5252

5353
const directionLeft = [TOP_LEFT, BOTTOM_LEFT].includes(groupName);
54+
if (targetPosition.x !== firstSourcePosition.x) {
55+
return [
56+
[sourcePt.x, sourcePt.y],
57+
[sourcePt.x, sourcePosition.y + vPadding],
58+
[
59+
firstSourcePosition.x + (directionLeft ? V_SPACE : -HALF_PADDING),
60+
sourcePosition.y + vPadding
61+
],
62+
[
63+
firstSourcePosition.x + (directionLeft ? V_SPACE : -HALF_PADDING),
64+
targetPosition.y - vPadding + crossShift * directionY
65+
]
66+
];
67+
}
5468

69+
const xShift = 11 * (directionLeft ? -1 : 1);
5570
return [
5671
[sourcePt.x, sourcePt.y],
57-
[sourcePt.x, sourcePosition.y + vPadding],
58-
[
59-
firstSourcePosition.x + (directionLeft ? V_SPACE : -HALF_PADDING),
60-
sourcePosition.y + vPadding
61-
],
62-
[
63-
firstSourcePosition.x + (directionLeft ? V_SPACE : -HALF_PADDING),
64-
targetPosition.y - vPadding + crossShift * directionY
65-
]
72+
[sourcePt.x, targetPosition.y - vPadding + crossShift * directionY],
73+
[firstSourcePosition.x + xShift, targetPosition.y - vPadding + crossShift * directionY]
6674
];
6775
};
6876

@@ -127,11 +135,16 @@ export const DependenciesEdge = props => {
127135

128136
const getOverlappingConnectionLine = (groupName, targetPosition, sourcePosition) => {
129137
const directionY = [TOP_LEFT, TOP_RIGHT].includes(groupName) ? 1 : -1;
130-
const directionLeft = [TOP_LEFT, BOTTOM_LEFT].includes(groupName);
138+
const xShift =
139+
targetPosition.x !== sourcePosition.x
140+
? [TOP_LEFT, BOTTOM_LEFT].includes(groupName)
141+
? V_SPACE
142+
: -HALF_PADDING
143+
: 11;
131144

132145
return [
133146
[
134-
sourcePosition.x + (directionLeft ? V_SPACE : -HALF_PADDING),
147+
sourcePosition.x + xShift,
135148
targetPosition.y - (V_SPACE / 2) * directionY + crossShift * directionY
136149
],
137150
[targetPosition.x + 2, targetPosition.y - (V_SPACE / 2 - crossShift) * directionY],

‎src/public/js/components/treeDiagram/component/Node/CodeCrumb.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const CodeCrumbName = props => {
5858
/>
5959
<text
6060
x={textPoint.x - 11}
61-
y={textPoint.y + 4}
61+
y={textPoint.y + 3}
6262
onClick={onClick}
6363
className={'CodeCrumbName-flow'}
6464
>

0 commit comments

Comments
 (0)