Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 authored Nov 27, 2024
2 parents 8cb1c68 + bff3282 commit 54d485f
Show file tree
Hide file tree
Showing 52 changed files with 740 additions and 204 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-bags-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: architecture diagrams no longer grow to extreme heights due to conflicting alignments
5 changes: 0 additions & 5 deletions .changeset/chilly-hotels-mix.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/dry-students-act.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/heavy-cats-mate.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/kind-drinks-invent.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thick-elephants-search.md

This file was deleted.

52 changes: 52 additions & 0 deletions cypress/integration/rendering/architecture.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,58 @@ describe.skip('architecture diagram', () => {
`
);
});

it('should render an architecture diagram with a resonable height', () => {
imgSnapshotTest(
`architecture-beta
group federated(cloud)[Federated Environment]
service server1(server)[System] in federated
service edge(server)[Edge Device] in federated
server1:R -- L:edge
group on_prem(cloud)[Hub]
service firewall(server)[Firewall Device] in on_prem
service server(server)[Server] in on_prem
firewall:R -- L:server
service db1(database)[db1] in on_prem
service db2(database)[db2] in on_prem
service db3(database)[db3] in on_prem
service db4(database)[db4] in on_prem
service db5(database)[db5] in on_prem
service db6(database)[db6] in on_prem
junction mid in on_prem
server:B -- T:mid
junction 1Leftofmid in on_prem
1Leftofmid:R -- L:mid
1Leftofmid:B -- T:db1
junction 2Leftofmid in on_prem
2Leftofmid:R -- L:1Leftofmid
2Leftofmid:B -- T:db2
junction 3Leftofmid in on_prem
3Leftofmid:R -- L:2Leftofmid
3Leftofmid:B -- T:db3
junction 1RightOfMid in on_prem
mid:R -- L:1RightOfMid
1RightOfMid:B -- T:db4
junction 2RightOfMid in on_prem
1RightOfMid:R -- L:2RightOfMid
2RightOfMid:B -- T:db5
junction 3RightOfMid in on_prem
2RightOfMid:R -- L:3RightOfMid
3RightOfMid:B -- T:db6
edge:R -- L:firewall
`
);
});
});

// Skipped as the layout is not deterministic, and causes issues in E2E tests.
Expand Down
45 changes: 44 additions & 1 deletion cypress/integration/rendering/flowchart-elk.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';

describe.skip('Flowchart ELK', () => {
describe('Flowchart ELK', () => {
it('1-elk: should render a simple flowchart', () => {
imgSnapshotTest(
`flowchart-elk TD
Expand Down Expand Up @@ -857,6 +857,49 @@ flowchart LR
D --> E
A["A"]
`,
{ flowchart: { titleTopMargin: 0 } }
);
});
it('6080: should handle diamond shape intersections', () => {
imgSnapshotTest(
`---
config:
layout: elk
---
flowchart LR
subgraph s1["Untitled subgraph"]
n1["Evaluate"]
n2["Option 1"]
n3["Option 2"]
n4["fa:fa-car Option 3"]
end
subgraph s2["Untitled subgraph"]
n5["Evaluate"]
n6["Option 1"]
n7["Option 2"]
n8["fa:fa-car Option 3"]
end
A["Start"] -- Some text --> B("Continue")
B --> C{"Evaluate"}
C -- One --> D["Option 1"]
C -- Two --> E["Option 2"]
C -- Three --> F["fa:fa-car Option 3"]
n1 -- One --> n2
n1 -- Two --> n3
n1 -- Three --> n4
n5 -- One --> n6
n5 -- Two --> n7
n5 -- Three --> n8
n1@{ shape: diam}
n2@{ shape: rect}
n3@{ shape: rect}
n4@{ shape: rect}
n5@{ shape: diam}
n6@{ shape: rect}
n7@{ shape: rect}
n8@{ shape: rect}
`,
{ flowchart: { titleTopMargin: 0 } }
);
Expand Down
Loading

0 comments on commit 54d485f

Please sign in to comment.