yline: Compute Y line to avoid collision

View source: R/yline.R

ylineR Documentation

Compute Y line to avoid collision

Description

This function handles the collision between objects to be drawn, also accounting for labels. It is provided as a convenient component of custom drawing functions, and is currently in use in draw.boxes and draw.steps.

Usage

  yline(boxes, start, end, label, labelStrand, labelCex, labelSrt, labelAdj,
    labelOverflow, maxDepth)

Arguments

boxes

A data.frame with "start.plot" and "end.plot" integer columns defining the boundaries of the graphical elements to be drawn and a "label" character column. In a typical use case, they correspond to the "start", "end" and "name" columns from the slice to be drawn.

start

Single integer value, the left boundary of the window, in base pairs.

end

Single integer value, the right boundary of the window, in base pairs.

label

Single logical value, whether to print labels on boxes or not.

labelStrand

Single logical value, whether to add the strand at the end of labels or not.

labelCex

Single numeric value, character expansion factor for labels.

labelSrt

Single numeric value, string rotation angle for labels.

labelAdj

'left', 'right' or 'center', the horizontal adjustment of the labels on the boxes.

labelOverflow

Single logical value, whether to write labels on boxes too narrow to host them or not.

maxDepth

Single integer value, the maximum amount of box heights allowed on the plot to avoid overlaps (if exhausted an error message will be ploted, turning label to FALSE might help).

Value

Returns boxes with an additional "yline" integer column defining the y coordinate at which the box should be drawn to avoid collision. If an error occurs, a simpleError object will be returned instead and the drawing should be aborted (see draw.boxes code for a functional example).

Author(s)

Sylvain Mareschal

See Also

draw.boxes, draw.steps


Rgb documentation built on Aug. 18, 2023, 5:05 p.m.

Related to yline in Rgb...