Description Usage Arguments Value Examples
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.
1 2 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.