From c2b640aa86557ebc7f2dda775e8dd24f1cbe31d2 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 1 Mar 2024 18:03:00 +0100 Subject: [PATCH] Updated changes for b.8 --- cypress/platform/knsv2.html | 43 ++++++++++++++++--- packages/mermaid/package.json | 2 +- .../mermaid/src/dagre-wrapper/clusters.js | 2 + .../mermaid/src/diagrams/sequence/svgDraw.js | 2 +- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index 6e48dec4a..d48051717 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -64,14 +64,43 @@
-sequenceDiagram
-  actor Alice as Alice
-  participant John as John
+%%{ init: {}}%%
 
-  Alice ->>+ John: Hello John, how are you?
-  Alice ->>+ John: John, can you hear me?
-  John -->>- Alice: Hi Alice, I can hear you!
-  John -->>- Alice: I feel great!
+flowchart TB
+  subgraph Simple
+    subgraph Simple2
+      A
+    end
+  end
+
+  subgraph Leak
+    B
+  end
+
+  B --> C
+
+
+
+    
+
+%%{ init: {}}%%
+
+sequenceDiagram
+  participant H as H
+  participant Alice as Alice
+  participant Bob as Bob
+
+  Alice ->> Bob: Hello Bob, how are you ?
+  Bob ->> Alice: Fine, thank you. And you?
+  create participant Carl as Carl
+  Alice ->> Carl: Hi Carl!
+  create actor D as Donald
+  Carl ->> D: Hi!
+  D ->> H: sss
+  destroy Carl
+  Alice -x Carl: We are too many
+  destroy Bob
+  Bob ->> Alice: I agree
 
     
diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json
index c9aba474e..8b991b289 100644
--- a/packages/mermaid/package.json
+++ b/packages/mermaid/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@mermaid-chart/mermaid",
-  "version": "10.8.0-b.7",
+  "version": "10.8.0-b.8",
   "description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
   "type": "module",
   "module": "./dist/mermaid.core.mjs",
diff --git a/packages/mermaid/src/dagre-wrapper/clusters.js b/packages/mermaid/src/dagre-wrapper/clusters.js
index cdc003e81..a7246ef33 100644
--- a/packages/mermaid/src/dagre-wrapper/clusters.js
+++ b/packages/mermaid/src/dagre-wrapper/clusters.js
@@ -15,6 +15,8 @@ const rect = (parent, node) => {
   const shapeSvg = parent
     .insert('g')
     .attr('class', 'cluster' + (node.class ? ' ' + node.class : ''))
+    .attr('data-et', 'cluster')
+    .attr('data-id', node.id)
     .attr('id', node.id);
 
   // add the rect
diff --git a/packages/mermaid/src/diagrams/sequence/svgDraw.js b/packages/mermaid/src/diagrams/sequence/svgDraw.js
index 7d4dc7f4f..8af7c5163 100644
--- a/packages/mermaid/src/diagrams/sequence/svgDraw.js
+++ b/packages/mermaid/src/diagrams/sequence/svgDraw.js
@@ -300,7 +300,7 @@ const drawActorTypeParticipant = function (elem, actor, conf, isFooter) {
       .attr('data-et', 'life-line')
       .attr('data-id', actor.name)
       .attr('x1', center)
-      .attr('y1', actor.height)
+      .attr('y1', actor.starty || 0 + actor.height)
       .attr('x2', center)
       .attr('y2', 2000)
       .attr('class', 'actor-line')