% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/repel.R
\name{repel_text}
\alias{repel_text}
\title{Force-directed text repelling}
\usage{
repel_text(
  x,
  y,
  widths,
  heights,
  anchor_x = x,
  anchor_y = y,
  min_gap = 0,
  iterations = 20,
  axis = "both"
)
}
\arguments{
\item{x, y}{Numeric vectors of current label positions.}

\item{widths, heights}{Numeric vectors of label bounding box dimensions (in
the same units as \code{x} and \code{y}).}

\item{anchor_x, anchor_y}{Numeric vectors of original target positions that
labels are pulled back toward during the spring pass. Defaults to \code{x}
and \code{y}.}

\item{min_gap}{Minimum padding between labels. Default \code{0}.}

\item{iterations}{Maximum number of repulsion iterations. Default \code{20}.}

\item{axis}{Movement constraint: \code{"both"} (default), \code{"x"}, or \code{"y"}.}
}
\value{
A list with elements \code{x} and \code{y} giving adjusted positions.
}
\description{
Resolves overlapping text labels using a two-phase algorithm: (1) push
overlapping labels apart symmetrically, (2) spring-pull labels back toward
their anchors without reintroducing overlaps.
}
\keyword{internal}
