From b134766647a9dea0866a8a704f62071ab0dab0e5 Mon Sep 17 00:00:00 2001 From: Matheus B Date: Fri, 10 Nov 2023 21:22:31 -0300 Subject: [PATCH] Add subgraph title margin config options to schema. --- packages/mermaid/src/config.type.ts | 8 ++++++++ packages/mermaid/src/schemas/config.schema.yaml | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/packages/mermaid/src/config.type.ts b/packages/mermaid/src/config.type.ts index 82d5e1d00..402d9a4d8 100644 --- a/packages/mermaid/src/config.type.ts +++ b/packages/mermaid/src/config.type.ts @@ -1411,6 +1411,14 @@ export interface FlowchartDiagramConfig extends BaseDiagramConfig { * Margin top for the text over the diagram */ titleTopMargin?: number; + /** + * Defines a top/bottom margin for subgraph titles + * + */ + subGraphTitleMargin?: { + top?: number; + bottom?: number; + }; arrowMarkerAbsolute?: boolean; /** * The amount of padding around the diagram as a whole so that embedded diff --git a/packages/mermaid/src/schemas/config.schema.yaml b/packages/mermaid/src/schemas/config.schema.yaml index ee92b4875..2791c32d4 100644 --- a/packages/mermaid/src/schemas/config.schema.yaml +++ b/packages/mermaid/src/schemas/config.schema.yaml @@ -1863,6 +1863,7 @@ $defs: # JSON Schema definition (maybe we should move these to a separate file) unevaluatedProperties: false required: - titleTopMargin + - subGraphTitleMargin - diagramPadding - htmlLabels - nodeSpacing @@ -1875,6 +1876,20 @@ $defs: # JSON Schema definition (maybe we should move these to a separate file) titleTopMargin: $ref: '#/$defs/GitGraphDiagramConfig/properties/titleTopMargin' default: 25 + subGraphTitleMargin: + description: | + Defines a top/bottom margin for subgraph titles + type: object + properties: + top: + type: integer + minimum: 0 + bottom: + type: integer + minimum: 0 + default: + top: 0 + bottom: 0 arrowMarkerAbsolute: type: boolean # TODO, is this actually used here (it has no default value but was in types) diagramPadding: