Re: [R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-03 Thread Wittner, Ben, Ph.D.
Paul, Thanks very much! Your example code below shows exactly how to do what I wanted. -Ben p.s., For the record, transRight - current.transform() after the second call to pushViewport() seems to have gotten deleted from you example code below, but that was obvious. -Original Message-

Re: [R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-02 Thread Paul Murrell
Hi Wittner, Ben, Ph.D. wrote: Hadley, In my application the leaf viewports will not overlap, but I guess that would not necessarily be the case for all applications. In any event, do you happen to know how to transform coordinates in the top-level viewport to coordinates in another

[R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-01 Thread Wittner, Ben, Ph.D.
Short form: How do I transform the output of grid.locator() (or grid.locator(unit='npc')) to the native (or npc) coordinates of a viewport other than the top-level viewport? Thanks in advance. -Ben Long form: I would like the user to be able to

Re: [R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-01 Thread hadley wickham
Ben, What if the click occurs over multiple viewports? Hadley On Mon, Jun 2, 2008 at 6:50 AM, Wittner, Ben, Ph.D. [EMAIL PROTECTED] wrote: Short form: How do I transform the output of grid.locator() (or grid.locator(unit='npc')) to the native (or npc) coordinates of a

Re: [R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-01 Thread Wittner, Ben, Ph.D.
Hadley, In my application the leaf viewports will not overlap, but I guess that would not necessarily be the case for all applications. In any event, do you happen to know how to transform coordinates in the top-level viewport to coordinates in another viewport in the tree? Thanks. -Ben