Skip to content
Prev 28701 / 63424 Next

A patch for extending pdf device to embed popup text and web links

Hi
Tobias Verbeke wrote:
I would second that approach, at least in the meantime.  This sort of
functionality is interesting and useful, but needs careful thought to
make it compatible with the existing graphics facilities in R.

One major consideration is that the graphics system tries to be mostly
device-independent, so that R graphics code can be run on any device.
This would need adjustments to the common graphics engine/device C code
rather than just to the C code underlying the PDF device.

There is also the issue of following standard R coding style and
semantics.  Rather than your approach of ...

text(5, 2, "text test")
pdf.link.on.text("http://www.google.com")

... where the second call relies on a global setting to relate to the
appropriate text, it would be better to have something like ...

linkedText(5, 2, "text test", href="http://www.google.com")

... so that the association is explicit.

By developing your ideas as an add-on package, people can try out your
ideas without having to recompile R.  As Tobias has pointed out, the
RSVGTipsDevice package might be a good place to start.

Paul