eunoia.venn

eunoia.venn(sets: int | Sequence[str] | Mapping[str, float] | Mapping[str, Collection[str]] | NativeDataFrame | NativeLazyFrame | NativeIbis, *, shape: Literal['ellipse'] = 'ellipse', complement: float | None = None, input: Literal['exclusive', 'inclusive'] = 'exclusive') VennFit[Ellipse][source]
eunoia.venn(sets: int | Sequence[str] | Mapping[str, float] | Mapping[str, Collection[str]] | NativeDataFrame | NativeLazyFrame | NativeIbis, *, shape: Literal['circle'], complement: float | None = None, input: Literal['exclusive', 'inclusive'] = 'exclusive') VennFit[Circle]
eunoia.venn(sets: int | Sequence[str] | Mapping[str, float] | Mapping[str, Collection[str]] | NativeDataFrame | NativeLazyFrame | NativeIbis, *, shape: Literal['square'], complement: float | None = None, input: Literal['exclusive', 'inclusive'] = 'exclusive') VennFit[Square]
eunoia.venn(sets: int | Sequence[str] | Mapping[str, float] | Mapping[str, Collection[str]] | NativeDataFrame | NativeLazyFrame | NativeIbis, *, shape: Literal['rectangle'], complement: float | None = None, input: Literal['exclusive', 'inclusive'] = 'exclusive') VennFit[Rectangle]

Lay out a (non-proportional) Venn diagram.

Unlike euler(), every set intersection is always drawn, regardless of area. The arrangement is topological — the shapes come from the eunoia core’s canonical Venn layouts, not from numerical optimization.

Parameters:
  • sets

    The sets to show. One of:

    • an int nn sets with default names "A", "B", …;

    • a sequence of set names, e.g. ["cat", "dog", "fish"];

    • a mapping from set-combination labels (e.g. "A", "A&B") to per-region quantities — the layout stays topological, but the values are kept as original_values so plot() can label each region (this is the common “Venn diagram with subset sizes” case);

    • a mapping from set names to membership collections ({"A": ["x", "y"], "B": ["y", "z"]}), counted into per-region quantities;

    • a DataFrame (pandas, polars, … via narwhals) treated as a membership matrix — its column names are the sets and each row is counted into a region.

    For int and plain name-sequence input there are no quantities, so original_values is empty.

  • shape"ellipse" (default), "circle", "square" or "rectangle". Ellipses support 1–5 sets; circles, squares and rectangles 1–3. An unsupported set count raises EunoiaError.

  • complement – Optional universe area outside every set. For a Venn diagram this only adds a visual container box (the padded bounding box); it does not drive optimization.

  • input – How to read the supplied quantities. "exclusive" (default): each value is a per-region count with no overlap included. "inclusive": values are total set sizes that include overlaps. Only meaningful for the region-area mapping form; membership-list and DataFrame input are always exclusive (passing "inclusive" raises EunoiaError).

Returns:

A topological fit whose plot() works like EulerFit. When quantities were supplied they are kept in original_values and shown by plot() automatically; otherwise fitted_values holds the geometric area of every region.

Return type:

VennFit