mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 19:24:10 +01:00
GitGraph: simplified branch check in arrow rerouting fn
Wanted to avoid repetition given that the originally nested ternaries had the same structure
This commit is contained in:
@@ -359,12 +359,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
* return true
|
* return true
|
||||||
*/
|
*/
|
||||||
const shouldRerouteArrow = (commitA, commitB, p1, p2, allCommits) => {
|
const shouldRerouteArrow = (commitA, commitB, p1, p2, allCommits) => {
|
||||||
const branchToGetCurve =
|
const branchToGetCurve = (dir === 'TB' ? p1.x < p2.x : p1.y < p2.y)
|
||||||
dir === 'TB'
|
|
||||||
? p1.x < p2.x
|
|
||||||
? commitB.branch
|
|
||||||
: commitA.branch
|
|
||||||
: p1.y < p2.y
|
|
||||||
? commitB.branch
|
? commitB.branch
|
||||||
: commitA.branch;
|
: commitA.branch;
|
||||||
const isOnBranchToGetCurve = (x) => x.branch === branchToGetCurve;
|
const isOnBranchToGetCurve = (x) => x.branch === branchToGetCurve;
|
||||||
|
|||||||
Reference in New Issue
Block a user