#1152 add node spacing to flowchart configuration

This commit is contained in:
Marc Faber
2020-01-05 22:03:53 +01:00
parent 37ae863443
commit b3934c9788
3 changed files with 46 additions and 4 deletions

View File

@@ -291,6 +291,10 @@ export const draw = function(text, id) {
dir = 'TD';
}
const conf = getConfig().flowchart;
const nodeSpacing = conf.nodeSpacing || 50;
const rankSpacing = conf.rankSpacing || 50;
// Create the input mermaid.graph
let g;
// Todo remove newDagreD3 when properly verified
@@ -301,6 +305,8 @@ export const draw = function(text, id) {
})
.setGraph({
rankdir: dir,
nodesep: nodeSpacing,
ranksep: rankSpacing,
marginx: 8,
marginy: 8
})
@@ -314,6 +320,8 @@ export const draw = function(text, id) {
})
.setGraph({
rankdir: dir,
nodesep: nodeSpacing,
ranksep: rankSpacing,
marginx: 20,
marginy: 20
})
@@ -403,7 +411,6 @@ export const draw = function(text, id) {
return flowDb.getTooltip(this.id);
});
const conf = getConfig().flowchart;
const padding = 8;
// Todo remove newDagreD3 when properly verified
if (newDagreD3) {