diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js index 0b52b0360..71698a500 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js @@ -495,7 +495,8 @@ const drawBranches = (svg, branches) => { */ export const draw = function (txt, id, ver, diagObj) { clear(); - const gitGraphConfig = getConfig().gitGraph; + const conf = getConfig(); + const gitGraphConfig = conf.gitGraph; // try { log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); @@ -522,7 +523,12 @@ export const draw = function (txt, id, ver, diagObj) { drawCommits(diagram, allCommitsDict, true); // Setup the view box and size of the svg element - setupGraphViewbox(undefined, diagram, gitGraphConfig.diagramPadding, gitGraphConfig.useMaxWidth); + setupGraphViewbox( + undefined, + diagram, + gitGraphConfig.diagramPadding, + gitGraphConfig.useMaxWidth ?? conf.useMaxWidth + ); }; export default {