mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
fix branching lines
This commit is contained in:
parent
6521cc81fe
commit
75c9debb5e
@ -218,6 +218,7 @@ function renderCommitHistory(svg, commitid, branches, direction) {
|
|||||||
renderCommitHistory(svg, commitid[0], branches, direction);
|
renderCommitHistory(svg, commitid[0], branches, direction);
|
||||||
branchNum++;
|
branchNum++;
|
||||||
renderCommitHistory(svg, commitid[1], branches, direction);
|
renderCommitHistory(svg, commitid[1], branches, direction);
|
||||||
|
branchNum--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,11 +269,12 @@ exports.draw = function(txt, id, ver) {
|
|||||||
});
|
});
|
||||||
svg.attr('height', function() {
|
svg.attr('height', function() {
|
||||||
if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
||||||
return branches.length * config.branchOffset;
|
return (branches.length + 1) * config.branchOffset;
|
||||||
});
|
|
||||||
svg.attr('width', function() {
|
|
||||||
return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
|
||||||
});
|
});
|
||||||
|
//svg.attr('width', function() {
|
||||||
|
//if (direction === 'LR') return Object.keys(allCommitsDict).length * config.nodeSpacing + config.leftMargin;
|
||||||
|
//return (branches.length + 1) * config.branchOffset;
|
||||||
|
//});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error('Error while rendering gitgraph');
|
log.error('Error while rendering gitgraph');
|
||||||
log.error(e.message);
|
log.error(e.message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user