mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +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);
|
||||
branchNum++;
|
||||
renderCommitHistory(svg, commitid[1], branches, direction);
|
||||
branchNum--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,11 +269,12 @@ exports.draw = function(txt, id, ver) {
|
||||
});
|
||||
svg.attr('height', function() {
|
||||
if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
||||
return branches.length * config.branchOffset;
|
||||
});
|
||||
svg.attr('width', function() {
|
||||
return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
||||
return (branches.length + 1) * config.branchOffset;
|
||||
});
|
||||
//svg.attr('width', function() {
|
||||
//if (direction === 'LR') return Object.keys(allCommitsDict).length * config.nodeSpacing + config.leftMargin;
|
||||
//return (branches.length + 1) * config.branchOffset;
|
||||
//});
|
||||
} catch (e) {
|
||||
log.error('Error while rendering gitgraph');
|
||||
log.error(e.message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user