cranvas (version 0.8.5)

draw_identify: Draw the identify labels under the mouse

Description

The identify labels are generated by specific plotting functions, and this function draw them as texts under the mouse, with a transparent gray background.

Usage

draw_identify(layer, painter, data, meta)

Arguments

layer
the layer argument of the painting function
painter
the painter argument of the painting function
data
the data object used by the plot
meta
the meta object in the plot

Value

NULL

Details

These components in the meta data are required to draw the labels: meta$pos (mouse position), meta$limits (layer limits) and meta$identify.labels (labels to draw). The color of the labels is set in the brush object as brush(data)$label.color.

The label will automatically adjust its own positions to ensure it does not exceed the plot margin. For example, when the mouse is near the right margin, the label will be drawn to the left.

Examples

Run this code
## see source code of qparallel() or qhist()

Run the code above in your browser using DataLab