Merge pull request #12 from Mermaid-Chart/subgraph-NaN-fix

fix NaN error while adding subgraph
This commit is contained in:
Knut Sveidqvist
2024-10-22 16:58:18 +02:00
committed by GitHub

View File

@@ -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;