EVOLUTION-MANAGER
Edit File: makeContent.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: Customised grid Grobs</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 makeContent {grid}"><tr><td>makeContent {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Customised grid Grobs </h2> <h3>Description</h3> <p>These generic hook functions are called whenever a grid grob is drawn. They provide an opportunity for customising the drawing context and drawing content of a new class derived from grob (or gTree). </p> <h3>Usage</h3> <pre> makeContext(x) makeContent(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> A grid grob. </p> </td></tr> </table> <h3>Details</h3> <p>These functions are called by the <code>grid.draw</code> methods for grobs and gTrees. </p> <p><code>makeContext</code> is called first during the drawing of a grob. This function should be used to <em>modify</em> the <code>vp</code> slot of <code>x</code> (and/or the <code>childrenvp</code> slot if <code>x</code> is a gTree). The function <em>must</em> return the modified <code>x</code>. Note that the default behaviour for grobs is to push any viewports in the <code>vp</code> slot, and for gTrees is to also push and up any viewports in the <code>childrenvp</code> slot, so this function is used to customise the drawing context for a grob or gTree. </p> <p><code>makeContent</code> is called next and is where any additional calculations should occur and graphical content should be generated (see, for example, <code>grid:::makeContent.xaxis</code>). This function should be used to <em>modify</em> the <code>children</code> of a gTree. The function <em>must</em> return the modified <code>x</code>. Note that the default behaviour for gTrees is to draw all grobs in the <code>children</code> slot, so this function is used to customise the drawing content for a gTree. It is also possible to customise the drawing content for a simple grob, but more care needs to be taken; for example, the function should return a standard grid primitive with a <code>drawDetails()</code> method in this case. </p> <p>Note that these functions should be <em>cumulative</em> in their effects, so that the <code>x</code> returned by <code>makeContent()</code> <em>includes</em> any changes made by <code>makeContext()</code>. </p> <p>Note that <code>makeContext</code> is also called in the calculation of <code>"grobwidth"</code> and <code>"grobheight"</code> units. </p> <h3>Value</h3> <p>Both functions are expected to return a grob or gTree (a modified version of <code>x</code>). </p> <h3>Author(s)</h3> <p> Paul Murrell </p> <h3>See Also</h3> <p><code><a href="grid.draw.html">grid.draw</a></code> </p> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>