Skip to contents

Makes the picture of a card each time grid draws it, so again when the Plots pane is resized. An SVG card is drawn through rsvg at twice the size in pixels that it takes on the device, so that it stays sharp, and keeps its thin lines and small text when the device shrinks it; a PNG card is shown as it is.

Usage

# S3 method for class 'rghcard_card'
makeContent(x)

Arguments

x

The grob that card_plot() draws, of class rghcard_card: the SVG code of the card in svg, or the picture of a PNG card in picture.

Value

x, with the picture as its child, as large as the device allows.

Examples

card <- grid::gTree(svg = stats_card(example_stats(), file = NULL), picture = NULL,
                    cl = "rghcard_card")
grid::grid.newpage()
grid::grid.draw(card)   # grid calls makeContent() as it draws the card