circleLayout: Arranges circles by iterative pair-wise repulsion within a...

View source: R/circleRepelLayout.R

circleLayoutR Documentation

Arranges circles by iterative pair-wise repulsion within a bounding rectangle

Description

This function is deprecated and will be removed in a future release. Please use circleRepelLayout instead.

Usage

circleLayout(xyr, xlim, ylim, maxiter = 1000, wrap = TRUE, weights = 1)

Arguments

xyr

A 3-column matrix or data frame (centre X, centre Y, radius).

xlim

The bounds in the X direction; either a vector for [xmin, xmax) or a single value interpreted as [0, xmax). Alternatively, omitting this argument or passing any of NULL, a vector of NA or an empty vector will result in unbounded movement in the X direction.

ylim

The bounds in the Y direction; either a vector for [ymin, ymax) or a single value interpreted as [0, ymax). Alternatively, omitting this argument or passing any of NULL, a vector of NA or an empty vector will result in unbounded movement in the Y direction.

maxiter

The maximum number of iterations.

wrap

Whether to treat the bounding rectangle as a toroid (default TRUE). When this is in effect, a circle leaving the bounds on one side re-enters on the opposite side.

weights

An optional vector of numeric weights (0 to 1 inclusive) to apply to the distance each circle moves during pair-repulsion. A weight of 0 prevents any movement. A weight of 1 gives the default movement distance. A single value can be supplied for uniform weights. A vector with length less than the number of circles will be silently extended by repeating the final value. Any values outside the range [0, 1] will be clamped to 0 or 1.

Value

A list with components:

layout

A 3-column matrix or data.frame (centre x, centre y, radius).

niter

Number of iterations performed.

Note

This function assumes that circle sizes are expressed as radii whereas the default for circleRepelLayout is area.

See Also

circleRepelLayout


packcircles documentation built on Sept. 8, 2023, 5:55 p.m.