Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering flowchart open links with arrows #6043

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spotty-vans-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: Fix rendering flowchart open links with arrows
14 changes: 14 additions & 0 deletions packages/mermaid/src/diagrams/flowchart/flowDb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,17 @@ describe('flow db addClass', () => {
expect(classes.get('a')?.styles).toEqual(['stroke-width: 8px']);
});
});

describe('flow db getData', () => {
beforeEach(() => {
flowDb.clear();
});

it('should support arrow_open as an edge end arrow type', () => {
flowDb.addVertex('A', { text: 'A', type: 'text' }, undefined, [], [], '', undefined, undefined);
flowDb.addVertex('B', { text: 'B', type: 'text' }, undefined, [], [], '', undefined, undefined);
flowDb.addLink(['A'], ['B'], { type: 'arrow_open' });
const data = flowDb.getData();
expect(data.edges[0].arrowTypeEnd).toEqual('arrow_open');
});
});
1 change: 1 addition & 0 deletions packages/mermaid/src/diagrams/flowchart/flowDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ const destructEdgeType = (type: string | undefined) => {
let arrowTypeStart = 'none';
let arrowTypeEnd = 'arrow_point';
switch (type) {
case 'arrow_open':
case 'arrow_point':
case 'arrow_circle':
case 'arrow_cross':
Expand Down
Loading