From 095e8ca9e726199d03f1aba8de733a3c27afd262 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 9 Aug 2024 15:10:43 +0200 Subject: [PATCH] sequence diagram NaN values issue --- .../src/diagrams/sequence/sequenceRenderer.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts index 5299f1b1e1..951d84b862 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts +++ b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts @@ -1088,6 +1088,19 @@ export const draw = async function (_text: string, id: string, _version: string, const { bounds: box } = bounds.getBounds(); + if (box.startx === undefined) { + box.startx = 0; + } + if (box.starty === undefined) { + box.starty = 0; + } + if (box.stopx === undefined) { + box.stopx = 0; + } + if (box.stopy === undefined) { + box.stopy = 0; + } + // Make sure the height of the diagram supports long menus. let boxHeight = box.stopy - box.starty; if (boxHeight < requiredBoxSize.maxHeight) {