From 4dd90e56b186d396bb5d230793ef34140e9b8091 Mon Sep 17 00:00:00 2001 From: Marc Faber Date: Sun, 12 Jan 2020 14:09:24 +0100 Subject: [PATCH] Add docs and default values for node spacing in mermaidAPI --- docs/mermaidAPI.md | 12 ++++++++++++ src/mermaidAPI.js | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/docs/mermaidAPI.md b/docs/mermaidAPI.md index ce11e5c58..e962ffc70 100644 --- a/docs/mermaidAPI.md +++ b/docs/mermaidAPI.md @@ -105,6 +105,18 @@ Flag for setting whether or not a html tag should be used for rendering labels on the edges. **Default value true**. +### nodeSpacing + +Defines the spacing between nodes on the same level (meaning horizontal spacing for +TB or BT graphs, and the vertical spacing for LR as well as RL graphs). +**Default value 50**. + +### rankSpacing + +Defines the spacing between nodes on different levels (meaning vertical spacing for +TB or BT graphs, and the horizontal spacing for LR as well as RL graphs). +**Default value 50**. + ### curve How mermaid renders curves for flowcharts. Possible values are diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js index 975b38299..5dfd11277 100644 --- a/src/mermaidAPI.js +++ b/src/mermaidAPI.js @@ -142,6 +142,20 @@ const config = { */ htmlLabels: true, + /** + * Defines the spacing between nodes on the same level (meaning horizontal spacing for + * TB or BT graphs, and the vertical spacing for LR as well as RL graphs). + * **Default value 50**. + */ + nodeSpacing: 50, + + /** + * Defines the spacing between nodes on different levels (meaning vertical spacing for + * TB or BT graphs, and the horizontal spacing for LR as well as RL graphs). + * **Default value 50**. + */ + rankSpacing: 50, + /** * How mermaid renders curves for flowcharts. Possible values are * * basis