Julia · 1.0.1

<a id="api-reference"></a>

<a id="API-Reference"></a>

# API Reference

- [`Eunoia.BoundingBox`](<api#api-1edb34b8352fe6ff52496e63ba9f9bf421b6b944e2eae02fb4f897af26e351b2>)
- [`Eunoia.Circle`](<api#api-a2b8d2c79b6c0de403c7686fbe8e2ff541b150d8ae0e43abf7305f2219977e70>)
- [`Eunoia.Container`](<api#api-e0571b45e42b05337a197e7419f2737e325514269e07cb2bfb074c1f4a0cf27a>)
- [`Eunoia.Ellipse`](<api#api-90e52e7a5341c5651f39c26bd1e25082ede7c9697702cef96b79f632c20b33b1>)
- [`Eunoia.EulerFit`](<api#api-38793b773173351175774044ae02d6db6ae42036d57f93f2e560761c2d3a7cb8>)
- [`Eunoia.GlyphBoxPlacements`](<api#api-c54a75daa24a4b9f8dfbe0acc2f584c0cc511b813a1d0cb6c6651c315f13bdd2>)
- [`Eunoia.GlyphPlacements`](<api#api-8c6464c4a6a30e4667d482ada4d617880298c3f9999907764bc17f724f602ae9>)
- [`Eunoia.LabelPlacement`](<api#api-396189f5c92fb2129aa52584b2aa1dabb01827894fcd54b1ecd056b27313d9f1>)
- [`Eunoia.Point`](<api#api-59cafb5e612fa31b8a7df1da6dcd411ea2309143edbfd92222e3d51f1ffdb87a>)
- [`Eunoia.Rectangle`](<api#api-d742cb110d5554395e61d4cab52f480da1b76d480f6814be559ce7e9dfe26a2d>)
- [`Eunoia.RotatedRectangle`](<api#api-a31a664c3fcf2f8cc1d34973cfe8cf4fc7ffb74c199f75ba313d219755715dcf>)
- [`Eunoia.Square`](<api#api-eda227d2ddd61a61a6b553701ea57ae2386bc5ac7e0b1630283bd523cbd60c99>)
- [`Eunoia.VennFit`](<api#api-021ce5ec48c3579f0199b7ea8e9936e42245578c07726352258592cb23160fd7>)
- [`Eunoia.euler`](<api#api-8b7524db3c1fb27bbe047fcc8f63578c7d49abb69f89d70901c195ffc77d70f7>)
- [`Eunoia.eunoiaplot`](<api#api-f0755c50a7728ef7b423f17de54d67c79b1bad1196d46706151507b4742eff75>)
- [`Eunoia.eunoiaplot!`](<api#api-28d52222aa982a1126edcfeb7099de3c3d9779397c0eeddf1711b91e4d806a06>)
- [`Eunoia.label_boxes`](<api#api-3b4a192281b21a9db5ab6a0d1849ba6c3f30de899e31521ae58d5e198610767b>)
- [`Eunoia.place_glyph_boxes`](<api#api-e3d7dede611ad25f1b207e205c4012d2d93aa8816690ce9ad9da34845a803098>)
- [`Eunoia.place_glyphs`](<api#api-8d65ec1f04c356dd4d1d2d8a94b846dcde496702ceb7abfcdf347ffca4341b13>)
- [`Eunoia.place_labels`](<api#api-778c90452c0276620e21bd3d408e516a41b407161cd8d7607b208c4d919b756a>)
- [`Eunoia.place_set_labels`](<api#api-fa7e61a0139899b85c7200e736036ebbef3bbcbb58547b083d5b28d44619a1ab>)
- [`Eunoia.venn`](<api#api-a85bd3e16b7af482a998ba06c52e24412b2cb88721275e2238502ebb0ed93313>)
- [`Eunoia.version`](<api#api-c750f95e742dc4cb73063b55c1b27370d799c04c1b14293d7b05cf32c809d4e5>)

<a id="api-1edb34b8352fe6ff52496e63ba9f9bf421b6b944e2eae02fb4f897af26e351b2"></a>

## [`Eunoia.BoundingBox`](<reference/9f7f709918b54780f3fc0f5043b77fa14a9b8a50b9ee8cc8b77e2b99d8176885>)

```julia
BoundingBox
```

```julia
BoundingBox(x::Real, y::Real, width::Real, height::Real)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

An axis-aligned rectangle used as a label or glyph keep-out box.

```julia
BoundingBox(x::Real, y::Real, width::Real, height::Real)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

<a id="api-a2b8d2c79b6c0de403c7686fbe8e2ff541b150d8ae0e43abf7305f2219977e70"></a>

## [`Eunoia.Circle`](<reference/6a26b3b25de936a3e3c3245e607fd97e68fea7a43b87aa0178ae5abf977c7272>)

```julia
Circle <: AbstractShape
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A fitted circle for one input set.

<a id="api-e0571b45e42b05337a197e7419f2737e325514269e07cb2bfb074c1f4a0cf27a"></a>

## [`Eunoia.Container`](<reference/29bbe7ac525da2f8be0ebdf7f2027a4515bb5194ba33c8c8ba9ed6a10c961782>)

```julia
Container
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

The fitted universe box drawn around a diagram fit with a `complement`. The container's area minus the union of the shapes matches the requested complement area.

<a id="api-90e52e7a5341c5651f39c26bd1e25082ede7c9697702cef96b79f632c20b33b1"></a>

## [`Eunoia.Ellipse`](<reference/94638ac013815ba25554356459b4516815ca3ac3133829dc0d072688d7873dcd>)

```julia
Ellipse <: AbstractShape
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A fitted ellipse for one input set.

<a id="api-38793b773173351175774044ae02d6db6ae42036d57f93f2e560761c2d3a7cb8"></a>

## [`Eunoia.EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>)

```julia
EulerFit{S} <: AbstractEulerFit{S}
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

```julia
EulerFit{S}
```

Result of fitting an area-proportional Euler diagram with shapes of type `S`. 

Fields: 

- `shapes`: fitted shapes, one per input set, in input order.
- `original_values`: the requested exclusive area per region (keyed by combination string, e.g. `"A&B"`).
- `fitted_values`: the fitted exclusive area per region.
- `residuals`: `original_values − fitted_values` per region.
- `region_error`: per-region error (always in exclusive form).
- `diag_error`: eulerAPE-style worst-case region error.
- `stress`: venneuler-style stress metric.
- `loss`: final value of the optimizer's objective.
- `iterations`: optimizer iteration count.
- `container`: the fitted universe box when fit with a `complement`, else `nothing`.

The `plot_data` field holds the native renderable geometry (region polygons and label anchors); it backs plotting and is not part of the stable public API. 

<a id="api-c54a75daa24a4b9f8dfbe0acc2f584c0cc511b813a1d0cb6c6651c315f13bdd2"></a>

## [`Eunoia.GlyphBoxPlacements`](<reference/5e027fde245c91cbcb841b500d0dd99d5df54215ed4ec646da7c6ea13397143c>)

```julia
GlyphBoxPlacements
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

```julia
GlyphBoxPlacements
```

Result of [`place_glyph_boxes`](<reference/449597d1fea745b3444efeb31886d7a3531288f1e3e8b56231a8aaeadf55c3dc>). `scale` is the diagram-wide factor to apply to the reference text size. Each vector in `boxes` is a prefix aligned with the corresponding input sizes; `unplaced` reports the omitted suffix. 

<a id="api-8c6464c4a6a30e4667d482ada4d617880298c3f9999907764bc17f724f602ae9"></a>

## [`Eunoia.GlyphPlacements`](<reference/9fed1e8e33687d5f7c4dcc320a3ed3a04eff837fc3036aa71f16076799f56ae0>)

```julia
GlyphPlacements
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

```julia
GlyphPlacements
```

Result of [`place_glyphs`](<reference/b66db21c9529819142a1b80eb69d4ae88e40378d3e3cae82c75ab7ab95b0790c>). `radius` is shared by every glyph, `positions` contains glyph centers by region, and `unplaced` reports any shortfall when a fixed radius could not accommodate every requested glyph. 

<a id="api-396189f5c92fb2129aa52584b2aa1dabb01827894fcd54b1ecd056b27313d9f1"></a>

## [`Eunoia.LabelPlacement`](<reference/b4506487ededf0a7c82aba939d73026bffbc453a51b1db85ce982e56778f36fc>)

```julia
LabelPlacement
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

```julia
LabelPlacement
```

A resolved label position returned by [`place_labels`](<reference/2def8faa859f1c87d063429a7fddf6e003ae7162236076c186185ccd29e44288>) or [`place_set_labels`](<reference/9066afa58a6e34badcb91c34927b78ab6dae1725d3d585e1b4e33ea77584cff8>). `anchor` is the center of the label box. `kind` is one of `:interior`, `:exterior_raycast`, `:exterior_force_directed`, `:exterior_elbow`, `:exterior_matched`, or `:exterior_set` (`:unknown` for a future native variant). For exterior placements that need a leader line, `tether` is the inside-region point the leader starts from, `leader_end` is where it meets the label box, and `leader_waypoints` are the intermediate polyline vertices. Set-label placements carry no leader geometry. 

<a id="api-59cafb5e612fa31b8a7df1da6dcd411ea2309143edbfd92222e3d51f1ffdb87a"></a>

## [`Eunoia.Point`](<reference/2ec2df124d7e8789e9efd70421bd9b0e20f7006e8e627a9181f8846fd40580c8>)

```julia
Point
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A 2D point.

<a id="api-d742cb110d5554395e61d4cab52f480da1b76d480f6814be559ce7e9dfe26a2d"></a>

## [`Eunoia.Rectangle`](<reference/018c2eb6fa8c850db997d35505d3f313ba1c31186232a23457bab4e58b373dbb>)

```julia
Rectangle <: AbstractShape
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A fitted axis-aligned rectangle for one input set.

<a id="api-a31a664c3fcf2f8cc1d34973cfe8cf4fc7ffb74c199f75ba313d219755715dcf"></a>

## [`Eunoia.RotatedRectangle`](<reference/5dcb87deb604ab6b6aed706353fb30d2b20a30ede49b73f0d8be53f065312b57>)

```julia
RotatedRectangle <: AbstractShape
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A fitted rotated rectangle for one input set. `rotation` is the angle (in radians) of the rectangle about its `center`.

<a id="api-eda227d2ddd61a61a6b553701ea57ae2386bc5ac7e0b1630283bd523cbd60c99"></a>

## [`Eunoia.Square`](<reference/9a52470d1f683137d10beaf164ea6d63889b4338db42788295d6c438b50766c8>)

```julia
Square <: AbstractShape
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

A fitted axis-aligned square for one input set.

<a id="api-021ce5ec48c3579f0199b7ea8e9936e42245578c07726352258592cb23160fd7"></a>

## [`Eunoia.VennFit`](<reference/aaeedc476b437f51a25680a2e40c9055c9ecd3ca856c0fe73f756ff578293692>)

```julia
VennFit{S} <: AbstractEulerFit{S}
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/types.jl>)

```julia
VennFit{S}
```

Result of laying out a (non-proportional) Venn diagram. Shares [`EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>)'s structure, but the layout is *topological*: every set intersection is drawn regardless of area, so the proportional-error metrics are not meaningful (left at zero) and `original_values` is empty. `fitted_values` holds the geometric area of each region. 

<a id="api-8b7524db3c1fb27bbe047fcc8f63578c7d49abb69f89d70901c195ffc77d70f7"></a>

## [`Eunoia.euler`](<reference/724ed6727eeae60915c72bfade1aba4de6ed59849fa7c8c0907cf91088d062d1>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
euler(
    values::AbstractDict;
    shape::AbstractString = "circle",
    input_type::AbstractString = "exclusive",
    complement::Union{Nothing, Real} = nothing,
    seed::Union{Nothing, Integer} = nothing,
    max_sets::Union{Nothing, Integer} = nothing,
    loss::Union{Nothing, AbstractString} = nothing,
    loss_eps::Union{Nothing, Real} = nothing,
    n_restarts::Union{Nothing, Integer} = nothing,
    optimizer::Union{Nothing, AbstractString} = nothing,
    mds_solver::Union{Nothing, AbstractString} = nothing,
    initial_sampler::Union{Nothing, AbstractString} = nothing,
    cmaes_fallback_threshold::Union{Nothing, Real} = nothing,
    max_iterations::Union{Nothing, Integer} = nothing,
    tolerance::Union{Nothing, Real} = nothing,
    xtol::Union{Nothing, Real} = nothing,
    ftol::Union{Nothing, Real} = nothing,
    gtol::Union{Nothing, Real} = nothing,
    jobs::Union{Nothing, Integer} = nothing,
    n_vertices::Union{Nothing, Integer} = nothing,
    label_precision::Union{Nothing, Real} = nothing,
    sliver_threshold::Union{Nothing, Real} = nothing
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
euler(values; shape="circle", input_type="exclusive",
      complement=nothing, seed=nothing, loss=nothing, …)
```

Fit an area-proportional Euler diagram. `values` is one of: 

- a mapping from combination strings to areas, where a key is a single set (`"A"`) or an `&`-joined intersection (`"A&B"`):
  
  ```julia
  euler(Dict("A" => 5, "B" => 3, "A&B" => 1.5))
  ```
- a mapping from set names to **membership collections** (vector/set/tuple); each element is counted into the canonical region of the sets it belongs to, yielding exclusive per-region counts (so `input_type` must stay `"exclusive"`):
  
  ```julia
  euler(Dict("A" => ["x", "y"], "B" => ["y", "z"]))
  ```

Keyword arguments: 

- `shape`: `"circle"` (default), `"ellipse"`, `"square"`, `"rectangle"`, or `"rotated_rectangle"`.
- `input_type`: `"exclusive"` (default; per-region areas) or `"inclusive"` (set sizes that include overlaps; the core converts internally and the reported `fitted_values`/`residuals` are reconstructed in the inclusive scale).
- `complement`: target "universe" area outside every set (opts into container fitting); `nothing` to disable.
- `seed`: RNG seed for reproducible restarts; `nothing` for default.
- `max_sets`: raise the set-count ceiling above the core default (`32`); clamped core-side to the hard cap (`63`). `nothing` keeps the default. Note that a fully-overlapping `n`-set diagram has `2^n - 1` regions, so large dense inputs remain intractable regardless.

Fitting knobs (all optional; `nothing` keeps the core default). Invalid string tokens are rejected by the native core and surface as an error: 

- `loss`: objective function. One of `"sum_squared"` (default), `"sum_absolute"`, `"sum_absolute_region_error"`, `"sum_squared_region_error"`, `"max_absolute"`, `"max_squared"`, `"root_mean_squared"`, `"stress"`, `"diag_error"`, `"log_sum_absolute"`, or a C¹-smooth surrogate `"smooth_sum_absolute"`, `"smooth_sum_absolute_region_error"`, `"smooth_max_absolute"`, `"smooth_max_squared"`, `"smooth_diag_error"`, `"smooth_log_sum_absolute"`.
- `loss_eps`: smoothing parameter for the six `smooth_*` losses (default `1e-3`); ignored by the non-smooth losses.
- `n_restarts`: number of randomly seeded restarts (default `10`).
- `optimizer`: final-layout solver. One of `"levenberg_marquardt"`, `"lbfgs"`, `"nelder_mead"`, `"mads"`, `"trf"`, `"cmaes"`, `"cmaes_lm"`, or `"cmaes_trf"` (default).
- `mds_solver`: initial-layout (MDS) solver, `"levenberg_marquardt"` (default) or `"lbfgs"`.
- `initial_sampler`: restart-position sampler, `"uniform"` (default) or `"latin_hypercube"`.
- `cmaes_fallback_threshold`: loss above which the `cmaes_*` optimizers fire their global escape stage (default `1e-3`).
- `max_iterations`: per-optimizer iteration cap (default `200`).
- `tolerance`: unified convergence tolerance (default `1e-3`).
- `xtol`, `ftol`, `gtol`: fine-grained Levenberg-Marquardt tolerances overriding the defaults derived from `tolerance`.
- `jobs`: thread count for the restart loop; a pure wall-time knob, the chosen layout is identical regardless of value.

Plot-tuning knobs (all optional; `nothing` keeps the core default). These shape the `plot_data` geometry used for rendering, not the fit: 

- `n_vertices`: vertices per polygonized shape/region outline (default `200`). Lower values give coarser outlines; higher values, smoother ones.
- `label_precision`: pole-of-inaccessibility search precision for label anchors, in coordinate units (default `0.01`).
- `sliver_threshold`: minimum region-piece area, as a fraction of the largest piece, below which a piece is rejected as a polygonization artifact (default `1e-3`); `0.0` disables the filter.

Returns an [`EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>) carrying the fitted `shapes`, the `original_values`/`fitted_values`/`residuals` per region, the per-region `region_error`, the scalar fit metrics, and—if a `complement` was given—a `container`. 

<a id="api-f0755c50a7728ef7b423f17de54d67c79b1bad1196d46706151507b4742eff75"></a>

## [`Eunoia.eunoiaplot`](<reference/64c23a11690b420c37333e95ed51ddc80a26b8edd06ecb5463752a6e8f752650>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
eunoiaplot(fit; colors, fills, edges, labels, quantities, legend, complement,
           fontsize=14, label_placement=true, set_label_placement=false,
           glyphs=nothing, members=nothing, figure=(;), axis=(;))
eunoiaplot(gridpos, fit; axis=(;), kwargs...)
```

Render a fitted [`EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>)/[`VennFit`](<reference/aaeedc476b437f51a25680a2e40c9055c9ecd3ca856c0fe73f756ff578293692>) as a publication-ready Makie figure (equal aspect, no axis decorations), returning a `Makie.FigureAxisPlot`. 

The second form draws into a *layout cell* of an existing figure — e.g. `eunoiaplot(f[1, 2], fit)` — mirroring Makie's `plot(fig[i, j], data)`. It creates a diagram-configured axis (equal aspect, hidden decorations) in that cell and returns a `Makie.AxisPlot`. Use it to assemble multi-panel figures without configuring each axis by hand. It takes the same styling keywords (pass an axis `title` and the like through `axis = (; title = "…")`) but does not add a legend; add a `Legend` yourself if you want one. 

This requires a Makie backend to be loaded — the implementation lives in a package extension that activates on `using CairoMakie` (or `GLMakie`/`WGLMakie`). The bare Makie `plot(fit)`/`plot!(ax, fit)` recipe forms also work once a backend is loaded. 

Styling keywords mirror the `eunoia-py` `plot()` API: 

- `colors`: per-set colors — a vector (shape order) or a `Dict(name => color)`; omitted uses a built-in categorical palette. Region fills blend the member colors perceptually (OKLab).
- `fills`: `Dict(combo => style)` per-region fill overrides.
- `edges`: set-outline style — a uniform style, a per-set `Dict`, or a vector.
- `labels`: `false`/`true`/`nothing`, a per-set `Dict`, or a uniform style.
- `quantities`: `false`/`true`, `"original"`/`"fitted"`, `"counts"`/`"percent"`, or a `Dict`.
- `legend`: `false`/`true` or a `Dict` of `Legend` keywords.
- `complement`: container-box style `Dict` (drawn only when the fit has one).
- `fontsize`: base label font size in points (quantities render smaller).

Collision-aware labels: 

- `label_placement`: `true` (default) places labels collision-aware via [`place_labels`](<reference/2def8faa859f1c87d063429a7fddf6e003ae7162236076c186185ccd29e44288>): each region's label is measured (Makie text metrics), positioned inside its region when it fits, else pushed outside with a leader line. Set names and quantities are combined into one box per region, so a set name and its region quantity never overlap. The default uses the `"raycast"` exterior solver with straight leaders; pass a `NamedTuple`/`Dict` of [`place_labels`](<reference/2def8faa859f1c87d063429a7fddf6e003ae7162236076c186185ccd29e44288>) strategy knobs (`placement`, `leader`, `tether`, `margin`, `iterations`, `precision`, `leader_gap`, `min_gap`) to change it, e.g. `label_placement = (; placement = "force_directed")` or `label_placement = (; leader = "elbow", tether = "boundary")`. Pass `label_placement=false` to instead draw labels at their raw anchors.
- `leader_style`: collection of `lines!` keywords styling the leader lines.
- `set_label_placement`: `false` (default) keeps set names inside their regions; `true` places them just outside their own shape, and a `NamedTuple`/`Dict` additionally forwards `margin`, `angular_steps`, `obstacles`, and `precision` to [`place_set_labels`](<reference/9066afa58a6e34badcb91c34927b78ab6dae1725d3d585e1b4e33ea77584cff8>).
- `glyphs`: an explicit region-to-integer-count mapping. Circular glyphs are packed with [`place_glyphs`](<reference/b66db21c9529819142a1b80eb69d4ae88e40378d3e3cae82c75ab7ab95b0790c>); use `glyph_options` for placement knobs and `glyph_style` for Makie `scatter!` attributes.
- `members`: an explicit region-to-ordered-names mapping. Names are measured, packed with [`place_glyph_boxes`](<reference/449597d1fea745b3444efeb31886d7a3531288f1e3e8b56231a8aaeadf55c3dc>), and scaled uniformly; use `member_options` and `member_style` to customize them. `glyphs` and `members` are mutually exclusive.

Collision-aware placement needs the axis (to convert pixel text metrics to layout units), so it is available through `eunoiaplot`/`eunoiaplot!` only; the bare `plot(fit)` recipe form ignores `label_placement`. 

```julia
eunoiaplot(::AbstractEulerFit, args...; kwargs...)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
eunoiaplot(
    fit::AbstractEulerFit;
    figure = (;),
    axis = (;),
    legend = false,
    kwargs...
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/ext/EunoiaMakieExt.jl>)

```julia
eunoiaplot(
    gp::Union{Makie.GridPosition, Makie.GridSubposition},
    fit::AbstractEulerFit;
    axis = (;),
    kwargs...
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/ext/EunoiaMakieExt.jl>)

<a id="api-28d52222aa982a1126edcfeb7099de3c3d9779397c0eeddf1711b91e4d806a06"></a>

## [`Eunoia.eunoiaplot!`](<reference/12dd42932855daa77e22ae0e1c3929cc167b9dfd821afa28d54f9a8fed523419>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
eunoiaplot!(ax, fit; label_placement=true, set_label_placement=false,
            glyphs=nothing, members=nothing, leader_style=(;), kwargs...)
```

Draw a fitted diagram into an existing Makie axis `ax`. It accepts the same styling and placement keywords as [`eunoiaplot`](<reference/64c23a11690b420c37333e95ed51ddc80a26b8edd06ecb5463752a6e8f752650>), but does not alter the axis aspect or decorations. 

```julia
eunoiaplot!(::Any, ::AbstractEulerFit, args...; kwargs...)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
eunoiaplot!(
    ax,
    fit::AbstractEulerFit;
    label_placement = true,
    set_label_placement = false,
    glyphs = nothing,
    glyph_options = (;),
    glyph_style = (;),
    members = nothing,
    member_options = (;),
    member_style = (;),
    leader_style = (;),
    kwargs...
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/ext/EunoiaMakieExt.jl>)

```julia
eunoiaplot!(ax, fit; label_placement=true, set_label_placement=false,
            glyphs=nothing, members=nothing, leader_style=(;), kwargs...)
```

Draw a fit into an existing axis. By default (`label_placement=true`) labels are placed collision-aware via raycast (see [`Eunoia.eunoiaplot`](<reference/64c23a11690b420c37333e95ed51ddc80a26b8edd06ecb5463752a6e8f752650>) for the value forms); the resolved label boxes and any exterior leader polylines are drawn into `ax`. Pass `label_placement=false` to instead leave labels at their raw anchors. Set `set_label_placement=true` to move set names outside their shapes. Explicit `glyphs` and `members` mappings enable the two mutually exclusive glyph modes. `leader_style` is a collection of `lines!` keywords for leader lines. 

<a id="api-3b4a192281b21a9db5ab6a0d1849ba6c3f30de899e31521ae58d5e198610767b"></a>

## [`Eunoia.label_boxes`](<reference/d77d2d4d9d5c50a1ac3c9ea6a01fbb808e7a5f246b88b8218e47475fd19e9b40>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
label_boxes(placements::AbstractDict, sizes::AbstractDict; padding::Real = 0)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
label_boxes(placements, sizes; padding=0) -> Vector{BoundingBox}
```

Convert resolved label placements and their measured `(width, height)` sizes into padded, axis-aligned keep-out boxes. The result can be passed as `obstacles` to [`place_set_labels`](<reference/9066afa58a6e34badcb91c34927b78ab6dae1725d3d585e1b4e33ea77584cff8>), [`place_glyphs`](<reference/b66db21c9529819142a1b80eb69d4ae88e40378d3e3cae82c75ab7ab95b0790c>), or [`place_glyph_boxes`](<reference/449597d1fea745b3444efeb31886d7a3531288f1e3e8b56231a8aaeadf55c3dc>). 

<a id="api-e3d7dede611ad25f1b207e205c4012d2d93aa8816690ce9ad9da34845a803098"></a>

## [`Eunoia.place_glyph_boxes`](<reference/449597d1fea745b3444efeb31886d7a3531288f1e3e8b56231a8aaeadf55c3dc>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_glyph_boxes(
    fit::AbstractEulerFit,
    sizes::AbstractDict;
    arrangement::Union{Nothing, AbstractString} = nothing,
    scale::Union{Nothing, Real} = nothing,
    min_scale::Union{Nothing, Real} = nothing,
    gap::Union{Nothing, Real} = nothing,
    seed::Union{Nothing, Integer} = nothing,
    precision::Union{Nothing, Real} = nothing,
    max_attempts::Union{Nothing, Integer} = nothing,
    obstacles::Union{Nothing, AbstractVector} = nothing
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_glyph_boxes(fit, sizes; arrangement=nothing, scale=nothing,
                  min_scale=nothing, gap=nothing, seed=nothing,
                  precision=nothing, max_attempts=nothing,
                  obstacles=nothing) -> GlyphBoxPlacements
```

Pack ordered, caller-measured member-label boxes inside fitted regions. `sizes` maps each canonical region combination to a vector of `(width, height)` pairs. The returned boxes are a prefix aligned with each input vector; render the corresponding text at the reference font size multiplied by `scale`. 

<a id="api-8d65ec1f04c356dd4d1d2d8a94b846dcde496702ceb7abfcdf347ffca4341b13"></a>

## [`Eunoia.place_glyphs`](<reference/b66db21c9529819142a1b80eb69d4ae88e40378d3e3cae82c75ab7ab95b0790c>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_glyphs(
    fit::AbstractEulerFit,
    counts::AbstractDict;
    arrangement::Union{Nothing, AbstractString} = nothing,
    radius::Union{Nothing, Real} = nothing,
    gap::Union{Nothing, Real} = nothing,
    seed::Union{Nothing, Integer} = nothing,
    precision::Union{Nothing, Real} = nothing,
    max_attempts::Union{Nothing, Integer} = nothing,
    obstacles::Union{Nothing, AbstractVector} = nothing
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_glyphs(fit, counts; arrangement=nothing, radius=nothing, gap=nothing,
             seed=nothing, precision=nothing, max_attempts=nothing,
             obstacles=nothing) -> GlyphPlacements
```

Pack equally sized circular glyphs inside fitted regions. `counts` maps canonical region combinations to nonnegative integer counts. Omit `radius` to choose the largest shared radius that accommodates every requested glyph. 

<a id="api-778c90452c0276620e21bd3d408e516a41b407161cd8d7607b208c4d919b756a"></a>

## [`Eunoia.place_labels`](<reference/2def8faa859f1c87d063429a7fddf6e003ae7162236076c186185ccd29e44288>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_labels(
    fit::AbstractEulerFit,
    sizes::AbstractDict;
    placement::Union{Nothing, AbstractString} = nothing,
    leader::Union{Nothing, AbstractString} = nothing,
    margin::Union{Nothing, Real} = nothing,
    iterations::Union{Nothing, Integer} = nothing,
    precision::Union{Nothing, Real} = nothing,
    tether::Union{Nothing, AbstractString} = nothing,
    leader_gap::Union{Nothing, Real} = nothing,
    min_gap::Union{Nothing, Real} = nothing
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_labels(fit, sizes; placement=nothing, leader=nothing, margin=nothing,
             iterations=nothing, precision=nothing, tether=nothing,
             leader_gap=nothing, min_gap=nothing)
```

Resolve collision-aware label positions for the regions of a fitted [`EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>)/[`VennFit`](<reference/aaeedc476b437f51a25680a2e40c9055c9ecd3ca856c0fe73f756ff578293692>), given the rendered label box sizes. 

The core can't place labels without their on-screen sizes (font metrics it never sees at fit time), so this is a separate call from [`euler`](<reference/724ed6727eeae60915c72bfade1aba4de6ed59849fa7c8c0907cf91088d062d1>): measure each label, then ask for placements. `sizes` is a mapping from region/combination strings (`"A"`, `"A&B"`, …) to a `(width, height)` tuple in the same coordinate units as the fitted `shapes`. Only regions present in both `sizes` and the fit's geometry get a placement; degenerate inputs are silently skipped. 

Each placement tries to sit inside its region; one that can't fit is pushed outside with a leader line. Returns a `Dict{String,LabelPlacement}` (see [`LabelPlacement`](<reference/b4506487ededf0a7c82aba939d73026bffbc453a51b1db85ce982e56778f36fc>)). 

Strategy knobs (all optional; `nothing` keeps the core default). Invalid string tokens are rejected by the native core and surface as an error: 

- `leader`: leader edge type, `"straight"` (default) or `"elbow"` (d3-pie style orthogonal leaders with column-based placement).
- `placement`: exterior solver for straight leaders, `"raycast"` (default), `"force_directed"` (spring/repulsion relaxation for crowded diagrams), or `"matched"` (noncrossing boundary labels); ignored for `"elbow"`.
- `margin`: gap between the diagram and exterior labels (both edge types); the per-region proportional default applies when omitted.
- `iterations`: iteration cap for `"force_directed"` (default `200`); ignored otherwise.
- `precision`: pole-of-inaccessibility search precision (default `0.01`).
- `tether`: where an exterior leader attaches to its region, `"poi"` (default, the pole of inaccessibility) or `"boundary"` (the region's outer ring).
- `leader_gap`: visible gap between the leader tip and the label box (default `0.0`).
- `min_gap`: minimum vertical spacing between stacked `"elbow"` labels; ignored otherwise.

```julia
fit = euler(Dict("A" => 5, "B" => 3, "A&B" => 1.5))
placements = place_labels(fit, Dict("A" => (0.6, 0.3), "B" => (0.6, 0.3));
                          placement="force_directed")
```

<a id="api-fa7e61a0139899b85c7200e736036ebbef3bbcbb58547b083d5b28d44619a1ab"></a>

## [`Eunoia.place_set_labels`](<reference/9066afa58a6e34badcb91c34927b78ab6dae1725d3d585e1b4e33ea77584cff8>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_set_labels(
    fit::AbstractEulerFit,
    sizes::AbstractDict;
    margin::Union{Nothing, Real} = nothing,
    angular_steps::Union{Nothing, Integer} = nothing,
    obstacles::Union{Nothing, AbstractVector} = nothing,
    precision::Union{Nothing, Real} = nothing
)
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
place_set_labels(fit, sizes; margin=nothing, angular_steps=nothing,
                 obstacles=nothing, precision=nothing)
```

Place one measured label per set just outside that set's shape. Labels hug the shape boundary and need no leader line. `sizes` maps set names to `(width, height)` pairs in diagram coordinates. Returns a `Dict{String,LabelPlacement}` keyed by set name. 

<a id="api-a85bd3e16b7af482a998ba06c52e24412b2cb88721275e2238502ebb0ed93313"></a>

## [`Eunoia.venn`](<reference/ec83f7b45a38f089fd97e9db1c19d0d5658bd2545e079bba777e3dbb45934bd6>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

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

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
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`](<reference/724ed6727eeae60915c72bfade1aba4de6ed59849fa7c8c0907cf91088d062d1>). 

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

Returns a [`VennFit`](<reference/aaeedc476b437f51a25680a2e40c9055c9ecd3ca856c0fe73f756ff578293692>): the same structure as [`EulerFit`](<reference/4ed69989ba26556a9f6f1924004c8ef9d3a879be2533c31ba480a63a0d640b42>), but the layout is topological, so `fitted_values` holds each region's geometric area and `original_values` is empty. 

<a id="api-c750f95e742dc4cb73063b55c1b27370d799c04c1b14293d7b05cf32c809d4e5"></a>

## [`Eunoia.version`](<reference/abcf43bea28dbcca3663000676b5deb006e8c4e3422a196b66cd03aa75cb3af1>)

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
version()
```

[Source](<https://github.com/jolars/Eunoia.jl/blob/db1275ffc768591b8c9271c56d8dfa2f3351bfcd/src/Eunoia.jl>)

```julia
version() -> String
```

Return the version of the underlying `eunoia-capi` native library.
