fix: use nested mindmap config for padding and maxWidth

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-09-02 20:22:00 +05:30
parent 404fdaf2ff
commit 133d46bde2
2 changed files with 2 additions and 4 deletions

View File

@@ -214,8 +214,6 @@ export interface MermaidConfig {
wrap?: boolean; wrap?: boolean;
fontSize?: number; fontSize?: number;
markdownAutoWrap?: boolean; markdownAutoWrap?: boolean;
padding?: number;
useMaxWidth?: boolean;
/** /**
* Suppresses inserting 'Syntax error' diagram in the DOM. * Suppresses inserting 'Syntax error' diagram in the DOM.
* This is useful when you want to control how to handle syntax errors in your application. * This is useful when you want to control how to handle syntax errors in your application.

View File

@@ -75,9 +75,9 @@ export const draw: DrawDefinition = async (text, id, _version, diagObj) => {
// Setup the view box and size of the svg element using config from data4Layout // Setup the view box and size of the svg element using config from data4Layout
setupViewPortForSVG( setupViewPortForSVG(
svg, svg,
data4Layout.config.padding ?? defaultConfig.mindmap.padding, data4Layout.config.mindmap?.padding ?? defaultConfig.mindmap.padding,
'mindmapDiagram', 'mindmapDiagram',
data4Layout.config.useMaxWidth ?? defaultConfig.mindmap.useMaxWidth data4Layout.config.mindmap?.useMaxWidth ?? defaultConfig.mindmap.useMaxWidth
); );
}; };