sizeGrowthRatio: Create a sizing function that grows at a given ratio

Description Usage Arguments See Also Examples

View source: R/render-cached-plot.R

Description

Returns a function which takes a two-element vector representing an input width and height, and returns a two-element vector of width and height. The possible widths are the base width times the growthRate to any integer power. For example, with a base width of 500 and growth rate of 1.25, the possible widths include 320, 400, 500, 625, 782, and so on, both smaller and larger. Sizes are rounded up to the next pixel. Heights are computed the same way as widths.

Usage

1
sizeGrowthRatio(width = 400, height = 400, growthRate = 1.2)

Arguments

width, height

Base width and height.

growthRate

Growth rate multiplier.

See Also

This is to be used with renderCachedPlot().

Examples

1
2
3
4
5
f <- sizeGrowthRatio(500, 500, 1.25)
f(c(400, 400))
f(c(500, 500))
f(c(530, 550))
f(c(625, 700))

shiny documentation built on July 2, 2020, 12:43 a.m.