| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/render-cached-plot.R |
| 3 |
\name{sizeGrowthRatio} |
| 4 |
\alias{sizeGrowthRatio} |
| 5 |
\title{Create a sizing function that grows at a given ratio} |
| 6 |
\usage{ |
| 7 |
sizeGrowthRatio(width = 400, height = 400, growthRate = 1.2) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{width, height}{Base width and height.} |
| 11 |
|
| 12 |
\item{growthRate}{Growth rate multiplier.} |
| 13 |
} |
| 14 |
\description{ |
| 15 |
Returns a function which takes a two-element vector representing an input |
| 16 |
width and height, and returns a two-element vector of width and height. The |
| 17 |
possible widths are the base width times the growthRate to any integer power. |
| 18 |
For example, with a base width of 500 and growth rate of 1.25, the possible |
| 19 |
widths include 320, 400, 500, 625, 782, and so on, both smaller and larger. |
| 20 |
Sizes are rounded up to the next pixel. Heights are computed the same way as |
| 21 |
widths. |
| 22 |
} |
| 23 |
\examples{ |
| 24 |
f <- sizeGrowthRatio(500, 500, 1.25) |
| 25 |
f(c(400, 400)) |
| 26 |
f(c(500, 500)) |
| 27 |
f(c(530, 550)) |
| 28 |
f(c(625, 700)) |
| 29 |
|
| 30 |
} |
| 31 |
\seealso{ |
| 32 |
This is to be used with \code{\link[=renderCachedPlot]{renderCachedPlot()}}. |
| 33 |
} |