VennDiagram Class
A Venn diagram: sets drawn as overlapping circles, whose areas and overlaps follow their sizes, with labels and texts inside them (Mermaid venn-beta). The circles are laid out as Mermaid does, with the algorithm of venn.js.
public sealed class VennDiagram : Diagram- Inheritance
DiagramVennDiagram
Constructors
| Name | Description |
|---|---|
| VennDiagram() |
VennDiagram()
VennDiagram.cspublic VennDiagram()No documentation is available.
Properties
| Name | Description |
|---|---|
| Areas | Gets the sets and their overlaps, in the order they are drawn: the circles take the colors of the sets in this order. |
| Height | Gets or sets the height of the drawing, in pixels. The default is 450, as in Mermaid. |
| SetColors | Gets the colors of the sets that replace the ones of the theme, by index from 0 to 7 (Mermaid venn1 to venn8): the n-th set takes the color n modulo 8. |
| Styles | Gets the styles of the areas and of the texts, applied in order. |
| TextColor | Gets or sets the color of the labels of the overlaps and of the texts, or null for the text color of the theme (Mermaid vennSetTextColor). |
| TextNodes | Gets the texts placed inside the areas. |
| Width | Gets or sets the width of the drawing, in pixels. The default is 800, as in Mermaid. |
Areas
VennDiagram.csGets the sets and their overlaps, in the order they are drawn: the circles take the colors of the sets in this order.
Property value
Height
VennDiagram.csGets or sets the height of the drawing, in pixels. The default is 450, as in Mermaid.
public double Height { get; set; }SetColors
VennDiagram.csGets the colors of the sets that replace the ones of the theme, by index from 0 to 7 (Mermaid venn1 to venn8): the n-th set takes the color n modulo 8.
public IDictionary<int, SceneColor> SetColors { get; }Property value
Styles
VennDiagram.csGets the styles of the areas and of the texts, applied in order.
public IList<VennStyleRule> Styles { get; }Property value
TextColor
VennDiagram.csGets or sets the color of the labels of the overlaps and of the texts, or null for the text color of the theme (Mermaid vennSetTextColor).
public SceneColor? TextColor { get; set; }Property value
TextNodes
VennDiagram.csWidth
VennDiagram.csGets or sets the width of the drawing, in pixels. The default is 800, as in Mermaid.
public double Width { get; set; }Property value
Exceptions
ArgumentOutOfRangeException- The value is not a positive finite number.
Remarks
The texts, the outlines and the padding of the circles grow with the width: they are those of Mermaid at a width of 1600 pixels, scaled.
Methods
| Name | Description |
|---|---|
| AddOverlap(IEnumerable<string>, string?, double?) | Adds the overlap of sets (Mermaid union). |
| AddSet(string, string?, double?) | Adds a set. |
| AddStyle(IEnumerable<string>, VennStyle) | Adds a style to an area, or to a text. |
| AddText(IEnumerable<string>, string, string?) | Adds a text inside an area. |
AddOverlap(IEnumerable<string>, string?, double?)
VennDiagram.csAdds the overlap of sets (Mermaid union).
public VennArea AddOverlap(IEnumerable<string> sets, string? label = null, double? size = null)Parameters
setsIEnumerable<string>- The identifiers of the sets, at least two.
labelstring?- The label, or
nullfor none. sizedouble?- The size, or
nullfor 10 divided by the square of the number of sets.
Returns
VennArea The overlap.
Exceptions
ArgumentExceptionsetshas fewer than two identifiers.
AddSet(string, string?, double?)
VennDiagram.csAddStyle(IEnumerable<string>, VennStyle)
VennDiagram.csAdds a style to an area, or to a text.
public VennStyleRule AddStyle(IEnumerable<string> targets, VennStyle style)Parameters
targetsIEnumerable<string>- The identifiers of the sets of the area, or the identifier of the text.
styleVennStyle- The style.
Returns
VennStyleRule The rule.
AddText(IEnumerable<string>, string, string?)
VennDiagram.csAdds a text inside an area.
public VennTextNode AddText(IEnumerable<string> sets, string id, string? label = null)Parameters
setsIEnumerable<string>- The identifiers of the sets of the area.
idstring- The identifier of the text.
labelstring?- The text shown, or
nullto show the identifier.
Returns
VennTextNode The text.