gsvg {gWidgetsWWW2} | R Documentation |
This widget displays an svg file, such as is made by the
svg
driver or the devSVGTips
driver in the
RSVGTipsDevice. The basic usage is like gimage
, where
a file that is stored in a place the web browser can serve is used
as the file specified to the device. The convenience method
get_tempfile
(and function) is used to create such a
file. Use the .svg
extension. The widget size is specified
in pixels, but the svg device driver is in inches.
gsvg(f, width = 480, height = 400, container = NULL, ..., ext.args = NULL)
f |
filename. Usually produced by |
width |
width of widget in pixels |
height |
height of widget in pixels |
container |
parent container |
... |
passed to |
ext.args |
Means to pass additional arguments to Ext constructor |
An ExtWidget instance
## Not run: w <- gwindow("hello", renderTo="replaceme") sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w) g <- ggroup(cont=w, horizontal=FALSE) require(RSVGTipsDevice) f <- get_tempfile(ext=".svg") ## use this extension svg(f) hist(rnorm(100)) dev.off() i <- gsvg(f, container=g, width=480, height=480) b <- gbutton("click", cont=g, handler=function(h,...) { f <- get_tempfile(ext=".svg") svg(f) hist(rnorm(100)) dev.off() svalue(i) <- f }) ## End(Not run)