Area-Proportional Euler and Venn Diagrams

Generate area-proportional Euler diagrams using numerical optimization. A Euler diagram is a generalization of a Venn diagram, relaxing the criterion that all interactions need to be represented. Diagrams may be fit with circles, ellipses, squares, and rectangles via a wide range of inputs and can be visualized in numerous ways.


eulerr

R-CMD-check CoverageStatus CRANBadge

eulerr generates area-proportional Euler diagrams that display set relationships (intersections, unions, and disjoints) with circles or ellipses. Euler diagrams are Venn diagrams without the requirement that all set interactions be present (whether they are empty or not), which means that, depending on input, eulerr sometimes produces Venn diagrams and sometimes not.

With three or more sets intersecting, exact Euler diagrams are often impossible. For such cases eulerr attempts to provide a good approximation by numerically tuning the parameters of the ellipses or circles to minimize the error in the resulting diagram. Residuals and goodness of fit statistics are provided to assess whether the resulting diagram can be trusted.

Installation

Building eulerr from source requires a Rust toolchain. The minimum supported rustc version is listed in the SystemRequirements field of DESCRIPTION (currently rustc >= 1.88.0). If your system Rust is older than that, install or update via rustup before installing the package from source. CRAN binary builds do not need a local Rust toolchain.

CRAN version

install.packages("eulerr")

Development Version

devtools::install_github("jolars/eulerr")

Web App

eulerr is also available as a web app at https://eunoia.bz/app/.

Usage

library(eulerr)

set.seed(26)

# From Wilkinson 2012
fit <- euler(
  c(
    "A" = 4,
    "B" = 6,
    "C" = 3,
    "D" = 2,
    "E" = 7,
    "F" = 3,
    "A&B" = 2,
    "A&F" = 2,
    "B&C" = 2,
    "B&D" = 1,
    "B&F" = 2,
    "C&D" = 1,
    "D&E" = 1,
    "E&F" = 1,
    "A&B&F" = 1,
    "B&C&D" = 1
  ),
  shape = "ellipse"
)

We can inspect the goodness-of-fit metrics diagError and stress for the solution,

fit$stress
#> [1] 1.280319e-19
fit$diagError
#> [1] 6.774157e-11

and plot it

plot(fit)

Please see the introductory vignette for a brief introduction or eulerr under the hood for details.

Eunoia and Its Ecosystem

eulerr is based on Eunoia, which is a Rust library for fitting and visualizing Euler and Venn diagrams. The pure-Rust core powers bindings in several languages, all backed by the same fitting engine:

Language Package Install
Python eunoia (repo) pip install eunoia
Julia Eunoia.jl (repo) ] add Eunoia
JavaScript @jolars/eunoia (repo) npm install @jolars/eunoia
Rust eunoia on crates.io (repo) cargo add eunoia

License

eulerr is open source software, licensed under the MIT license.

Versioning

eulerr uses semantic versioning.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Acknowledgements

eulerr would not be possible without Ben Frederickson’s work on venn.js or Leland Wilkinson’s venneuler.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("eulerr")

8.3.1 by Johan Larsson, 25 days ago


https://github.com/jolars/eulerr, https://jolars.github.io/eulerr/, https://eunoia.bz


Report a bug at https://github.com/jolars/eulerr/issues


Browse source code at https://github.com/cran/eulerr


Authors: Johan Larsson [aut, cre, cph] (ORCID: , A. Jonathan R. Godfrey [ctb] , Peter Gustafsson [ctb] , David H. Eberly [ctb] (geometric algorithms) , Emanuel Huber [ctb] (root solver code) , Florian Privé [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports graphics, grDevices, grid, parallel, stats, utils

Suggests covr, knitr, lattice, pBrackets, RConics, rmarkdown, spelling, testthat

System requirements: Cargo (Rust's package manager), rustc >= 1.88.0


Imported by RulesTools.

Suggested by highdir, overviewR, pcutils.


See at CRAN