Eunoia

Eunoia.venn

Julia · julia · 1.0.1

venn(
    sets;
    shape::AbstractString = "circle",
    complement::Union{Nothing, Real} = nothing
)

Methods

venn( sets; shape::AbstractString = "circle", complement::Union{Nothing, Real} = nothing )

venn(sets; shape="circle", complement=nothing)

Build a canonical Venn diagram. sets selects the set names, as one of:

  • an Integer n — n sets with default names "A", "B", …;

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

  • a mapping whose keys are set/combination labels (the distinct base set names are extracted; values are ignored, since a Venn layout is non-proportional).

The number of names selects the arrangement; shape is "circle" (n ≤ 3), "ellipse" (n ≤ 5), "square", "rectangle" (n ≤ 3), or "rotated_rectangle" (n ≤ 4).

Pass complement to reserve that area outside every set; the fit then carries a container box (the "universe" frame) drawn behind the diagram, just as for euler.

venn(["A", "B", "C"]; shape="ellipse")
venn(3)
venn(4; shape="rotated_rectangle", complement=2)

Returns a VennFit: the same structure as EulerFit, but the layout is topological, so fitted_values holds each region's geometric area and original_values is empty.