EVOLUTION-MANAGER
Edit File: grid.delay.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Encapsulate calculations and generating a grob</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for grid.delay {grid}"><tr><td>grid.delay {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Encapsulate calculations and generating a grob </h2> <h3>Description</h3> <p>Evaluates an expression that includes both calculations and generating a grob that depends on the calculations so that both the calculations and the grob generation will be rerun when the scene is redrawn (e.g., device resize or editing). </p> <p>Intended <em>only</em> for expert use. </p> <h3>Usage</h3> <pre> delayGrob(expr, list, name=NULL, gp=NULL, vp=NULL) grid.delay(expr, list, name=NULL, gp=NULL, vp=NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>object of mode <code><a href="../../base/html/expression.html">expression</a></code> or <code>call</code> or an unevaluated expression.</p> </td></tr> <tr valign="top"><td><code>list</code></td> <td> <p>a list defining the environment in which <code>expr</code> is to be evaluated.</p> </td></tr> <tr valign="top"><td><code>name</code></td> <td> <p> A character identifier. </p> </td></tr> <tr valign="top"><td><code>gp</code></td> <td> <p>An object of class <code>gpar</code>, typically the output from a call to the function <code>gpar</code>. This is basically a list of graphical parameter settings.</p> </td></tr> <tr valign="top"><td><code>vp</code></td> <td> <p>A Grid viewport object (or NULL).</p> </td></tr> </table> <h3>Details</h3> <p>A grob is created of special class <code>"delayedgrob"</code> (and drawn, in the case of <code>grid.delay</code>). The <code>makeContent</code> method for this class evaluates the expression with the list as the evaluation environment (and the grid Namespace as the parent of that environment). </p> <p>The <code>expr</code> argument should return a grob as its result. </p> <p>These functions are analogues of the <code>grid.record()</code> and <code>recordGrob()</code> functions; the difference is that these functions are based on the <code>makeContent()</code> hook, while those functions are based on the <code>drawDetails()</code> hook. </p> <h3>Note</h3> <p> This function <em>must</em> be used instead of the function <code>recordGraphics</code>; all of the dire warnings about using <code>recordGraphics</code> responsibly also apply here. </p> <h3>Author(s)</h3> <p> Paul Murrell </p> <h3>See Also</h3> <p><code><a href="../../grDevices/html/recordGraphics.html">recordGraphics</a></code> </p> <h3>Examples</h3> <pre> grid.delay({ w <- convertWidth(unit(1, "inches"), "npc") rectGrob(width=w) }, list()) </pre> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>