From 5e3481033502c5b4c57ce04df6f4d36473adacb9 Mon Sep 17 00:00:00 2001 From: saurabhg772244 Date: Wed, 11 Sep 2024 12:42:45 +0530 Subject: [PATCH] Added rounded icon shape --- .../integration/rendering/iconShape.spec.ts | 4 +- cypress/platform/saurabh.html | 31 ++++--- .../mermaid/src/diagrams/flowchart/flowDb.ts | 3 + .../rendering-elements/nodes.js | 2 + .../rendering-elements/shapes/icon.ts | 11 +-- .../rendering-elements/shapes/iconRounded.ts | 92 +++++++++++++++++++ 6 files changed, 120 insertions(+), 23 deletions(-) create mode 100644 packages/mermaid/src/rendering-util/rendering-elements/shapes/iconRounded.ts diff --git a/cypress/integration/rendering/iconShape.spec.ts b/cypress/integration/rendering/iconShape.spec.ts index fe8472b02..5c69627ae 100644 --- a/cypress/integration/rendering/iconShape.spec.ts +++ b/cypress/integration/rendering/iconShape.spec.ts @@ -1,7 +1,7 @@ import { imgSnapshotTest } from '../../helpers/util'; -const looks = ['classic', 'handDrawn'] as const; -const directions = ['TB', 'BT', 'LR', 'RL'] as const; +const looks = ['classic'] as const; +const directions = ['TB'] as const; const forms = [undefined, 'square', 'circle'] as const; const labelPos = [undefined, 't', 'b'] as const; diff --git a/cypress/platform/saurabh.html b/cypress/platform/saurabh.html index 680972bb9..62506ab2e 100644 --- a/cypress/platform/saurabh.html +++ b/cypress/platform/saurabh.html @@ -62,32 +62,41 @@
-      flowchart BT
-       A --test2--> B2@{ icon: "fa:bell", form: "square", label: "B2 aiduaid uyawduad uaduabd uyduadb", pos: "b" }@
+      flowchart TB
+       A --test2--> B2@{ icon: "fa:bell", form: "rounded", label: "B2 aiduaid uyawduad uaduabd uyduadb", pos: "b" }@
        B2 --test--> C
+       D --> B2 --> E
+       style B2 fill:#f9f,stroke:#333,stroke-width:4px
   
-
+    
       flowchart BT
        A --test2--> B2@{ icon: "fa:bell", form: "square", label: "B2", pos: "t", h: 40, w: 30 }@
        B2 --test--> C
+       D --> B2 --> E
   
-
+    
       flowchart BT
-       A --test2--> B2@{ icon: "fa:bell", label: "B2", pos: "b", h: 40, w: 30 }@
+       A --test2--> B2@{ icon: "fa:bell", label: "B2 awiugdawu uydgayuiwd wuydguy", pos: "b", h: 40, w: 30 }@
        B2 --test--> C
   
-
+    
       flowchart BT
-       A --test2--> B2@{ icon: "fa:bell", label: "B2", pos: "t", h: 40, w: 30 }@
+       A --test2--> B2@{ icon: "fa:bell", label: "B2 dawuygd ayuwgd uy", pos: "t", h: 40, w: 30 }@
        B2 --test--> C
   
-      flowchart
-       A --> B2@{ icon: "fa:bell", label: "test augfuyfavf ydvaubfuac", pos: "t", w: 200, h: 100 }@ --> C
+      flowchart TB
+       A --> B2@{ icon: "fa:bell", form: "circle", label: "test augfuyfavf ydvaubfuac", pos: "t", w: 200, h: 100 }@ --> C
+  
+
+      flowchart TB
+       A --> B2@{ icon: "fa:bell", form: "circle", label: "test augfuyfavf ydvaubfuac", pos: "b", w: 200, h: 100 }@ --> C
+       D --> B2 --> E