Skip to content

Releases: svgdotjs/svg.js

Release 3.0.0

01 Dec 21:49
Compare
Choose a tag to compare

Added

  • added text() method to SVG.Path to create a textPath from this path (#705)
  • added SVG.HTMLNode which is the object wrapped around html nodes to put something in them
  • added dispatch() method on SVG.Element which returns the dispatched event for event cancelation (#550)
  • added isRoot() on SVG.Doc (#809)
  • added a linter during the npm build process
  • added beziere() and steps() to generate easing functions
  • added insertAfter() and insertBefore
  • added SVG.Style which can be created with style() or fontface() (#517)
  • added EventTarget which is a baseclass to get event abilities (#641)
  • added Dom which is a baseclass to get dom abilities
  • added round() which lets you round attribues from a node
  • added ax(), ay(), amove() to change texts x and y values directly (#787)
  • added possibility to pass attributes into a constructor like: new SVG.Rect({width:100})
  • added possibility to pass in additional attribues to element creators e.g. canvas.rect({x:100}) or canvas.rect(100, 100, {x:100}) (#796)
  • added SVG.List (#645)
  • added words() and element() to Dom because of (#935)
  • added lab, lch, hsl and cmyk color spaces (#790)
  • added random() method on SVG.Color to create random colors of different kinds (#939)

Removed

  • removed SVG.Array.split() function
  • removed workaround for browser bug with stroke-width
  • removed polyfills
  • removed SVG.Set in favour of SVG.List
  • removed feature to set style with css string (e.g. "fill:none;display:block;")
  • removed loaded() and error() method on SVG.Image (#706)
  • removed sub-pixel offset fix
  • removed SVG.Nested (#809)
  • removed show() from SVG.A to avoid name clash (#802)
  • removed size() from SVG.Text to avoid name clash (#799)
  • removed native() function
  • removed Bare in favour of Dom (#935)

Changed

  • gradients now have there corresponding node as type and not only radial/linear
  • SVG.Path.pointAt() correctly returns an SVG.Point now
  • replaced static reference to masker in SVG.Mask with the masker() method
  • replaced static reference to clipper in SVG.ClipPath with the clipper() method
  • replaced static reference to targets in SVG.Mask and SVG.ClipPath with the targets() method
  • moved all regexes to SVG.regex
  • new constructor signature for SVG.Image and load(): container.image(src, callback) / image.load(src, callback) (#706)
  • changed style() to css(). Now accepts array as input and returns object when no argument given (#517)
  • ids are not generated upon creation anymore. Instead they are generated when requested (#559)
  • SVG.extend() now expects exactly one module or an array of modules
  • SVG.Text.path() now returns an instance of SVG.TextPath (#705)
  • SVG.Text.path() does not move all contents to the textPath (#705)
  • SVG.TextPath now inherits from SVG.Text and can be manipulated the same way (#705)
  • SVG.Text.textPath() returns the first textPaths in the text element (#705)
  • renamed SVG.Stop constructor at() on SVG.Gradient to stop() (#707)
  • renamed fill() method on SVG.Gradient and SVG.Pattern to url() (#708)
  • renamed previous() method to prev()
  • changed childNodes to children (same for firstChild, lastChild, ...) (#710) - changed it back because of performance drop
  • moved defs() method from SVG.Parent to SVG.Element
  • SVG() can be called with css selector, node or svg string, now. Without an argument it creates a new SVG.Doc() (#646)
  • add(), put(), addTo(), putIn() now excepts all arguments accepted by SVG()
  • all SVG.* objects now can have a node as parameter when constructing
  • SVG() does not set a default size anymore
  • default constructor now has an optional node argument which is used to consruct the object e.g. new SVG.Rect(rectNode)
  • SVG.Elements constructor now tries to import svgjs:data from the node
  • SVG.on() calls the listener in the context of the passed object. el.on always uses the svg.js object as context
  • SVG.on()/off() and el.on()/off() now accepts multiple comma or space separated events e.g. "mousedown, foo bar" (#727)
  • Matrices now apply transformations like scale, translate, etc... by left multiplying them to simplify transformations
  • The way transform() works is now completely different. See the docs for more as soon as they are updated
  • merged SVG.Doc and SVG.Nested, added isRoot() on SVG.Doc() (#809)
  • The fx module was completely reworked to be faster and less error prone. For more information on how to use it refer to the docs
  • The whole lib is now splitted into es6 modules (#875)
  • Element.svg() now can can replace the current node, can export the children of a node and can take an export modifier to change/replace the exported nodes
  • ungroup() now breaks off one container and not more
  • clone() does not add the clone to the dom anymore
  • attr() excepts array now to get multiple values at once
  • SVG.Text.rebuild() now takes every font-size into account (#512)
  • fill() and stroke() return the fill and stroke attribute when called as getter (#789)
  • parents() now gives back all parents until the passed one or document
  • Image callback passes normal load event instead of custom object (#931)
  • renamed Doc to Svg and doc() to root (and toDoc()/toRoot()) (#932)

Release 2.7.1

30 Nov 09:10
Compare
Choose a tag to compare

CustomEvent-polyfill was not used (needed in IE) (#938)

Release 2.7.0

13 Nov 20:13
Compare
Choose a tag to compare

Fixed

  • fixed calling parent() on documentFragments children (#927)
  • parser is not focusable anymore (#908)
  • SVG.Element.click(null) correctly unbinds the event (#878)
  • fix memory leak (#905)

Added

  • SVG.Set now accepts another Set as input (#893)
  • on()/off() accepts multiple event names as input (backport from 3.0)

Release 2.6.5

26 May 20:57
Compare
Choose a tag to compare

Fixed

  • fixed element.parent() which sometimes failed when used on detached documents (#759)
  • fixed SVG.Text.y() which didnt work correctly with SVG.Number (#778)
  • fixed SVG.Doc.clone() which throwed an error (#782)
  • fixed SVG.Mask.clone() which throwed an error (#782)
  • fixed SVG.PointArray having a reference to outside array in some cases (#803)
  • fixed reference() which failed when trying to use a reference which does not exist in the attribuets (#840)
  • fixed animate().attr() method which doenst work for d attribute of paths (#847)
  • fixed problems with CustomEvent polyfill in IE11 (#852)

Added

  • added possibility to pass an array of point objects to SVG.PointArray (#803)

Release 2.6.4

07 Feb 22:12
Compare
Choose a tag to compare
  • fixed memory leak when creating images (#805)

Fixing bug in standalone svg with images

21 Jul 12:55
Compare
Choose a tag to compare

Fixed

  • fixed error in parent method when hitting document node (#720)

Fixed a few bugs in the fx module

05 Jun 09:37
Compare
Choose a tag to compare

Added

  • added width() and height() methods to SVG.FX
  • added the intended functionality to call animate functions with multiple parameter (#671)

Changed

  • updated Jasmine from 2.5.2 to 2.6.0
  • removed the typeof check in the initialisation of SVG.Matrix

Fixed

  • fixed SVG.FX.once so that it add its callback on the last situation instead of the current one
  • fixed SVG.FX.step so that the animation doesn't stop if an afterAll callback call animate (#677)

Release 2.6.1 - fixes crucial bug in path parser

25 Apr 10:09
Compare
Choose a tag to compare

Add `options` to `on()`, back to sloppy mode

21 Apr 10:52
Compare
Choose a tag to compare

Added

  • added options object to SVG.on() and el.on() (#661)

Changed

  • back to sloppy mode because of problems with plugins (#660)

Release 2.5.3 - typescript fixes

17 Apr 15:21
Compare
Choose a tag to compare

This release fixes the typescript definition file as well as a bug with el.flip() which does not correctly flipped the shape when called without any argument