Skip to content

维恩图 (v<MERMAID_RELEASE_VERSION>+)

🌐 Venn diagrams (v<MERMAID_RELEASE_VERSION>+)

维恩图使用重叠的圆圈显示集合之间的关系。

🌐 Venn diagrams show relationships between sets using overlapping circles.

警告 这是 Mermaid 中的一种新图表类型。其语法可能会在未来版本中演变。

语法

🌐 Syntax

  • venn-beta 开始。
  • 对于单个集合名称,使用 set
  • 对于两个或更多集合名称的重叠,使用 union
  • union 中的标识符必须由之前的 set 行定义。
  • 集合标识符可以是裸词(ASet_1)或带引号的字符串("Foo Bar")。

标签

🌐 Labels

使用括号语法 ["..."] 来设置显示标签,同时保持标识符简短:

🌐 Use bracket syntax ["..."] to set a display label while keeping the identifier short:

尺寸

🌐 Sizes

使用 :N 后缀来设置集合或并集的大小:

🌐 Use :N suffix to set the size of a set or union:

文本节点

🌐 Text nodes

  • 使用 text 将标签放置在集合或并集中。
  • 缩进的 text 行附加到最近的 setunion
  • 使用括号语法 ["..."] 为文本节点设置显示标签。

样式

🌐 Styling

使用 style 语句将视觉样式应用到集合、并集和文本节点:

🌐 Use style statements to apply visual styles to sets, unions, and text nodes:

  • fill:更改填充颜色
  • color:更改文本颜色
  • stroke:更改描边颜色
  • stroke-width:更改笔画宽度
  • fill-opacity:更改填充不透明度
Opens in mermaid.ai