Abstract
This chapter explores a powerful two-dimensional graphics format named SVG (scalable vector graphics), which is becoming widely used to represent object-based, vector (nonraster) graphics both on the Web and elsewhere. In addition to displaying scalable plots, the XML-based SVG format provides functionality for interactivity, animation, and a number of filtering effects that allow us to create rich graphical displays, and also to integrate them with Web pages. R can create static SVG displays, and we can post-process them within R as XML documents to add interaction and animation. We show how to provide simple interaction and animation with high-level R functions, and also how to add more customized interaction using R commands that use JavaScript at viewing time. We also discuss how to use both SVG and HTML to create rich “applications” and mash-ups in the Web browser.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Adobe. Flash player software, version 10.3. http://get.adobe.com/flashplayer/, 2011.
Apache Software Foundation. The Apache Batik project: A Java-based toolkit for applications or applets that want to use images in scalable vector graphics (SVG), version 1.7. http://xmlgraphics.apache.org/batik/, 2008.
Gabriel Becker and Duncan Temple Lang. RBrowserPlugin: R in the Web browser. https://github.com/gmbecker/RFirefox, 2012. R package version 0.1-5.
Richard Becker, Allan Wilks, Ray Brownrigg, and Thomas Minka. maps: Draw geographical maps. http://cran.r-project.org/web/packages/maps/, 2011. R package version 2.1.
Alex Berger, Alex Pucher, Alexandra Medwedeff, Andreas Neumann, Andre Winter, Christian Furpass, Christian Resch, Florent Chuffart, Florian Jurgeit, Georg Held, Greg Sepesi, Iris Fibinger, Klaus Forster, Martin Galanda, Nedjo Rogers, Nicole Ueberschar, Peter Sykora, Sudhir Kumar Reddy Maddirala, Thomas Mailander, Till Voswinckel, Tobias Bruehlmeier, Torsten Ullrich, and Yvonne Barth. Carto.net software. http://www.carto.net, 2010.
Bert Bos, Tantek Celik, Ian Hickson, and Hakon Wium Lie. Cascading style sheets, level 2, revision 1 (CSS 2.1) specification. Worldwide Web Consortium, 2011. http://www.w3.org/TR/CSS2/.
Cairo Graphics. Cairo: A 2D graphics library with support for multiple output devices, version 1.1. http://www.cairographics.org, 2006.
Dan Carr, Nicholas Lewin-Koh, and Martin Maechler. hexbin: Hexagonal binning routines. http://www.bioconductor.org/packages/2.6/bioc/html/hexbin.html, 2009. R package version 1.22.
J David Eisenberg. SVG Essentials. O’Reilly Media, Inc., Sebastopol, CA, 2002.
David Flanagan. JavaScript: The Definitive Guide. O’Reilly Media, Inc., Sebastopol, CA, 2006.
Jeffrey Horner. rApache: Web application development with R and Apache. http://rapache.net/, 2011. R package version 1.2.1.
Chafic Kazoun and Joey Lott. Programming Flex 3: The Comprehensive Guide to Creating Rich Internet Applications with Adobe Flex. O’Reilly Media, Inc., Sebastopol, CA, 2008.
Bill Kennedy and Chuck Musciano. HTML and XHTML: The Definitive Guide. O’Reilly Media, Inc., Sebastopol, CA, 2006.
Jake Luciani. RSvgDevice: An RSVG graphics device. http://cran.r-project.org/web/packages/RSvgDevice/, 2009. R package version 0.6.
Eric A Meyer. CSS Pocket Reference. O’Reilly Media, Inc., Sebastopol, CA, 2004.
Paul Murrell. R Graphics. Chapman & Hall/CRC, Boca Raton, FL, 2005.
Paul Murrell. gridBase: Integration of base and grid graphics. http://www.stat.auckland.ac.nz/˜paul/grid/grid.html, 2006. R package version 0.4.
Paul Murrell. gridSVG: Export grid graphics as SVG. http://www.stat.auckland.ac.nz/˜paul/R/gridSVG/gridSVG_0.5-10.tar.gz, 2010. R package version 0.5.
Paul Murrell. grid: The grid graphics package. http://cran.r-project.org/package=grid, 2011. R package version 2.16.0.
Andreas Neumann and Andre Winter. Vector-based Web cartography: Enable SVG. http://www.carto.net/papers/svg/index_e.shtml, 2003.
Deborah Nolan and Duncan Temple Lang. SVGAnnotation: Tools for post-processing SVG plots created in R. http://www.omegahat.org/SVGAnnotation, 2011. R package version 0.9.
Deborah Nolan and Duncan Temple Lang. Interactive and animated scalable vector graphics and R data displays. Journal of Statistical Software, 46:1–88, 2012.
Dave Pawson. XSL-FO: Making XML Look Good in Print. O’Reilly Media, Inc., Sebastopol, CA, 2002.
Tony Plate. RSVGTipsDevice: An RSVG graphics device with dynamic tips and hyperlink. http://cran.r-project.org/web/packages/RSVGTipsDevice/, 2011. R package version 1.0.
Hans Rosling. Gapminder: World. http://www.gapminder.org/world, 2008.
Barry Rowlingson. imagemap: Create HTML imagemaps. http://www.maths.lancs.ac.uk/Software/Imagemap/, 2004. R package version 0.9.
Deepayan Sarkar. Lattice: Multivariate Data Visualization with R. Springer-Verlag, New York, 2008. http://lmdvr.r-forge.r-project.org/figures/figures.html.
Deepayan Sarkar. lattice: Lattice graphics. http://cran.r-project.org/web/packages/lattice/, 2011. R package version 0.19.
John Simpson. XPath and XPointer: Locating Content in XML Documents. O’Reilly Media, Inc., Sebastopol, CA, 2002.
Debby Swayne, Dianne Cook, Duncan Temple Lang, and Andreas Buja. GGobi software, version 2.1. http://www.ggobi.org, 2010.
Duncan Temple Lang. FlashMXML: A simple Flash graphics device for R. http://www.omegahat.org/FlashMXML, 2011. R package version 0.2-0.
Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS. http://www.omegahat.org/RSXML, 2011. R package version 3.4.
Martin Theus. Interactive data visualization using Mondrian. Journal of Statistical Software, 7:1–9, 2002.
Simon Urbanek and TobiasWichtrey. iplots: Interactive graphics for R. http://cran.rproject.org/web/packages/iplots/, 2011. R package version 1.1.
W3Schools, Inc. JavaScript tutorial. http://www.w3schools.com/JS/default.asp, 2011.
W3Schools.com. SVG tutorial. http://www.w3schools.com/svg/default.asp, 2011.
Hadley Wickham. ggplot2: An implementation of the Grammar of Graphics. http://cran.r-project.org/web/packages/ggplot2/, 2010. R package version 0.8.
Carl Worth and Keith Packard. Cairo: Cross-device rendering for vector graphics. http://cworth.org/˜cworth/papers/xr_ols2003/, 2003.
Yihui Xie. animation: A gallery of animations in statistics and utilities to create animations. http://cran.r-project.org/web/packages/animation/, 2011. R package version 2.0.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer Science+Business Media New York
About this chapter
Cite this chapter
Nolan, D., Lang, D.T. (2014). Scalable Vector Graphics. In: XML and Web Technologies for Data Sciences with R. Use R!. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-7900-0_16
Download citation
DOI: https://doi.org/10.1007/978-1-4614-7900-0_16
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-7899-7
Online ISBN: 978-1-4614-7900-0
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)