Eunoia

Eunoia.eunoiaplot

Julia · julia · 1.0.1

eunoiaplot(::AbstractEulerFit, args...; kwargs...)
eunoiaplot(
    fit::AbstractEulerFit;
    figure = (;),
    axis = (;),
    legend = false,
    kwargs...
)
eunoiaplot(
    gp::Union{Makie.GridPosition, Makie.GridSubposition},
    fit::AbstractEulerFit;
    axis = (;),
    kwargs...
)
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/VennFit 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: 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 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.

  • glyphs: an explicit region-to-integer-count mapping. Circular glyphs are packed with place_glyphs; 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, 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.

Methods

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

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

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