VennArea Class

An area of a VennDiagram: a set, drawn as a circle (Mermaid set), or the overlap of several sets (Mermaid union), with its label and its size.

public sealed class VennArea

Constructors

NameDescription
VennArea(IEnumerable<string>, string?, double?)Initializes a new instance of the VennArea class.

VennArea(IEnumerable<string>, string?, double?)

VennArea.cs

Initializes a new instance of the VennArea class.

public VennArea(IEnumerable<string> sets, string? label = null, double? size = null)

Parameters

sets IEnumerable<string>
The identifiers of the sets: one for a set, several for an overlap. They are sorted in ordinal order, as Mermaid does.
label string?
The label, or null to show the identifier of a set and nothing on an overlap.
size double?
The size, or null for the size of Mermaid: 10 divided by the square of the number of sets.

Exceptions

ArgumentException
sets is empty or contains null.
ArgumentOutOfRangeException
size is negative or not finite.

Properties

NameDescription
EffectiveSizeGets the size the layout uses: VennArea.Size, or 10 divided by the square of the number of sets.
IsSetGets a value indicating whether the area is a set, drawn as a circle, rather than an overlap.
LabelGets or sets the label, or null to show the identifier of a set and nothing on an overlap.
SetsGets the identifiers of the sets, sorted in ordinal order.
SizeGets or sets the size: the area of the circle, or of the overlap, relative to the other sizes. A set of size 0 is not drawn, nor its overlaps. null is the size of Mermaid: 10 divided by the square of the number of sets, so 10 for a set and 2.5 for the overlap of two sets.

EffectiveSize

VennArea.cs

Gets the size the layout uses: VennArea.Size, or 10 divided by the square of the number of sets.

public double EffectiveSize { get; }

Property value

double

Gets a value indicating whether the area is a set, drawn as a circle, rather than an overlap.

public bool IsSet { get; }

Property value

bool

Gets or sets the label, or null to show the identifier of a set and nothing on an overlap.

public string? Label { get; set; }

Property value

string?

Remarks

An empty label of a set shows its identifier, as in Mermaid.

Gets the identifiers of the sets, sorted in ordinal order.

public ReadOnlyCollection<string> Sets { get; }

Gets or sets the size: the area of the circle, or of the overlap, relative to the other sizes. A set of size 0 is not drawn, nor its overlaps. null is the size of Mermaid: 10 divided by the square of the number of sets, so 10 for a set and 2.5 for the overlap of two sets.

public double? Size { get; set; }

Property value

double?

Exceptions

ArgumentOutOfRangeException
The value is negative or not finite.

Methods

NameDescription
ToString()Returns the sets of the area.

ToString()

VennArea.cs

Returns the sets of the area.

public override string ToString()

Returns

string The identifiers of the sets, separated by commas.