From 8fe2d7c2e617ae8bc5d8f8a70e7e0d70f080f994 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:03:35 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- .../rendering/architecture.spec.ts | 92 +++---- demos/architecture.html | 240 +++++++++--------- packages/mermaid/package.json | 2 +- .../architecture/architectureRenderer.ts | 3 +- 4 files changed, 169 insertions(+), 168 deletions(-) diff --git a/cypress/integration/rendering/architecture.spec.ts b/cypress/integration/rendering/architecture.spec.ts index 686a34ceee..4599319793 100644 --- a/cypress/integration/rendering/architecture.spec.ts +++ b/cypress/integration/rendering/architecture.spec.ts @@ -1,9 +1,9 @@ import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts'; describe('architecture diagram', () => { - it('should render a simple architecture diagram with groups', () => { - imgSnapshotTest( - `architecture + it('should render a simple architecture diagram with groups', () => { + imgSnapshotTest( + `architecture group api(cloud)[API] service db(database)[Database] in api @@ -17,11 +17,11 @@ describe('architecture diagram', () => { disk2 T--B db server T--B gateway ` - ); - }); - it('should render an architecture diagram with groups within groups', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with groups within groups', () => { + imgSnapshotTest( + `architecture group api[API] group public[Public API] in api group private[Private API] in api @@ -37,18 +37,18 @@ describe('architecture diagram', () => { serv2 L--R db serv1 L--R gateway ` - ); - }); - it('should render an architecture diagram with the fallback icon', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with the fallback icon', () => { + imgSnapshotTest( + `architecture service unknown(iconnamedoesntexist)[Unknown Icon] ` - ); - }); - it('should render an architecture diagram with split directioning', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with split directioning', () => { + imgSnapshotTest( + `architecture service db(database)[Database] service s3(disk)[Storage] service serv1(server)[Server 1] @@ -60,11 +60,11 @@ describe('architecture diagram', () => { serv2 L--B s3 serv1 T--B disk ` - ); - }); - it('should render an architecture diagram with directional arrows', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with directional arrows', () => { + imgSnapshotTest( + `architecture service servC(server)[Server 1] service servL(server)[Server 2] service servR(server)[Server 3] @@ -81,11 +81,11 @@ describe('architecture diagram', () => { servR (T--R) servT servR (B--R) servB ` - ); - }); - it('should render an architecture diagram with group edges', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with group edges', () => { + imgSnapshotTest( + `architecture group left_group(cloud)[Left] group right_group(cloud)[Right] group top_group(cloud)[Top] @@ -103,11 +103,11 @@ describe('architecture diagram', () => { top_disk{group} (B--T) center_disk{group} bottom_disk{group} (T--B) center_disk{group} ` - ); - }); - it('should render an architecture diagram with edge labels', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with edge labels', () => { + imgSnapshotTest( + `architecture service servC(server)[Server 1] service servL(server)[Server 2] service servR(server)[Server 3] @@ -124,11 +124,11 @@ describe('architecture diagram', () => { servR T-[Label]-R servT servR B-[Label]-R servB ` - ); - }); - it('should render an architecture diagram with simple junction edges', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with simple junction edges', () => { + imgSnapshotTest( + `architecture service left_disk(disk)[Disk] service top_disk(disk)[Disk] service bottom_disk(disk)[Disk] @@ -144,11 +144,11 @@ describe('architecture diagram', () => { top_gateway B--T juncR bottom_gateway T--B juncR ` - ); - }); - it('should render an architecture diagram with complex junction edges', () => { - imgSnapshotTest( - `architecture + ); + }); + it('should render an architecture diagram with complex junction edges', () => { + imgSnapshotTest( + `architecture group left group right service left_disk(disk)[Disk] in left @@ -169,6 +169,6 @@ describe('architecture diagram', () => { juncC{group} R--L) juncR{group} ` - ); - }); -}); \ No newline at end of file + ); + }); +}); diff --git a/demos/architecture.html b/demos/architecture.html index 3855d6d0af..f5136f6dab 100644 --- a/demos/architecture.html +++ b/demos/architecture.html @@ -1,23 +1,22 @@ - - - - - Architecture Mermaid Quick Test Page - - - - - -

Architecture diagram demo

-

Simple diagram with groups

-
+  
+    
+    
+    Architecture Mermaid Quick Test Page
+    
+    
+  
+
+  
+    

Architecture diagram demo

+

Simple diagram with groups

+
       architecture
         group api(cloud)[API]
 
@@ -32,10 +31,10 @@ 

Simple diagram with groups

disk2 T--B db server T--B gateway
-
+
-

Groups within groups

-
+    

Groups within groups

+
       architecture
         group api[API]
         group public[Public API] in api
@@ -56,17 +55,17 @@ 

Groups within groups

serv1 L--R gateway
-
+
-

Default icon (?) from unknown icon name

-
+    

Default icon (?) from unknown icon name

+
       architecture
         service unknown(iconnamedoesntexist)[Unknown Icon]
     
-
+
-

Split Direction

-
+    

Split Direction

+
       architecture
         service db(database)[Database]
         service s3(disk)[Storage]
@@ -79,10 +78,10 @@ 

Split Direction

serv2 L--B s3 serv1 T--B disk
-
+
-

Arrow Tests

-
+    

Arrow Tests

+
       architecture
         service servC(server)[Server 1]
         service servL(server)[Server 2]
@@ -100,7 +99,7 @@ 

Arrow Tests

servR (T--R) servT servR (B--R) servB
-
+    
       architecture
         service servC(server)[Server 1]
         service servL(server)[Server 2]
@@ -118,10 +117,10 @@ 

Arrow Tests

servT (R--T) servR servB (R--B) servR
-
+
-

Group Edges

-
+    

Group Edges

+
       architecture
         group left_group(cloud)[Left]
         group right_group(cloud)[Right]
@@ -139,11 +138,12 @@ 

Group Edges

right_disk{group} (L--R) center_disk{group} top_disk{group} (B--T) center_disk{group} bottom_disk{group} (T--B) center_disk{group} -
-
+
+
-

Edge Label Test

-
+    

Edge Label Test

+
       architecture
         service servC(server)[Server 1]
         service servL(server)[Server 2]
@@ -161,7 +161,7 @@ 

Edge Label Test

servR T-[Label]-R servT servR B-[Label]-R servB
-
+    
       architecture
         service servC(server)[Server 1]
         service servL(server)[Server 2]
@@ -180,9 +180,9 @@ 

Edge Label Test

servR B-[Label that is Long]-R servB
-
-

Junction Demo

-
+    
+

Junction Demo

+
       architecture
         service left_disk(disk)[Disk]
         service top_disk(disk)[Disk]
@@ -199,10 +199,10 @@ 

Junction Demo

top_gateway B--T juncR bottom_gateway T--B juncR
-
+
-

Junction Demo Groups

-
+    

Junction Demo Groups

+
       architecture
         group left
         group right
@@ -224,10 +224,10 @@ 

Junction Demo Groups

juncC{group} R--L) juncR{group}
-
+
-

AWS Icon Demo

-
+    

AWS Icon Demo

+
     architecture
       service s3(s3)[Cloud Store]
       service ec2(ec2)[Server]
@@ -235,76 +235,76 @@ 

AWS Icon Demo

s3 L--R ec2 s3 T--B wave -
- - - - - \ No newline at end of file + iconLibraries: ['aws:full'], + }); + function callback() { + alert('It worked'); + } + mermaid.parseError = function (err, hash) { + console.error('In parse error:'); + console.error(err); + }; + + + diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 991c3e42be..9545282586 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -140,4 +140,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts b/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts index 5d1be3e040..0ce02005e7 100644 --- a/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts +++ b/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts @@ -102,7 +102,8 @@ function addGroups(groups: ArchitectureGroup[], cy: cytoscape.Core) { function addEdges(edges: ArchitectureEdge[], cy: cytoscape.Core) { edges.forEach((parsedEdge) => { - const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title } = parsedEdge; + const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title } = + parsedEdge; const edgeType = isArchitectureDirectionXY(parsedEdge.lhsDir, parsedEdge.rhsDir) ? 'segments' : 'straight';