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
.
yline(boxes, start, end, label, labelStrand, labelCex, labelSrt, labelAdj,
labelOverflow, maxDepth)
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).
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.
Single integer value, the left boundary of the window, in base pairs.
Single integer value, the right boundary of the window, in base pairs.
Single logical value, whether to print labels on boxes or not.
Single logical value, whether to add the strand at the end of labels or not.
Single numeric value, character expansion factor for labels.
Single numeric value, string rotation angle for labels.
'left', 'right' or 'center', the horizontal adjustment of the labels on the boxes.
Single logical value, whether to write labels on boxes too narrow to host them or not.
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).
Sylvain Mareschal
draw.boxes
, draw.steps