All notable changes to this project will be documented in this file.
The document follows the conventions described in “Keep a CHANGELOG”.
====
point()
by not creating intermediate objects (#1251)assignNewId
to clone()
to allow cloning with the same id (#1161)css()
returning camelCased properties even though they were specified in kebap-caseObjectBag
loosing information when calling valueOf()
(Numbers lost its unit)parents()
(#1235)nodeOrNew()
to work in object tags as well (#1219)zoom()
method of runner which was passed a wrong parameterTSpan
to position them by its bounding boxflip()
method which flips correctly by center by default now and accepts correct argumentsrbox()
where not always all values of the box were updatedgetOrigin()
function used by transform()
so that all origin popssibilities specified in the docs are working (#1085)amove()
put()
and parent()
put()
which correctly creates an svgjs object from the passed element now before returningparent()
which correctly returns a Dom instance when parent is the document or document-fragmentadd()
which correctly removes namespaces of non-root svg elements now when added to another svg element (#1086)isRoot()
which correctly returns false, if the element is in a document-fragmentreplace()
which works without a parent now, toodefs()
which correctly returns null
when called on a detached node that is not a root nodereference()
which correctly returns null
instead of throwing when specifying an attribute which holds a numberflatten()
which correctly flattens now but doesn’t accept parameters anymore (makes no sense)ungroup()
which now inserts the elements at the correct position in the correct order and has position as second argument nowposition
for transform()
to also allow a position of 0bbox()
of PathArray
and PointArray
which returns an instance of Box
nowPID
controller and makeSetterGetter functionQueue.push
which didnt let you push queue itemsTimeline.reverse()
which did exactly the opposite of what you would expect when passing true/false
clone()
to return the correct instance (#1154)SVG(el, isHTML)
which allows to explicitely create elements in the HTML namespace (#1058)unlink()
and linker()
to hyperlinked elements to remove or access the underling <a>
elementwrap()
method to Dom
which lets you wrap an element by another oneorient()
method to Marker
options
parameter to dispatch()
and fire()
to allow for more special needsnewLine()
constructor to Text
to create a tspan marked as new line (#1088)Fragment
as a wrapper for document-fragmenttoParent()
toRoot()
data()
methodList.each()
so that it mostly behaves like mapPointArray.transform()
similar to Pointwith-last
as when
to animate
and schedule
to let an animation start with the start of the last one in the timelineA
(#1110)Matrix.compose()
method which did the same as new Matrix()
or Matrix.transform()
Path.morph()
and Path.at()
which was replaced with Morphables in v3when
and delay
to animate()
el.transform('scale')
)ForeignObject
to the coretextPath()
, path().text()
and text().path()
root()
methodattr
. Can be missleading if present.findOne()
for better performanceunit()
to convert()
due to name collisionto()
as unit()
of SVG.Number
which was removed accidentallyisNulledBox()
and domContains()
getElementsByTagName
with querySelector
attr
more restrictive to prevent expensive toString
font()
which set wrong valuesPointArray.transform()
(#945)parser
which didnt have all required css rules and not focusable=falsex(), y(), width(), height(), dx(), dy()
now correctly change the bbox of the group by moving/resizing all childrenfinished
too earlyAnimator.frame()
. The passed callback gets the current time now (same as RAF)loop(true)
which is the same as loop()
zoom
which was added correctly and is animatable nowRunner
which merges transformations on the correct frame and in the correct way nowTimeline
which executes Runner in the correct order nowSvg
which correctly deletes the defs reference on clear()
Runner
which correctly retains transformations when it is still on a timelineplot()
method of Runnertimeline()
so that one can set the timeline of an element nowG
and added missing width/height
List
which still didn’t have all method names it should haveRunner
which correctly handle retargeted controlled animations nowRunner
so that it is able to be persisted correctlyColor
which correctly handles empty strings nowattr
which correctly handles Objects of other kind nowMorphable
which correctly calculates the done flag nowinsertBefore
, insertAfter
and flip
correctly returning this
List
which didn’t have all method names it should havetext()
method to SVG.Path
to create a textPath from this path (#705)SVG.HTMLNode
which is the object wrapped around html nodes to put something in themdispatch()
method on SVG.Element
which returns the dispatched event for event cancelation (#550)isRoot()
on SVG.Doc
(#809)beziere()
and steps()
to generate easing functionsinsertAfter()
and insertBefore
SVG.Style
which can be created with style()
or fontface()
(#517)EventTarget
which is a baseclass to get event abilities (#641)Dom
which is a baseclass to get dom abilitiesround()
which lets you round attribues from a nodeax(), ay(), amove()
to change texts x and y values directly (#787)new SVG.Rect({width:100})
canvas.rect({x:100})
or canvas.rect(100, 100, {x:100})
(#796)SVG.List
(#645)words()
and element()
to Dom
because of (#935)random()
method on SVG.Color
to create random colors of different kinds (#939)SVG.Array.split()
functionSVG.Set
in favour of SVG.List
loaded()
and error()
method on SVG.Image
(#706)SVG.Nested
(#809)show()
from SVG.A
to avoid name clash (#802)size()
from SVG.Text
to avoid name clash (#799)native()
functionBare
in favour of Dom
(#935)bower
support because it is deprecatedSVG.Path.pointAt()
correctly returns an SVG.Point
nowmasker
in SVG.Mask
with the masker()
methodclipper
in SVG.ClipPath
with the clipper()
methodtargets
in SVG.Mask
and SVG.ClipPath
with the targets()
methodSVG.regex
SVG.Image
and load()
: container.image(src, callback) / image.load(src, callback)
(#706)style()
to css()
. Now accepts array as input and returns object when no argument given (#517)SVG.extend()
now expects exactly one module or an array of modulesSVG.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)SVG.Stop
constructor at()
on SVG.Gradient
to stop()
(#707)fill()
method on SVG.Gradient
and SVG.Pattern
to url()
(#708)previous()
method to prev()
childNodes
to children
(same for firstChild
, lastChild
, …) (#710) - changed it back because of performance dropdefs()
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()
SVG.*
objects now can have a node as parameter when constructingSVG()
does not set a default size anymorenode
argument which is used to consruct the object e.g. new SVG.Rect(rectNode)
SVG.on()
calls the listener in the context of the passed object. el.on always uses the svg.js object as contextSVG.on()/off()
and el.on()/off()
now accepts multiple comma or space separated events e.g. “mousedown, foo bar” (#727)scale
, translate
, etc… by left multiplying them to simplify transformationstransform()
works is now completely different. See the docs for more as soon as they are updatedSVG.Doc
and SVG.Nested
, added isRoot()
on SVG.Doc()
(#809)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 nodesungroup()
now breaks off one container and not moreclone()
does not add the clone to the dom anymoreattr()
excepts array now to get multiple values at onceSVG.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 documentImage
callback passes normal load
event instead of custom object (#931)Doc
to Svg
and doc()
to root
(and toDoc()/toRoot()
) (#932)parent()
on documentFragment
s children (#927)SVG.Element.click(null)
correctly unbinds the event (#878)SVG.Set
now accepts another Set as input (#893)on()/off()
accepts multiple event names as input (backport from 3.0)element.parent()
which sometimes failed when used on detached documents (#759)SVG.Text.y()
which didnt work correctly with SVG.Number
(#778)SVG.Doc.clone()
which throwed an error (#782)SVG.Mask.clone()
which throwed an error (#782)SVG.PointArray
having a reference to outside array in some cases (#803)reference()
which failed when trying to use a reference which does not exist in the attribuets (#840)animate().attr()
method which doenst work for d
attribute of paths (#847)CustomEvent
polyfill in IE11 (#852)width()
and height()
methods to SVG.FX
SVG.FX.once
so that it add its callback on the last situation instead of the current oneSVG.FX.step
so that the animation doesn’t stop if an afterAll callback call animate (#677)options
object to SVG.on()
and el.on()
(#661)el.flip()
which causes an error when calling flip without any argumentclear()
does not remove the parser in svg documents anymorelen
not declared in FX module, making it a global variable (9737e8a
)bbox
not declared in SVG.Box.transform in the Box module (131df0f
)namespace
not declared in the Event module (e89c97e
)SVG.PathArray.parse
that did not correctly parsed flat arraysSVG.TextPath
(#582)clone()
method to SVG.Array/PointArray/PathArray
(#590)font()
method to SVG.Tspan
SVG.Box()
transform()
method to boxesevent()
to SVG.Element
to retrieve the event that was fired last on the element (#550)SVG.Polyline
,SVG.Polygon
, SVG.Line
, SVG.Path
(related #547)SVG.PointArray
to be passed flat arraySVG.PointArray
use to parse string to allow more flexibility in the way spaces and commas can be usedplot
to be called with 4 parameters when animating an SVG.Line
SVG.Number
are now calculated in its morph
method (related #547)initAnimation
method of the FX module (#547, #552, #584).tbox()
. .tbox()
now map to .rbox()
. If you are using .tbox()
, you can substitute it with .rbox()
(#594, #602)el.rbox()
now always returns the right boxes in screen coordinates and has an additional paramater to transform the box into other coordinate systemsfont()
method can now be used like attr()
method (#620)SVG.MorphObj
that is in the FX moduleoff()
(#518)size()
for poly elements when their height/width is zero (#505)SVG.Array
now accepts a comma seperated string and returns array of numbers instead of stringsSVG.Matrix
now accepts an array as inputSVG.Element.matrix()
now accepts also 6 valuesdx()/dy()
now accepts percentage values, too but only if the value on the element is already percentageflip()
now flips on both axis when no parameter is passeddocumentElement.contains()
in IE3e614d4
)npm run test:quick
which aim at being fast rather than correct - great for git hooks (981ce24
)npm run build
now requires nodejs 4.x+SVG.Matrix.skew()
(#545)SVG.FX.dequeue()
(#546)SVG.FX.step
, if custom properties is added to Array.prototype
(#549)695f26a
) (#529)SVG.FX.afterAll
(#534)SVG.FX.speed()
(#536)npm run build
to build a new version of SVG.js without requiring gulp to be globally installedfill()
, stroke()
without an argument is now a nopfilterSVGElements
utility to use a for loop instead of the native filter functionSVG.ViewBox
parent
parameter for clone()
document.contains
(#490) related to (#480)undo
when undoing transformations (#494)SVG.morph()
(#473)SVG.Color
with new fxradius()
for circles when animating and other related code (#477)stop(true)
throws an error when element is not animated (#475)add()
when altering svgs with whitespacesSVG.Doc().create
where size was set to 100% even if size was already specifiedparse()
from SVG.PathArray
which does not correctly handled S
and T
(#485)SVG.Point
which serves as Wrapper to the native SVGPoint
(#437)element.point(x,y)
which transforms a point from screen coordinates to the elements space (#403)element.is()
which helps to check for the object instance faster (instanceof check)svgjs:data
attribute which was not set properly in all browsers (#428)isNumber
and numberAndUnit
regex (#405)group.move()
now allows string numbers as input (#433)matrixify()
will not apply the calculated matrix to the node anymoretransform()
which returns the matrix values (a-f) now, too (#423)text()
rbox()
(#425)SvgPathSeg
which is removed in Chrome 48 (#409)gbox()
to group to get bbox with translation included (#405)ungroup()/flatten()
(#238), toParent()
and toDoc()
morph()
method for paths via plugin svg.pathmorphing.jsparent()
methodparents()
method to get an array of all parenting elementstext()
after import/clone (#393)doc()
which always should return root svgSVG.FX
when animating with plot()
dmove()
and use()
with external filemove()
duo to incompatibilities with other move-functions e.g. in SVG.PointArray
select()
method globally or on parent elementsSVG.Circle
elementrx()
and ry()
to SVG.Rect
, SVG.Circle
, SVG.Ellispe
and SVG.FX
svg.wiml.js
plugin to plugins listctm()
method to for matrix-centric transformationsmorph()
method to SVG.Matrix
SVG.FX
native()
method to elements and matrix to get to the native apiuntransform()
method to remove all transformationssvg()
methodsituation
object in SVG.FX
element()
method using the SVG.Bare
class to create elements that are not described by SVG.jsw
and h
properties as shorthand for width
and height
to SVG.BBox
SVG.TBox
to get a bounding box that is affected by transformation valuesoff()
methodparent
reference on elements to parent()
methodCustomEvent
instead of Event
to be able to fire events with a detail
object [thanks @Fuzzyma]SVG.TSpan
class to SVG.Tspan
to play nice with the adoption systemclone()
method to use the adoption systemlines
reference to lines()
on SVG.Text
track
reference to track()
on SVG.Text
textPath
reference to textPath()
on SVG.Text
array
reference to array()
method on SVG.Polyline
, SVG.Polygon
and SVG.Path
rake
to Node’s gulp
for building [thanks to Alex Ewerlöf]to()
method to at()
method in SVG.FX
SVG.SetFX
to SVG.FX.Set
SVG.Number
to return new instances with calculations rather than itselfSVG.Symbol
but kept the symbol()
method using the new element()
methodradius()
method when y
value equals 0
SVG.Marker
SVG.Symbol
first()
and last()
methods to SVG.Set
length()
method to SVG.Text
and SVG.TSpan
to calculate total text lengthreference()
method to get referenced elements from a given attribute valueSVG.get()
will now also fetch elements with a xlink:href="#elementId"
or url(#elementId)
value givenSVG.off
rbox()
[thanks @bryhoyt]classes()
, hasClass()
, addClass()
, removeClass()
and toggleClass()
[thanks @pklingem]after()
when calling stop(true)
(fulfill flag) [thanks @vird]rebuild
event whenever the rebuild()
method is calledElement#style()
would not save empty values in IE11 [thanks @Shtong]SVG is not defined error
[thanks @anvaka]move()
on text elements with a string based valuetext()
method on text element when acting as getter [thanks @Lochemage]style()
method with a css string [thanks @TobiasHeckel]leading()
method to SVG.FX
reverse()
method to SVG.Array
(and thereby also to SVG.PointArray
and SVG.PathArray
)fulfill
option to stop()
method in SVG.FX
to finalise animationsbbox()
and rbox()
methodsat()
method directly on morphable svg.js instances in SVG.FX
module_private
methods to local named functionsdy()
methodstyle
plain()
method to SVG.Text
element to add plain text content, without tspansplain()
method to parent elements to create a text element without tspansbuild()
to enable/disable build modeSVG.TSpan
to accept nested tspan elements, not unlike the text()
method in SVG.Text
relative()
method in favour of dx()
, dy()
and dmove()
SVG.PathArray
for compatibility with other libraries and better performance on parsing and rendering (up-to 48% faster than 1.0.0-rc.4)SVG.PathArray
structureleading()
implementation to be more font-size “aware”attr
method on SVG.Element
SVG.FX
class with SVG.invent()
functionfill
attribute on elementsloaded()
method to image tagpointAt()
method to SVG.Path
, wrapping the native getPointAtLength()
MAJOR
.MINOR
.PATCH
versioning format to play nice with package managerslength()
method to sugar moduleanimate('=').to()
toString()
method [thanks @dotnetCarpenter]SVG.invent
function to ease invention of new elementsanimate('2s')
length()
mehtod to path, wrapping the native getTotalLength()
SVG.invent
to generate core shapes as well for leaner codetoString()
methodindex()
method to SVG.Parent
and SVG.Set
morph()
and at()
methods to SVG.Number
for unit morphingcx()
and cy()
methods on elements with native x
, y
, width
and height
attributes for better performanceSVG.PathArray
for real path transformationsbbox()
method to SVG.Set
relative()
method for moves relative to the current positionmorph()
and at()
methods to SVG.Color
for color morphingsize()
method with null
for either width
or height
valuesdata()
method now accepts object for for multiple key / value assignmentsunbiased
system for pathsloop()
method to SVG.FX
setInterval
to requestAnimFrame
for animationsget()
to SVG.Set
SVG.PointArray
to a separate filelinkTo()
, addTo()
and putIn()
methods on SVG.Element
SVG.A
element with the link()
pause()
and play()
to SVG.FX
situation
objecthas()
method to SVG.Set
width()
and height()
as setter and getter methods on all shapesreplace()
method to elementsradius()
method to SVG.Rect
and SVG.Ellipse
SVG('drawing').fixSubPixelOffset()
)