Skip to main content

Module venn

Module venn 

Source
Expand description

StatVenn: area-proportional Venn / Euler layouts.

Input rows give set sizes the venn.js way (inclusive): sets = "A" is the size of A, sets = "A&B" the size of A ∩ B, with the size in weight. Each set becomes a circle of area ∝ its size; pairwise centre distances are solved so circle overlaps match the pairwise intersections (exact for two sets), then centres are placed exactly (two or three sets) or by a deterministic stress-minimising descent (four or more). Higher-order intersections are not fitted.

Output: one row per set (part = "circle", x/y/r, set) and one per labelled region (part = "label", x/y at the region’s deepest interior point found by grid search, text = the set name for a set’s own region or the size for an intersection row), plus xmin/xmax/ ymin/ymax framing the diagram as a square.

Structs§

StatVenn
Venn layout stat behind GeomVenn.