From 0d1212e4636b93a573d03c09501e8ebc5a923b47 Mon Sep 17 00:00:00 2001 From: Feroz Mujawar Date: Tue, 22 Oct 2024 19:42:27 +0530 Subject: [PATCH] fix NaN error while adding subgraph --- .../src/rendering-util/layout-algorithms/fixed/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/fixed/index.js b/packages/mermaid/src/rendering-util/layout-algorithms/fixed/index.js index 52f8e921c..aa668d834 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/fixed/index.js +++ b/packages/mermaid/src/rendering-util/layout-algorithms/fixed/index.js @@ -265,8 +265,8 @@ const doRender = async (_elem, data4Layout, siteConfig, positions) => { await Promise.all( data4Layout.nodes.map(async function (node) { let pos = positions.nodes[node.id]; - node.height = pos?.height; - node.width = pos?.width; + node.height = pos?.height || 0; + node.width = pos?.width || 0; if (node.isGroup) { node.x = 0;