Add flowchart.diagramPadding config option

This option lets you customise the padding around the whole flowchart.
It is equivalent to `er.diagramPadding` and defaults to 8px for
backwards compatibility with the current hardcoded value.
This commit is contained in:
Ryan Ling
2020-07-11 16:54:00 +10:00
parent c390e9e877
commit 5da4ced8c1
7 changed files with 61 additions and 4 deletions

View File

@@ -381,7 +381,7 @@ export const draw = function(text, id) {
return flowDb.getTooltip(this.id);
});
const padding = 8;
const padding = conf.diagramPadding;
const svgBounds = svg.node().getBBox();
const width = svgBounds.width + padding * 2;
const height = svgBounds.height + padding * 2;