Skip to content

Commit

Permalink
Fix for direction issue with elk rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Feb 15, 2023
1 parent aef989f commit 343e483
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ const getNextPosition = (position, edgeDirection, graphDirection) => {
},
},
};
portPos.TD = portPos.TB;
log.info('abc88', graphDirection, edgeDirection, position);
return portPos[graphDirection][edgeDirection][position];
// return 'south';
Expand All @@ -323,6 +324,7 @@ const getNextPort = (node, edgeDirection, graphDirection) => {
if (!portPos[node]) {
switch (graphDirection) {
case 'TB':
case 'TD':
portPos[node] = {
inPosition: 'north',
outPosition: 'south',
Expand Down
3 changes: 3 additions & 0 deletions packages/mermaid/src/diagrams/flowchart/flowDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ export const setDirection = function (dir) {
if (direction.match(/.*v/)) {
direction = 'TB';
}
if (direction === 'TD') {
direction = 'TB';
}
};

/**
Expand Down

0 comments on commit 343e483

Please sign in to comment.