This report describes changes in version 0.4 of the ‘DOM’ package for R. The main change in this version is the addition of new functions that allow control over the Cascading Style Sheet (CSS) content of a web page. This provides programmatic control over the styling of HTML and SVG content on a page.
This report describes changes in version 0.2 of the ‘DOM’ package for R. Version 0.1 of ‘DOM’ allowed HTML content to be added to a web page (or removed or modified); version 0.2 adds the ability to append SVG content to a web page.
This report documents a variety of approaches to including an external vector image within an R plot. The image presents particular challenges because it contains features that are not natively supported by the R graphics system, which makes it hard for R to faithfully reproduce the image.
The R project has a new logo (shown below). On his blog, Bob Rudis showed how to draw the new R logo as part of an R plot. The purpose of this report is demonstrate an alternative way to draw the new R logo in an R plot that makes use of the ‘grConvert’ and ‘grImport2’ packages for R.
This document describes several different techniques for including SVG images within a web page and points out the important SVG attributes that control the final appearance of the SVG image within the web page. The document then describes how to control those attributes when generating SVG images with the ‘gridSVG’ package for R.
The grImport2 package imports vector images that are stored in the SVG image format for inclusion within images generated by R. The original grImport package performs the same task, but instead using PostScript images as its source image format. This technical report describes the steps taken to improve not only the grImport package, but also follows the development of two new packages, grImport2 and grConvert. The latter, grConvert, converts images from popular vector image formats (PostScript, PDF and SVG) into valid input formats for grImport and grImport2. The grImport2 package is an entirely new package that does not suffer from some limitations of the grImport package, whose limitations are primarily due to the dependence on the PostScript image format.
Simon Potter and Paul Murrell
SVG is a vector graphic image format that can be used with
browsers to deploy dynamic, interactive graphics over the web. We
present a method that enables generalised Selection and Navigation of
Overlapping SVG Objects by toggling pointer-events CSS styles and the
use of the mousewheel, adding another tool developers can use to grant
users greater and more intuitive interaction with SVG images. We also
present several live examples that demonstrate the method in practice,
both on script generated SVG images and an externally generated SVG image
The gridSVG package has recently provided an interface for
some more advanced SVG graphics features: gradient fills and pattern
fills, clipping paths, masks, and filters. This report describes a
simple test case for some of these advanced graphics features and then
explores some ideas for making use of these features in Statistical
Paul Murrell and Simon Potter
This article discusses the importance of providing structure and labelling within SVG code, particularly when the SVG code is generated indirectly by a high-level system and when the SVG code describes a complex image such as a statistical plot. We argue that this is a desirable goal, but that many high-level systems that generate SVG do not provide sufficient structure and labelling. An example of a system, based on R, that does provide structure and labelling, is described to demonstrate that the goal is acheivable and we highlight the crucial features of this system that we see as important factors in achieving this goal.
Paul Murrell and Simon Potter.
The gridSVG package exports grid images to the SVG image format for viewing on the web. This article describes the problems associated with retaining grid object names in SVG element id attributes. In addition, new features in gridSVG that allow manipulation and retrieval of generated id attributes are discussed. These new features allow for easier and more predictable development of interactivity in plots generated by gridSVG.
Simon Potter and Paul Murrell