Venn diagrams (v\11.12.3+)
Venn diagrams show relationships between sets using overlapping circles.
Warning This is a new diagram type in Mermaid. Its syntax may evolve in future versions.
Syntax
- Start with
venn-beta. - Use
setfor a single set name. - Use
unionfor an overlap of two or more set names. - Identifiers in
unionmust be defined by earliersetlines. - Set identifiers can be bare words (
A,Set_1) or quoted strings ("Foo Bar").
Code:
mermaid
Labels
Use bracket syntax ["..."] to set a display label while keeping the identifier short:
Code:
mermaid
Sizes
Use :N suffix to set the size of a set or union:
Code:
mermaid
Text nodes
- Use
textto place labels inside a set or union. - Indented
textlines attach to the most recentsetorunion. - Use bracket syntax
["..."]to set a display label for text nodes.
Code:
mermaid
Styling
Use style statements to apply visual styles to sets, unions, and text nodes:
fill: change the fill colorcolor: change the text colorstroke: change the stroke colorstroke-width: change the stroke widthfill-opacity: change the fill opacity
Code:
mermaid