| repel_text | R Documentation |
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.
repel_text(
x,
y,
widths,
heights,
anchor_x = x,
anchor_y = y,
min_gap = 0,
iterations = 20,
axis = "both"
)
x, y |
Numeric vectors of current label positions. |
widths, heights |
Numeric vectors of label bounding box dimensions (in
the same units as |
anchor_x, anchor_y |
Numeric vectors of original target positions that
labels are pulled back toward during the spring pass. Defaults to |
min_gap |
Minimum padding between labels. Default |
iterations |
Maximum number of repulsion iterations. Default |
axis |
Movement constraint: |
A list with elements x and y giving adjusted positions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.