Learn R Programming

BrailleR (version 1.0.2)

MakeAccessibleSVGMethod: Create and display a accessible exploration webpage SVG of graph

Description

Creates the necessary SVG and XML files for a graph object (as long as graph type is supported). Then turns them into a html file and opens it for viewing (if a interactive session) in your browser.

Usage

MakeAccessibleSVG(x,
file = paste0(deparse(substitute(x)), "-SVG"),
view=interactive(), cleanup = TRUE, ...)
# S3 method for ggplot
MakeAccessibleSVG(x,
file = paste0(deparse(substitute(x)), "-SVG"),
view=interactive(), cleanup = TRUE, VI_and_Describe = TRUE, ...)

Value

NULL. This function is solely for the purpose of creating SVG and XML files and displaying them

Arguments

x

a graph object for which a method exists

file

The shared name for the SVG, XML and HTML files to be created. It will also be the title of the html webpage.

view

launch in browser; this is the default when in interactive session

cleanup

Whether the function should remove the svg and xml files after they have bee embedded into the hmtml file.

VI_and_Describe

Whether to include the VI and Describe outputs in the built webpage.

...

arguments passed on to other methods/functions

Author

A. Jonathan R. Godfrey, Volker Sorge and James A. Thompson

Details

This function can be thought of as just a shortcut for quickly creating a SVG webpage for exploration. Each individual step can be done with the SVGThis(), AddXML() and BrowseSVG() functions. Using this is currently the quickest workflow for accessing the SVG features of BrailleR.

More information can be found in the Exploring graphs vignette.

It has support for some of the base plots however you can consider this support deprecated.

References

P. Dengler et al. (2011) Scalable vector graphics (SVG) 1.1, second edition. W3C recommendation, W3C. http://www.w3.org/TR/2011/REC-XML11-20110816/

See Also

SVGThis, AddXML, BrowseSVG

Examples

Run this code
#Base R
#boxplot = boxplot(rnorm(1e4))
#MakeAccessibleSVG(boxplot, view = F)

#attach(airquality)
#scatter = ScatterPlot(x=Wind, y=Ozone, pch=4, base=TRUE)
#detach(airquality)
#MakeAccessibleSVG(scatter)

#ggplot2
library(ggplot2)
tsplot = TimeSeriesPlot(airquality, x=airquality$Temp)
MakeAccessibleSVG(tsplot)

barChart = ggplot(Orange, aes(x = Tree)) +
  geom_bar()
MakeAccessibleSVG(barChart)

histogram = ggplot(attenu, aes(x=dist)) +
geom_histogram()
  histogram
MakeAccessibleSVG(histogram)

# Cleaning up
unlink("barChart-SVG.html")
unlink("histogram-SVG.html")
unlink("tsplot-SVG.html")

Run the code above in your browser using DataLab