mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 16:29:40 +02:00
infer svg height, width from # of nodes
This commit is contained in:
@@ -266,6 +266,13 @@ exports.draw = function(txt, id, ver) {
|
|||||||
renderLines(svg, v.commit, direction);
|
renderLines(svg, v.commit, direction);
|
||||||
branchNum++;
|
branchNum++;
|
||||||
});
|
});
|
||||||
|
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;
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error('Error while rendering gitgraph');
|
log.error('Error while rendering gitgraph');
|
||||||
log.error(e.message);
|
log.error(e.message);
|
||||||
|
Reference in New Issue
Block a user