Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
810e2f8
init venn diagram
exoego Jun 27, 2024
b140d4d
add text nodes
exoego Dec 21, 2025
cdacb0b
add changeset
exoego Dec 21, 2025
b150b68
add text nodes
exoego Dec 21, 2025
0ac78ff
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 21, 2025
c61b8bc
add tests
exoego Dec 21, 2025
3ee294a
Fix overflow issue on live editor
exoego Dec 21, 2025
7d8d494
Bump venn.js
exoego Dec 21, 2025
474227c
Use default color in intersection to support both light theme and dar…
exoego Dec 22, 2025
901905b
New syntax
exoego Dec 27, 2025
f852e9c
Auto-wrapping text
exoego Dec 27, 2025
8eae61f
fix color
exoego Dec 27, 2025
834b0be
Differentiate single set and union
exoego Dec 27, 2025
019aae7
Fix styling of text without label
exoego Dec 27, 2025
367192c
Update doc
exoego Dec 27, 2025
c314b18
cleanup
exoego Dec 27, 2025
4c5bf27
Added comments to help understanding
exoego Dec 27, 2025
f15f740
More offset when two text nodes
exoego Dec 28, 2025
8e849ea
cleanup
exoego Dec 28, 2025
333fd55
cleanup
exoego Jan 11, 2026
1e74c00
Merge remote-tracking branch 'origin/develop' into 2583-venn
exoego Feb 10, 2026
ab12696
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 10, 2026
9bbbf13
add release version
exoego Feb 11, 2026
c900628
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 11, 2026
82b7b34
add theme support
exoego Feb 18, 2026
3d24c56
Make viewbox size configurable
exoego Feb 18, 2026
c21f815
Add visual regression test
exoego Feb 18, 2026
7c8e02c
Remove since visual regression test covers it
exoego Feb 18, 2026
017076c
Follow the Flowchart-like label and style syntax
exoego Feb 18, 2026
43e80b6
format
exoego Feb 18, 2026
4e1cdf6
add handDrawn look support
exoego Feb 18, 2026
3ad860b
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 18, 2026
25a769e
Merge remote-tracking branch 'origin/develop' into 2583-venn
exoego Feb 18, 2026
87fbea8
fix autogen
exoego Feb 18, 2026
3ce576f
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 18, 2026
37582dc
Merge branch 'develop' into 2583-venn
knsv Feb 26, 2026
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
1 change: 1 addition & 0 deletions .build/jsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [
'packet',
'architecture',
'radar',
'venn',
] as const;

/**
Expand Down
5 changes: 5 additions & 0 deletions .changeset/evil-monkeys-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': minor
---

feat: Add venn-beta diagram
240 changes: 240 additions & 0 deletions cypress/integration/rendering/venn.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
import { imgSnapshotTest } from '../../helpers/util.ts';

describe('Venn Diagram', () => {
it('1: should render a simple two-set venn diagram', () => {
imgSnapshotTest(
`venn-beta
set A
set B
union A, B
`
);
});

it('2: should render a three-set venn diagram', () => {
imgSnapshotTest(
`venn-beta
set A
set B
set C
union A, B
union B, C
union A, C
union A, B, C
`
);
});

it('3: should render a venn diagram with a title', () => {
imgSnapshotTest(
`venn-beta
title Skills Overlap
set Frontend
set Backend
set DevOps
union Frontend, Backend
union Backend, DevOps
union Frontend, DevOps
union Frontend, Backend, DevOps
`
);
});

it('4: should render a venn diagram with custom set sizes', () => {
imgSnapshotTest(
`venn-beta
set A:20
set B:15
set C:10
union A, B:5
union B, C:3
union A, C:2
union A, B, C:1
`
);
});

it('5: should render a venn diagram with labels', () => {
imgSnapshotTest(
`venn-beta
title Team Skills
set Frontend["Frontend"]
set Backend["Backend"]
union Frontend, Backend["Fullstack"]
`
);
});

it('6: should render a venn diagram with text nodes', () => {
imgSnapshotTest(
`venn-beta
set A
text "Item 1"
text "Item 2"
set B
text "Item 3"
union A, B
text "Shared"
`
);
});

it('7: should render a venn diagram with custom colors via style', () => {
imgSnapshotTest(
`venn-beta
set A
set B
union A, B
style A fill:#ff6b6b
style B fill:#4ecdc4
style A,B fill:#ffe66d
`
);
});

it('8: should render a venn diagram with string identifiers', () => {
imgSnapshotTest(
`venn-beta
title Programming Languages
set "JavaScript"
set "Python"
set "TypeScript"
union "JavaScript", "TypeScript"
`
);
});

it('9: should render with dark theme', () => {
imgSnapshotTest(
`venn-beta
title Dark Theme
set A
set B
set C
union A, B
union B, C
union A, C
`,
{ theme: 'dark' }
);
});

it('10: should render a venn diagram with many text nodes', () => {
imgSnapshotTest(
`venn-beta
title Fruits and Vegetables
set Fruits
text "Apple"
text "Banana"
text "Orange"
set Vegetables
text "Carrot"
text "Broccoli"
union Fruits, Vegetables
text "Tomato"
`
);
});

it('11: should render a venn diagram with custom text colors via style', () => {
imgSnapshotTest(
`venn-beta
set A
text A1["Red Text"]
set B
text B1["Blue Text"]
union A, B
text AB1["Green Text"]
style A1 color:#ff0000
style B1 color:#0000ff
style AB1 color:#00ff00
`
);
});

it('12: should render a two-set venn with asymmetric sizes', () => {
imgSnapshotTest(
`venn-beta
set A:30
set B:10
union A, B:5
`
);
});

it('13: should render a complex venn with labels, text nodes, and styles', () => {
imgSnapshotTest(
`venn-beta
title Software Engineering Skills
set Frontend["Frontend"]
text "React"
text "CSS"
text "HTML"
set Backend["Backend"]
text "Node.js"
text "SQL"
text "APIs"
set DevOps["DevOps"]
text "Docker"
text "CI/CD"
union Frontend, Backend["Fullstack"]
text "REST"
text "GraphQL"
union Backend, DevOps
text "Monitoring"
union Frontend, DevOps
text "Performance"
union Frontend, Backend, DevOps
text "Architecture"
style Frontend fill:#ff6b6b
style Backend fill:#4ecdc4
style DevOps fill:#45b7d1
`
);
});

it('14: should render a two-set venn diagram with handDrawn look', () => {
imgSnapshotTest(
`venn-beta
set A
set B
union A, B
`,
{ look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
);
});

it('15: should render a three-set venn with handDrawn look and title', () => {
imgSnapshotTest(
`venn-beta
title HandDrawn Skills
set Frontend
set Backend
set DevOps
union Frontend, Backend
union Backend, DevOps
union Frontend, DevOps
union Frontend, Backend, DevOps
`,
{ look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
);
});

it('16: should render a handDrawn venn with custom styles and text nodes', () => {
imgSnapshotTest(
`venn-beta
set A
text "Item 1"
text "Item 2"
set B
text "Item 3"
union A, B
text "Shared"
style A fill:#ff6b6b
style B fill:#4ecdc4
style A,B fill:#ffe66d
`,
{ look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
);
});
});
3 changes: 3 additions & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ <h2><a href="./architecture.html">Architecture</a></h2>
<li>
<h2><a href="./radar.html">Radar</a></h2>
</li>
<li>
<h2><a href="./venn.html">Venn diagram</a></h2>
</li>
</ul>
</body>
</html>
Loading
Loading