| NEWS | R Documentation |
NEWS file for the gridSVG package
Changes in version 1.7-7
Protect against psychotic polygons and polylines fromggplot2 that have an
idcomponent full ofNAs(fromgeom_smooth(se=TRUE)with too few points to generateribbon).Thanks to Niranjan Kalaiselvan for the bug report.
Changes in version 1.7-6
Fix in
escapeXPath()for “the condition haslength > 1” error. Thanks to Dzimitry Markouski.Fixes for problems found by
tools::checkS3methods().
Changes in version 1.7-4
Fix in
feColorMatrix()for “length > 1 incoercion to logical” error. Thanks to CRAN testing and Brian Ripley!
Changes in version 1.7-3
Internal implementation change to avoid assigning valuesinto baseenv.
Changes in version 1.7-2
Simpler and better transformations for exportedSVG <image> elements.
Better protection against
NAvalues in labelsin text grobs. Reported by Daniel Barnett.
Changes in version 1.7-1
Fix for evaluation of arguments passed to
pdf()device withingridsvg().Patch provided by Philipp Angerer.
Avoid peeking at internal representation ofgrid units.
Changes in version 1.7-0
Update for addition of
pathIdargument ingrid.path.
Changes in version 1.6-1
Additional fix for
pch=NA
Changes in version 1.6-0
Generation of SVG from
grid.export()is now much faster(when you are drawing many rectangles, points, circles, or lines).
Changes in version 1.5-1
Fix to ensure that
rattribute in radial gradientsis non-negative.Fix for strict attribute checking now includes presentationattributes.
Fix forgtable support when grob in table cell hasviewport with non-centering alignment (e.g., aggplot2plot with more than one legend). Reported by Tauno Metsalu.
Switched JSON library fromRJSONIO tojsonlite.gridSVG no longer needs to compile C code as it can importa base64 encoding method fromjsonlite.
Bug fix to handle exporting par(lty="blank"), e.g., fromboxplot() (converted withgridGraphics). Thanks to VolkerSorge.
Bug fix to handle pch=NA. Thanks to Volker Sorge.
Changes in version 1.5-0
Added
strictargument forgrid.export()andgridsvg()to allow control over whether SVG attributesare checked for validity.Added
rootAttrsargument forgrid.export()andgridsvg()to allow control over attributes oftop-level<svg>element. Suggestion and original patchfrom Thell Fowler.
Changes in version 1.4-4
Fixed bug where
gpar(col=c(foo="red"))would not work(the namefoois now stripped). Reported by Simon Anders.Fixed bug in feColorMatrix(). The color matrix requiredtransposing before export to SVG.
Fixed bug in feComponentTransfer(). Was generating anfeColorMatrix elementand was inlining transfer functionsas attributes (rather than generating feFunc elements as children).
Added support for NA values in locations and dimensionsof graphical primitives.
Changes in version 1.4-3
Non-SVG style attributes are nowremoved (with awarning) and this is donebefore checking attributes forlength equal to 1.
This was in response to a problem reported by Wolfgang Huber.
Fix evaluation of arguments when using the 'gridsvg' device.These were not being evaluated before being passed to 'grid.export'.
Also reported by Wolfgang Huber.
Changes in version 1.4-2
Fixed export of clip grob (reported by Matthew Plourde).
Fixed support for primitiveUnits="bbox" in filterEffect().
Fix memory initialisation problem in base64 C code.
Reported in valgrind testing by Brian Ripley.
Changes in version 1.4-1
Fixed raster export so that original raster is neverexported at a resolution LOWER than its native resolution.
Added forceGrob() methods so that animations, garnishing,hyperlinks, etc are retained if a grob is forced.
Fix for export of downViewport(path) when the depth of theresulting navigation is greater than depth(path).
The visible manifestation of this bug was that <g> elements weregenerated with an incorrect (too long/wrong depth) 'id' attribute.
Changes in version 1.4-0
Bumped R version requirement to R >= 3.1.0 because thisversion of gridSVG depends on some new exports from 'grid'
Removed all nasty peeks into grid namespace (hencedependence on R 3.1.0).
Tweaks to tests/ to make it easier to do QC checks.
Changes in version 1.3-0
Added support for rotated viewports(previously, rectangles, text, rasters, and clipping rectsdid not export properly, if drawn within a rotated viewport)
Includes changes to rendering, animation, and coordinate systemexport and conversion.
Fixed bug in viewportConvertWidth() andviewportConvertHeight() when converting from "native".
Bug fix for positioning grobs with dimensions when aviewport's x-scale or y-scale is "flipped". (Simon)
Reposition <defs> so that definitions are always availablewhen used. Allows renderers like librsvg to render gridSVG imagescorrectly. For consistency, pch definitions are also pushed into thesame <defs> element. (Simon)
Bug fix for 'lwd'. They are now defined as being 1/96 inches,which matches most graphics devices. (Simon)
Only one 'gridsvg' device can now be open at once. This isbecause referenced content (like gradients, masks, etc) can haveside effects across multiple 'gridsvg' devices. (Simon)
New argument for 'grid.export()', 'progress'. When thisargument is 'TRUE', messages will be printed to the console thatshow how far gridSVG is through processing an image. Additionally,progress bars are drawn to aid in estimation of progress. (Simon)
New argument for 'grid.export()', 'compression'. This can takean integer value between 0 and 9 that describes the level of (gzip)compression applied to the exported image. (Simon)
Added 'group', 'strict', 'grep', and 'global' argumentsto grid.animate() (to bring it into line with grid.hyperlink()and grid.garnish().
Now Import rather than Depend on other packages.
Changes in version 1.2-0
The main change in this version involves taking advantage ofchanges in R version 3.0.0, which introduced a
grid.force()function. This reduces the need for special methods in this packageto draw custom grobs.Renamed 'gridToSVG' to 'grid.export'. 'gridToSVG' is nowdeprecated and will produce a warning but will still work.'grid.export' should be used from now on. (Simon)
Renamed 'grid.export' arguments forconsistency. 'export.coords', 'export.mappings', and 'export.js' arenow camelCased to 'exportCoords', 'exportMappings', 'exportJS'respectively. (Simon)
Bumped R version dependency to R >= 3.0.0 because
gridToSVG()now callsgrid.force()before exportRemoved several
primToDev()methods:primToDev.xaxis()primToDev.yaxis()grobToDev.roundrect()grobToDev.frame()grobToDev.cellGrob()
Bug fix for multi-line text when cex != 1
Initial implementation of pattern fills. Define pattern fillsusing 'pattern' and 'registerPatternFill' (and also'registerPatternFillRef' to reuse an existing definition). These canthen be applied to grobs using 'grid.patternFill' and'patternFillGrob'. (Simon)
Add a graphics device-like interface to gridSVG. Use 'gridsvg'to open a gridSVG device, and 'dev.off' to close it. (Simon)
Added new 'gridSVG.newpage' function. It will clear alldefinitions of referenced content as well as calling'grid.newpage'. (Simon)
Now allowing for a prefix to be applied to all SVG IDattributes. Particularly useful when including multiple gridSVGimages in the same document as it ensures uniqueness of IDs betweendocuments. This can be used by specifying the 'prefix' argument to'grid.export'. (Simon)
New optional parameter to 'grid.export', 'addClasses'. If thisargument is 'TRUE', then gridSVG will add an SVG class attribute toeach grob or viewport it draws. The value of this attribute is whatis produced by calling 'class' on the object. This is useful forallowing a convenient way of selecting more than one type of grob(e.g. the '.axis' CSS selector will select all axis grobs). (Simon)
Added implementation of gradient fills for grobs. See'linearGradient', 'radialGradient', and 'registerGradientFill' fordefining gradients. Use 'grid.gradientFill' and 'gradientFillGrob'to apply gradient fills to grobs. (Simon)
Bug fix for pointsGrobs. 'size' units were unnecessarily beingmanipulated. They should now be sized more accurately. (Simon & Paul)
Added support for non-rectangular clipping paths. Use'grid.clipPath' and 'clipPathGrob' for applying clipping paths togrobs. Use 'pushClipPath' for applying to the current viewport,which behaves similarly to 'grid.clip'. Uses an object produced by'clipPath' as the definition for the clipping path and is registeredby calling 'registerClipPath'. (Simon)
Added support for opacity masks. Use 'grid.mask' and'maskGrob' to apply opacity masks to grobs. Use 'pushMask' forapplying to the current viewport, which behaves similarly to'grid.clip'. Uses a grob as the definition for an opacitymask. Define the mask using 'mask' and 'registerMask'. (Simon)
New function 'popContext', which stops the effect of'pushMask' and 'pushClipPath'. (Simon)
Bug fix for 'clipGrob's. Now unwinds only when a viewport ispopped and just not any grouped content. (Simon)
Added support for SVG filter effects. Create a filter effectby calling 'filterEffect' and adding as its children some of thevarious filter effect primitives by calling 'fe*' functions. Some ofthese filter effects are quite complicated so reading the functiondocumentation and the SVG specification is required. Apply filtereffects to grobs using 'grid.filter' and 'filterGrob'. (Simon)
Bugfix for unit conversion functions. "svg" was not beinghandled correctly. (Simon)
Bugfix for arrows. Definition now matches 'grid'. Now alsohandles the case when an arrow's line width is greater than itswidth/height (Firefox would not show the arrow prior to thisfix). (Simon)
Bugfix for polygons and xsplines. They should now handle thecase where an 'id.length' is 0. (Simon)
Plain SVG text can now be inserted into the image (in asimilar manner to 'grid.element') using 'grid.textNode'. (Simon)
Bugfix 'childrenOrder' is now respected for gTrees.
Bugfix for colours. 0 is now valid (but transparent). (Simon)
Fix for garnishing. They should now always be applied over thetop of existing SVG attributes. (Simon)
Bug fix for fill in arrow heads on xsplines (was beingforced to transparent)
Bug fix to trim identical values from start and end ofxspline points (otherwise auto calculation of arrow orientationcan get confused)
Changes in version 1.1-0
Added options for 'vpPath' and 'gPath' separators. This allowsfor easier manipulation in JavaScript as the separators no longerneed to be the troublesome '::' (which require escaping with CSSselectors). (Simon)
Exporting HTML files is now optional. (Simon)
Always return a named list with the output of'gridToSVG()'. This is invisibly returned when an SVG file is savedto disk. (Simon)
Added 'usePaths' option for determining whether to use vpPathsand gPaths SVG IDs. (Simon)
Added 'uniqueNames' option for generating unique names for SVGIDs from grob and viewport names. This further distances ourselvesfrom the original grid names. (Simon)
Added 'export.mappings' option for exporting name mappinginformation. This allows us to keep track of names and how they havebeen modified by gridSVG. (Simon)
Added 'gridSVGMappings' function to import mappinginformation. (Simon)
Added 'getSVGMappings' function to retrieve IDs generated foran image from a grob or a viewport name. Also exported are CSSselectors and XPath expressions. These can also be retrieved by'getSVGMappings'. (Simon)
Added new generic element interface, 'grid.element'. Allowsany arbitrary SVG element (or tree of elements) to be inserted intothe resulting SVG image. (Simon)
When using the 'grep' argument for 'grid.hyperlink' and'grid.garnish', we can now apply effects to multiple grobs wheregPaths are regular expressions. (Simon)
Added a new optional argument to 'gridToSVG', called'annotate'. If 'TRUE', adds an SVG 'metadata' element below the root'<svg>' element that provides information on how 'gridToSVG' wascalled, along with metadata about gridSVG itself. Potentially usefulfor debugging. (Simon)
Including support for 'clipGrob's. (Simon)
Add support for 'gpar()'s 'lex' parameter. (Simon)
Changes in version 1.0-0
Initial implementation of viewport coordinate informationexporting. (Simon)
Added support for coordinate system importing and unitconversion. (Simon)
Added support for exporting a JS file with utility functionspresent. Of note is that these include JS implementations of unitconversion routines. (Simon)
Using viewport paths instead of viewport names for groupelements. This causes us to refer to clipping paths and coordinateinformation based on the path. Viewport paths still have a numericsuffix. (Simon)
Script MIME type updated to be more compatible with the SVGspec. (Simon)
Added call to 'grid.refresh()' when running 'gridToSVG()' inorder to avoid seeing a blank page. (Simon)
Axis sub-grobs now adhere to the common gridSVG namingscheme. (Simon)
All markup-based output is now written using the 'XML'package. (Simon)
Added a new option to 'gridToSVG()', 'res'. This sets thedevice resolution so that we can reproduce plots regardless of thesource device that 'gridToSVG()' grabs a grid scene from. (Simon)
Added a new option to 'gridToSVG()', 'indent'. This eitherexports SVG with hierarchical indentation, or none at all. Alloutput occurs in one line in the case that the 'indent' option is'FALSE'. (Simon)
Making the XML declaration optional. This means that insertingSVG straight into an HTML5 document is more easily done because thedeclaration is not necessary with inline SVG. (Simon)
When the filename is set to 'NULL' or '""' return the SVGdocument as a list containing the root SVG node reference,coordinate data (list) and JS utility functions (charactervector). (Simon)
Use 'person()' in the DESCRIPTION file. (Simon)
Reimplement 'pointsGrob's as SVG '<symbol>'s, referenced by'<use>' elements. Many more 'pch's are now animatable anddrawable. Furthermore, the definitions of 'pch's now matchesR's. (Simon)
Added 'commentGrob' which writes comments when exported toSVG. (Simon)
Use data URIs for 'rasterGrob's to embed images inline inSVG. Allows us to truly create standalone SVG files, rather than SVGwith a lot of referenced PNGs. Lifted C code from the 'markdown'package (permissive licence) to do the job. Just keeping a verysmall subset of the C code ('markdown' does a lot of cool stuff thatwe don't need). (Simon)
Bug-fix for 'gpar()'s, support 'font' as an alias for'fontface'. In particular it affected some 'ggplot2' plots. (Simon)
Adding in support for 'gtable' grobs as 'ggplot2' usesthem. Requires borrowing code from 'gtable' to keep the packagechecker happy. (Simon)
Small fix to avoid error from text justification outside the 0to 1 range (by clamping justifications to the 0 to 1 range).
Added 'viewBox' attribute to top-level <svg> element.
Adding 'show' argument to 'grid.hyperlink()'. Allows links toopened in another window/tab rather than the currentwindow/tab. (Simon).
Added new functions to support global package options, pluscreated a global option to control the separator used whenappending a number suffix to grob names for SVG element ids.
Added 'grep' argument to grid.hyperlink()(suggestion by Oscar Perpignan Lamigueiro).
Changes in version 0.9-4
Added dependency on R >= 2.15.0
(plotmath location depends on 'grobAscent()')
'gridToSVG()' now copes with empty text, e.g.,'grid.text("")'.
SVG elements are still produced (so that there is something in theSVG doc that corresponds to the original grid grob), but nothingshould be drawn when the SVG doc is viewed.
Reported by Gabriel Becker.
'gridToSVG()' no longer ignores 'hjust' and 'vjust' in'grid.rect()'.
Reported by Gabriel Becker.
Conversion of points grobs for 'pch=15:20' now sets colourscorrectly (used to be wrong if points grob did not have explicit'gpar(col)' setting).
Improved animation of x/y/size for points grobs.
Now works for pch=0,1,2, 5,6, 15–25
(i.e., does not work yet on symbols that are combinations of shapes)
Fixed problem with raster aspect ratio.
Fixed problem with animating raster grobs when width and/orheight are not specified.
Fixed bug in animating segments grobs (used to just not work).
Added support for 'roundrect' grobs.
Added support for 'move.to' and 'line.to' grobs.
Rounding more SVG attributes to 2dp, only a few were missedearlier. (Simon)
Points grobs for 'pch=15:20' now check whether there is anexplicit 'gpar(col)'. If so, the fill is set to that, otherwise thisis retrieved from the viewport. (Simon)
Changes in version 0.9-0
Added dependency on R >= 2.13.0
('grid.grab(wrap=true)' only works with bug fix in r54813).
Replaced partially matching arguments with full argumentnames. (Simon)
Added plotmath support (outputs MathML).
Note that positioning of MathML output is VERY unlikely to beaccurate because there is not only the problem of font differencesBUT ALSO the problem of a different math formula layout engine!
Changed 'x11()' to 'dev.new()' in 'tests/*.R' code.
Added animation support for polygon grobs and path grobs.
Changed translation of rasterGrob grobs to SVG elements. Theyare now an '<image>' wrapped in two '<g>'s.
The outer '<g>' provides a translation; the inner '<g>' provides ascaling; and the image is at (0, 0) and size (1, 1). This allows for...
Added animation support for 'rasterGrob' grobs.
Added animation support for 'xsplineGrob' grobs.
Note that closed xsplines are unlikely to animate smoothly (becausethe result is an animated '<path>' with a variable number ofoperations).
Added 'group' argument for 'grid.hyperlink()'.
Changes in version 0.8-0
Started rounding all numeric values to 2 dp (in SVG output).
Added 'animValue' and 'animUnit' classes to somewhat formalisethe specification of animation values for attributes.
Removed the 'id' argument from 'grid.animate()'.
Added 'begin' argument to 'grid.animate()'.
Added 'animation' vignette, which describes how to specifyanimation values for 'grid.animate()'.
Named top-level gTree 'gridSVG' (and therefore '<gid="gridSVG">').
Added 'inline' argument to 'grid.script()'.
Added 'group' argument to 'grid.garnish()' so that attributescan be applied EITHER to the parent '<g>' (the default) OR to theindividual child elements.
Changed conversion of graphical parameters.
Instead of creating a single 'style' attribute in each element, nowcreate individual SVG presentation attributes, like 'fill' and'fill-opacity'.
Also, ONLY record explicit 'gp' settings, rather than ALWAYSrecording ALL current settings for ALL elements.
Modified 'grid.garnish()' so that we can garnish the samegrob multiple times (without overwriting previous garnish).
Modified 'grid.animate()' so that we can animate the same grobmultiple times (without overwriting previous animation).
Added 'group' argument to 'grid.animate()' so that animationcan apply EITHER to the individual child elements (the default) ORto the parent '<g>'.
Added vignette on extending the 'gridSVG' package.
'vignette("extensibility")'
Added 'interpolate' argument to 'grid.animate()' (onlycurrently supports 'linear' or 'discrete').
Implemented animation for segments grobs.
Improved recording of viewports and vpPaths, when depth isgreater than 1 (e.g., a vpStack). Now all viewports (not just thelast one) are recorded as '<g>' elements.
Changes in version 0.7-0
Added support for polyline grobs (Simon)
Polygon grobs now respect the 'id' parameter (Simon)
Semi-transparent colours can now be applied, making use ofSVG's 'fill-opacity', 'stroke-opacity' and 'opacity'attributes. (Simon)
xsplines can be drawn. Currently uses the '<polyline>' or'<path>' elements depending on whether the xspline is open orclosed. (Simon)
Lines, segments, polylines and xsplines now support the arrowparameter. (Simon)
Grobs that produce multiple SVG elements now wrap the multipleelements in a '<g>' with the original grob name on the '<g>' and themultiple elements name-mangled with an integer suffix. (Simon)
Multiline text support added. (Simon)
Text with multiple labels no longer draw all labels at eachlocation. (Simon)
Line properties such as 'linejoin' and 'lineend' are nowunderstood. (Simon)
The 'gpar()' properties 'font'/'fontface' and 'fontfamily' arenow supported. 'fontface' has a direct mapping to CSS, but'fontfamily' is a little bit more messy. 'fontfamily' has to specifyfallback fonts if none are present in the browser. The 'serif','sans' and 'mono' families are given a reasonable attempt. (Simon)
Naming of grobs has been refactored into a function call'subGrobName()'. To get the base name of the grob again, use'baseGrobName()'. This allows an easier switch to a different namingscheme if necessary. (Simon)
Initial support for 'frameGrob's (and 'cellGrob's). (Simon)
Numerical justification of text is supported. Justificationparameters are rounded so they belong to one of
c(0, 0.5, 1). (Simon)'gTree' support has been improved, all 'lattice' demos can nowbe drawn, along with some 'ggplot2' plots (assuming 'pch's aresupported). (Simon)
The HTML file that is produced now rounds the 'height' and'width' attributes to the nearest integer to avoid scrollbarsbecoming visible. (Simon)
Warnings are no longer produced regarding unclosedconnections. (Simon)
'pch's 0:25 and 32:127 are supported. (Simon)
Clipping to viewports is now possible. This occurs at thegroup level so that when a viewport is pushed to, its name is nowsuffixed with the number of the viewport that has been pushedto. (Simon)
Changes in version 0.6-0
Updated for the fact that the R graphics engine now supportscomplex paths.
Removed 'grid.path()' and 'pathGrob' from this package (nowin 'grid' package).
Removed 'svgGrobify()' (the normal 'grobify()' in 'grImport'now handles complex paths).
Tweaked passage of 'grid' pathgrob through generic device toSVG device.
Changes in version 0.5-10
Conversion of 'gpar()' to SVG CSS now recognises 'fillrule'(so that pathgrobs [and polygons] can specify "nonzero" or"evenodd")
'svgGrobify()' passes 'object@rule' from PictureFill objectsto 'gpar()' so that 'fill' and 'eofill' from imported images will berepresented by appropriate paths in SVG.
The current locale encoding (i.e., the encoding used to writethe SVG file) is now recorded in the SVG file.
Changes in version 0.5-8
The following changes occurred between versions 0.5-3 and 0.5-8.
Added 'redraw' argument to 'grid.garnish()'
Improved sizing of text (especially when it is controlled via'cex')
Correction for rotated text (SVG measures angles clock-wise)
Improved recording of SVG 'style' attribute so that it handlesvectorized settings better.
Improved recording of 'lty' setting in SVG output.
Forced ALL gpar settings from grid to SVG output (i.e., nolonger have to EXPLICITLY set gpars).
Added checks for XML specials when producing SVG output.
Improved sizing of text (and line widths) to be responsive todevice resolution.
Added 'grid.path()' and 'pathGrob()' which can be used to drawpolygons with holes (when producing SVG output).
Added 'svgGrobify()' which uses 'pathGrob()' when converting aPicture from 'grImport' to grobs.
Changes in version 0.4
Updated properly for R 2.0.0
Hyperlinks work the same as before, but Animation now worksdifferently: you animate an entire grob rather than an individualunit.
Integrated changes from Nathan Whitehouse and colleagues tosupport arbitrary SVG attributes and script chunks.
SVG shape chunks now use grid grob names for the id attribute.
If more than one chunk is produced then a 1:n suffix isattached. For example, 'grid.circle(r=1:4/8, name="circgrob")'produces four '<circle>' chunks with id's "circle1" to "circle4",but 'grid.rect(name="rectgrob")' produces a single '<rect>' chunkwith id "rectgrob".
Added NAMESPACE.
Changes in version 0.3
Minimal update to get version that runs with grid in R 1.9.*
Changes in version 0.2-1
The following changes occurred between version 0.2 and 0.2-1.
Changed implementation of lpaste from recursive to loop (toavoid "evaluation nested too deeply" problems)
Fixed up [cx|cy].time.unit for case where only one of x|y is a"time.unit". Used to not replicate the "normal" unit correctly.