diff --git a/dist/reference.html b/dist/reference.html index 7a800e4..ba84394 100644 --- a/dist/reference.html +++ b/dist/reference.html @@ -18,7 +18,7 @@
- +
@@ -31,10 +31,10 @@

Element

-

Element.add()

+

Element.add()

Element.after(el)

+

Element.after(el)

Inserts given element after the current one.

Parameters

  1. el @@ -42,7 +42,7 @@ element to insert

Returns: Element parent

-

Element.animate(attrs, ms, [easing], [callback])

+

Element.animate(attrs, ms, [easing], [callback])

Animate given attributes of the element.

Parameters

  1. attrs @@ -61,7 +61,7 @@  

Returns: Element the element

-

Element.append(el)

+

Element.append(el)

Appends given element to current one.

Parameters

  1. el @@ -69,7 +69,7 @@ element to append

Returns: Element parent

-

Element.asPX(attr, [value])

+

Element.asPX(attr, [value])

Return given attribute of the element as a px value. (Not %, em, etc)

Parameters

  1. attr @@ -81,7 +81,7 @@ attribute value

Returns: Element result of query selection

-

Element.attr(…)

+

Element.attr(…)

Gets or sets given attributes of the element

Parameters

  1. params @@ -106,7 +106,7 @@ }); console.log(el.attr("fill")); // “#fc0”
-

Element.before(el)

+

Element.before(el)

Inserts given element before the current one.

Parameters

  1. el @@ -114,7 +114,7 @@ console.log(el.attr("fill")); // “#fc0” element to insert

Returns: Element parent

-

Element.click(handler)

+

Element.click(handler)

Adds event handler for click for the element.

Parameters

  1. handler @@ -122,11 +122,11 @@ console.log(el.attr("fill")); // “#fc0” handler for the event

Returns: object Element

-

Element.clone()

+

Element.clone()

Creates <use> element linked to the current element.

Returns: Element <use> element

-

Element.data(key, [value])

+

Element.data(key, [value])

Adds or retrieves given value asociated with given key. See also Element.removeData

@@ -151,7 +151,7 @@ See also Element.removeData }); }
-

Element.dblclick(handler)

+

Element.dblclick(handler)

Adds event handler for double click for the element.

Parameters

  1. handler @@ -159,7 +159,7 @@ See also Element.removeData handler for the event

Returns: object Element

-

Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])

+

Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])

Adds event handlers for drag of the element.

Parameters

  1. onmove @@ -207,7 +207,7 @@ See also Element.removeData
    1. eventobjectDOM event object

    Returns: object Element

    -

Element.getBBox()

+

Element.getBBox()

Returns bounding box descriptor for the given element.

Returns: object bounding box descriptor:

@@ -227,7 +227,7 @@ See also Element.removeData
  • y2:numbery of the right side,
  • y:numbery of the left side
  • }
  • -

    Element.getPointAtLength(length)

    +

    Element.getPointAtLength(length)

    Return coordinates of the point located at the given length on the given path. Only works for element of “path” type.

    Parameters

    1. length @@ -239,7 +239,7 @@ See also Element.removeData
    2. y:numbery coordinate
    3. alpha:numberangle of derivative
  • }
  • -

    Element.getSubpath(from, to)

    +

    Element.getSubpath(from, to)

    Return subpath of a given element from given length to given length. Only works for element of “path” type.

    Parameters

    1. from @@ -250,11 +250,11 @@ See also Element.removeData position of the end of the segment

    Returns: string pathstring for the segment

    -

    Element.getTotalLength()

    +

    Element.getTotalLength()

    Returns length of the path in pixels. Only works for element of “path” type.

    Returns: number length.

    -

    Element.hover(f_in, f_out, [icontext], [ocontext])

    +

    Element.hover(f_in, f_out, [icontext], [ocontext])

    Adds event handlers for hover for the element.

    Parameters

    1. f_in @@ -273,7 +273,7 @@ See also Element.removeData context for hover out handler

    Returns: object Element

    -

    Element.inAnim()

    +

    Element.inAnim()

    Returns an array of animations element currently in

    Returns: object in format

    @@ -282,7 +282,7 @@ See also Element.removeData
  • statusfunctiongets or sets the status of the animation,
  • stopfunctionstops the animation
  • }
  • -

    Element.insertAfter(el)

    +

    Element.insertAfter(el)

    Inserts the element after the given one.

    Parameters

    1. el @@ -290,7 +290,7 @@ See also Element.removeData element next to whom insert to

    Returns: Element parent

    -

    Element.insertBefore(el)

    +

    Element.insertBefore(el)

    Inserts the element after the given one.

    Parameters

    1. el @@ -298,7 +298,7 @@ See also Element.removeData element next to whom insert to

    Returns: Element parent

    -

    Element.marker(x, y, width, height, refX, refY)

    +

    Element.marker(x, y, width, height, refX, refY)

    Creates <marker> element from the current element. To create a marker you have to specify the bounding rect and reference point:

    @@ -324,7 +324,7 @@ To create a marker you have to specify the bounding rect and reference point:

    Returns: Element <marker> element

    You can use pattern later on as an argument for marker-start or marker-end attributes.

    -

    Element.mousedown(handler)

    +

    Element.mousedown(handler)

    Adds event handler for mousedown for the element.

    Parameters

    1. handler @@ -332,7 +332,7 @@ To create a marker you have to specify the bounding rect and reference point: handler for the event

    Returns: object Element

    -

    Element.mousemove(handler)

    +

    Element.mousemove(handler)

    Adds event handler for mousemove for the element.

    Parameters

    1. handler @@ -340,7 +340,7 @@ To create a marker you have to specify the bounding rect and reference point: handler for the event

    Returns: object Element

    -

    Element.mouseout(handler)

    +

    Element.mouseout(handler)

    Adds event handler for mouseout for the element.

    Parameters

    1. handler @@ -348,7 +348,7 @@ To create a marker you have to specify the bounding rect and reference point: handler for the event

    Returns: object Element

    -

    Element.mouseover(handler)

    +

    Element.mouseover(handler)

    Adds event handler for mouseover for the element.

    Parameters

    1. handler @@ -356,7 +356,7 @@ To create a marker you have to specify the bounding rect and reference point: handler for the event

    Returns: object Element

    -

    Element.mouseup(handler)

    +

    Element.mouseup(handler)

    Adds event handler for mouseup for the element.

    Parameters

    1. handler @@ -364,18 +364,18 @@ To create a marker you have to specify the bounding rect and reference point: handler for the event

    Returns: object Element

    -

    Element.onDragOver(f)

    +

    Element.onDragOver(f)

    Shortcut for assigning event handler for drag.over.<id> event, where id is id of the element (see Element.id).

    Parameters

    1. f function handler for event, first argument would be the element you are dragging over
    -

    Element.parent()

    +

    Element.parent()

    Returns parent of the element

    Returns: Element parent

    -

    Element.pattern(x, y, width, height)

    +

    Element.pattern(x, y, width, height)

    Creates <pattern> element from the current element. To create a pattern you have to specify the pattern rect:

    @@ -405,7 +405,7 @@ c.attr({ fill: p });
    -

    Element.prepend(el)

    +

    Element.prepend(el)

    Prepends given element to current one.

    Parameters

    1. el @@ -413,10 +413,10 @@ c.attr({ element to prepend

    Returns: Element parent

    -

    Element.remove()

    +

    Element.remove()

    Removes element from the DOM

    -

    Element.removeData([key])

    +

    Element.removeData([key])

    Removes value associated with an element by given key. If key is not provided, removes all the data of the element.

    @@ -426,7 +426,7 @@ If key is not provided, removes all the data of the element. key

    Returns: object Element

    -

    Element.select(query)

    +

    Element.select(query)

    Applies CSS selector with the element as a parent and returns the result as an Element.

    Parameters

    1. query @@ -434,7 +434,7 @@ If key is not provided, removes all the data of the element. CSS selector

    Returns: Element result of query selection

    -

    Element.selectAll(query)

    +

    Element.selectAll(query)

    Applies CSS selector with the element as a parent and returns the result as a set or array of elements.

    Parameters

    1. query @@ -442,11 +442,11 @@ If key is not provided, removes all the data of the element. CSS selector

    Returns: Set array result of query selection

    -

    Element.stop()

    +

    Element.stop()

    Stops all the animations of the current element.

    Returns: Element the element

    -

    Element.touchcancel(handler)

    +

    Element.touchcancel(handler)

    Adds event handler for touchcancel for the element.

    Parameters

    1. handler @@ -454,7 +454,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.touchend(handler)

    +

    Element.touchend(handler)

    Adds event handler for touchend for the element.

    Parameters

    1. handler @@ -462,7 +462,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.touchmove(handler)

    +

    Element.touchmove(handler)

    Adds event handler for touchmove for the element.

    Parameters

    1. handler @@ -470,7 +470,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.touchstart(handler)

    +

    Element.touchstart(handler)

    Adds event handler for touchstart for the element.

    Parameters

    1. handler @@ -478,7 +478,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.transform(tstr)

    +

    Element.transform(tstr)

    Gets or sets transformation of the element

    Parameters

    1. tstr @@ -497,7 +497,7 @@ If key is not provided, removes all the data of the element.
    2. localstringlocal transformation as string,
    3. toStringfunctionreturns string property
  • }
  • -

    Element.unclick(handler)

    +

    Element.unclick(handler)

    Removes event handler for click for the element.

    Parameters

    1. handler @@ -505,7 +505,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.undblclick(handler)

    +

    Element.undblclick(handler)

    Removes event handler for double click for the element.

    Parameters

    1. handler @@ -513,10 +513,10 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.undrag()

    +

    Element.undrag()

    Removes all drag event handlers from given element.

    -

    Element.unhover(f_in, f_out)

    +

    Element.unhover(f_in, f_out)

    Removes event handlers for hover for the element.

    Parameters

    1. f_in @@ -527,7 +527,7 @@ If key is not provided, removes all the data of the element. handler for hover out

    Returns: object Element

    -

    Element.unmousedown(handler)

    +

    Element.unmousedown(handler)

    Removes event handler for mousedown for the element.

    Parameters

    1. handler @@ -535,7 +535,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.unmousemove(handler)

    +

    Element.unmousemove(handler)

    Removes event handler for mousemove for the element.

    Parameters

    1. handler @@ -543,7 +543,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.unmouseout(handler)

    +

    Element.unmouseout(handler)

    Removes event handler for mouseout for the element.

    Parameters

    1. handler @@ -551,7 +551,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.unmouseover(handler)

    +

    Element.unmouseover(handler)

    Removes event handler for mouseover for the element.

    Parameters

    1. handler @@ -559,7 +559,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.unmouseup(handler)

    +

    Element.unmouseup(handler)

    Removes event handler for mouseup for the element.

    Parameters

    1. handler @@ -567,7 +567,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.untouchcancel(handler)

    +

    Element.untouchcancel(handler)

    Removes event handler for touchcancel for the element.

    Parameters

    1. handler @@ -575,7 +575,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.untouchend(handler)

    +

    Element.untouchend(handler)

    Removes event handler for touchend for the element.

    Parameters

    1. handler @@ -583,7 +583,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.untouchmove(handler)

    +

    Element.untouchmove(handler)

    Removes event handler for touchmove for the element.

    Parameters

    1. handler @@ -591,7 +591,7 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.untouchstart(handler)

    +

    Element.untouchstart(handler)

    Removes event handler for touchstart for the element.

    Parameters

    1. handler @@ -599,19 +599,19 @@ If key is not provided, removes all the data of the element. handler for the event

    Returns: object Element

    -

    Element.use()

    +

    Element.use()

    Creates <use> element linked to the current element.

    Returns: Element <use> element

    Fragment

    -

    Fragment.select()

    +

    Fragment.select()

    Fragment.selectAll()

    +

    Fragment.selectAll()

    Matrix

    -

    Matrix.add(a, b, c, d, e, f, matrix)

    +

    Matrix.add(a, b, c, d, e, f, matrix)

    Adds given matrix to existing one.

    Parameters

    1. a @@ -636,15 +636,15 @@ If key is not provided, removes all the data of the element. object Matrix
    -

    Matrix.clone()

    +

    Matrix.clone()

    Returns copy of the matrix

    Returns: object Matrix

    -

    Matrix.invert()

    +

    Matrix.invert()

    Returns inverted version of the matrix

    Returns: object Matrix

    -

    Matrix.rotate(a, x, y)

    +

    Matrix.rotate(a, x, y)

    Rotates the matrix

    Parameters

    1. a @@ -657,7 +657,7 @@ If key is not provided, removes all the data of the element. number  
    -

    Matrix.scale(x, [y], [cx], [cy])

    +

    Matrix.scale(x, [y], [cx], [cy])

    Scales the matrix

    Parameters

    1. x @@ -676,7 +676,7 @@ If key is not provided, removes all the data of the element. number  
    -

    Matrix.split()

    +

    Matrix.split()

    Splits matrix into primitive transformations

    Returns: object in format:

    @@ -688,11 +688,11 @@ If key is not provided, removes all the data of the element.
  • rotatenumberrotation in deg
  • isSimplebooleancould it be represented via simple transformations -
  • Matrix.toTransformString()

    +

    Matrix.toTransformString()

    Return transform string that represents given matrix

    Returns: string transform string

    -

    Matrix.translate(x, y)

    +

    Matrix.translate(x, y)

    Translate the matrix

    Parameters

    1. x @@ -702,7 +702,7 @@ If key is not provided, removes all the data of the element. number  
    -

    Matrix.x(x, y)

    +

    Matrix.x(x, y)

    Return x coordinate for given point after transformation described by the matrix. See also Matrix.y

    Parameters

    1. x @@ -713,7 +713,7 @@ If key is not provided, removes all the data of the element.  

    Returns: number x

    -

    Matrix.y(x, y)

    +

    Matrix.y(x, y)

    Return y coordinate for given point after transformation described by the matrix. See also Matrix.x

    Parameters

    1. x @@ -725,7 +725,7 @@ If key is not provided, removes all the data of the element.

    Returns: number y

    Paper

    -

    Paper.circle(x, y, r)

    +

    Paper.circle(x, y, r)

    Draws a circle.

    Parameters

    1. x @@ -741,7 +741,7 @@ If key is not provided, removes all the data of the element.

      Returns: object Element object with type “circle”

      Usage

      var c = paper.circle(50, 50, 40);
       
      -

    Paper.el(name)

    +

    Paper.el(name)

    Creates element on paper with a given name and no attributes.

    Parameters

    1. name @@ -756,7 +756,7 @@ var c = paper.el("circle").attr({ r: 10 });
    -

    Paper.ellipse(x, y, rx, ry)

    +

    Paper.ellipse(x, y, rx, ry)

    Draws an ellipse.

    Parameters

    1. x @@ -775,7 +775,7 @@ var c = paper.el("circle").attr({

      Returns: object Element object with type “ellipse”

      Usage

      var c = paper.ellipse(50, 50, 40, 20);
       
      -

    Paper.filter(filstr)

    +

    Paper.filter(filstr)

    Creates filter element

    Parameters

    1. filstr @@ -790,7 +790,7 @@ var c = paper.el("circle").attr({ filter: f });
    -

    Paper.filter.blur(dx, dy, [blur], [color])

    +

    Paper.filter.blur(dx, dy, [blur], [color])

    Returns string of the blur filter.

    Parameters

    1. x @@ -830,7 +830,7 @@ var c = paper.el("circle").attr({ filter: f });
    -

    Paper.g([varargs])

    +

    Paper.g([varargs])

    Makes a group element.

    Parameters

    1. varargs @@ -850,7 +850,7 @@ var c = paper.el("circle").attr({ g = paper.g(); g.add(c2, c1);
    -

    Paper.gradient(gradient)

    +

    Paper.gradient(gradient)

    Creates a gradient element.

    Parameters

    1. gradient @@ -888,10 +888,10 @@ through red at 25% to white. });

    Returns: object Element object with type “gradient”

    -

    Paper.group()

    +

    Paper.group()

    See Paper.g

    -

    Paper.image(src, x, y, width, height)

    +

    Paper.image(src, x, y, width, height)

    Embeds an image into the surface.

    Parameters

    1. src @@ -934,7 +934,7 @@ through red at 25% to white.

      Returns: object Element object with type “image”

      Usage

      var c = paper.image("apple.png", 10, 10, 80, 80);
       
      -

    Paper.line(x1, y1, x2, y2)

    +

    Paper.line(x1, y1, x2, y2)

    Draws a line.

    Parameters

    1. x1 @@ -953,7 +953,7 @@ through red at 25% to white.

      Returns: object Element object with type “line”

      Usage

      var t1 = paper.line(50, 50, 100, 100);
       
      -

    Paper.path([pathString])

    +

    Paper.path([pathString])

    Creates a path element by given path data string.

    Parameters

    1. pathString @@ -988,10 +988,10 @@ Note: there is a special case when path consist of just three commands: “M10,1 // draw a diagonal line: // move to 10,10, line to 90,90
    -

    Paper.polygon()

    +

    Paper.polygon()

    Draws a polygon. See Paper.polyline

    -

    Paper.polyline(…)

    +

    Paper.polyline(…)

    Draws a polyline.

    Parameters

    1. points @@ -1008,7 +1008,7 @@ Note: there is a special case when path consist of just three commands: “M10,1

      Usage

      var p1 = paper.polyline([10, 10, 100, 100]);
       var p2 = paper.polyline(10, 10, 100, 100);
       
      -

    Paper.rect(x, y, width, height, [rx], [ry])

    +

    Paper.rect(x, y, width, height, [rx], [ry])

    Draws a rectangle.

    @@ -1039,7 +1039,7 @@ var c = paper.rect(10, 10, 50, 50); // rectangle with rounded corners var c = paper.rect(40, 40, 50, 50, 10);
    -

    Paper.text(x, y, text)

    +

    Paper.text(x, y, text)

    Draws a text string.

    Parameters

    1. x @@ -1056,8 +1056,12 @@ var c = paper.rect(40, 40, 50, 50, 10);

      Usage

      var t1 = paper.text(50, 50, "Savage");
       var t2 = paper.text(50, 50, ["S","a","v","a","g","e"]);
       
      +

    Paper.toString()

    +

    Returns SVG code of the Paper. +

    +

    Returns: string SVG code of the Paper.

    Savage

    -

    Savage.Matrix(…)

    +

    Savage.Matrix(…)

    Utility method Returns matrix based on given parameters.

    @@ -1087,7 +1091,7 @@ Returns matrix based on given parameters.  

    Returns: object Matrix

    -

    Savage.ajax(…)

    +

    Savage.ajax(…)

    Simple implementation of Ajax.

    Parameters

    1. url @@ -1118,7 +1122,7 @@ Returns matrix based on given parameters. scope of callback

    Returns: XMLHttpRequest XMLHttpRequest (just in case)

    -

    Savage.animate(from, to, setter, ms, [easing], [callback])

    +

    Savage.animate(from, to, setter, ms, [easing], [callback])

    Runs generic animation of one number into another with a caring function.

    Parameters

    1. from @@ -1150,7 +1154,7 @@ Returns matrix based on given parameters.
    2. statusfunctiongets or sets the status of the animation,
    3. stopfunctionstops the animation
  • }
  • -

    Savage.animation(attr, ms, [easing], [callback])

    +

    Savage.animation(attr, ms, [easing], [callback])

    Creates animation object.

    Parameters

    1. attr @@ -1169,7 +1173,7 @@ Returns matrix based on given parameters. callback

    Returns: object animation object

    -

    Savage.color(clr)

    +

    Savage.color(clr)

    Parses the color string and returns object with all values for the given color.

    Parameters

    1. clr @@ -1187,7 +1191,7 @@ Returns matrix based on given parameters.
    2. vnumbervalue (brightness),
    3. lnumberlightness
  • }
  • -

    Savage.deg(deg)

    +

    Savage.deg(deg)

    Transform angle to degrees

    Parameters

    1. deg @@ -1195,7 +1199,7 @@ Returns matrix based on given parameters. angle in radians

    Returns: number angle in degrees.

    -

    Savage.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)

    +

    Savage.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)

    Utility method Find dot coordinates on the given cubic bezier curve at the given t.

    @@ -1240,7 +1244,7 @@ Find dot coordinates on the given cubic bezier curve at the given t.
  • y:numbery coordinate of the end of the curve
  • }
  • alpha:numberangle of the curve derivative at the point
  • }
  • -

    Savage.format(token, json)

    +

    Savage.format(token, json)

    Replaces construction of type “{<name>}” to the corresponding argument.

    Parameters

    1. token @@ -1262,7 +1266,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width } }));
    -

    Savage.fragment(varargs)

    +

    Savage.fragment(varargs)

    Creates DOM fragment from given list of elements or strings

    Parameters

    1. varargs @@ -1270,7 +1274,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width SVG string

    Returns: Fragment the Fragment

    -

    Savage.getRGB(colour)

    +

    Savage.getRGB(colour)

    Parses colour string as RGB object

    Parameters

    1. colour @@ -1295,7 +1299,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width
    2. hexstringcolor in HTML/CSS format: #••••••,
    3. errorbooleantrue if string cant be parsed
  • }
  • -

    Savage.hsb(h, s, b)

    +

    Savage.hsb(h, s, b)

    Converts HSB values to hex representation of the colour.

    Parameters

    1. h @@ -1309,7 +1313,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width value or brightness

    Returns: string hex representation of the colour.

    -

    Savage.hsb2rgb(h, s, v)

    +

    Savage.hsb2rgb(h, s, v)

    Converts HSB values to RGB object.

    Parameters

    1. h @@ -1328,7 +1332,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width
    2. bnumberblue,
    3. hexstringcolor in HTML/CSS format: #••••••
  • }
  • -

    Savage.hsl(h, s, l)

    +

    Savage.hsl(h, s, l)

    Converts HSL values to hex representation of the colour.

    Parameters

    1. h @@ -1342,7 +1346,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width luminosity

    Returns: string hex representation of the colour.

    -

    Savage.hsl2rgb(h, s, l)

    +

    Savage.hsl2rgb(h, s, l)

    Converts HSL values to RGB object.

    Parameters

    1. h @@ -1361,7 +1365,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width
    2. bnumberblue,
    3. hexstringcolor in HTML/CSS format: #••••••
  • }
  • -

    Savage.is(o, type)

    +

    Savage.is(o, type)

    Handfull replacement for typeof operator.

    Parameters

    1. o @@ -1372,7 +1376,21 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width name of the type, i.e. “string”, “function”, “number”, etc.

    Returns: boolean is given value is of given type

    -

    Savage.parse(svg)

    +

    Savage.load(url, callback, [scope])

    +

    Loads external SVG file as a Fragment. For more advanced AJAX see Savage.ajax. +

    +

    Parameters

    1. url +string +URL
    2. +
    3. callback +function +callback
    4. +
    5. scope +optional +object +scope of callback
    6. +
    +

    Savage.parse(svg)

    Parses SVG fragment and converts it into Fragment.

    Parameters

    1. svg @@ -1380,7 +1398,7 @@ paper.path(Savage.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width SVG string

    Returns: Fragment the fragment

    -

    Savage.parsePathString(pathString)

    +

    Savage.parsePathString(pathString)

    Utility method Parses given path string into an array of arrays of path segments.

    @@ -1389,7 +1407,7 @@ Parses given path string into an array of arrays of path segments. path string or array of segments (in the last case it will be returned straight away)

    Returns: array array of segments.

    -

    Savage.parseTransformString(TString)

    +

    Savage.parseTransformString(TString)

    Utility method Parses given path string into an array of transformations.

    @@ -1399,7 +1417,7 @@ Parses given path string into an array of transformations.

    Returns: array array of transformations.

    Savage.path

    -

    Savage.path.bezierBBox(…)

    +

    Savage.path.bezierBBox(…)

    Utility method Return bounding box of a given cubic bezier curve

    @@ -1440,7 +1458,7 @@ Return bounding box of a given cubic bezier curve
  • }
  • max: {
    1. x:numberx coordinate of the right point
    2. y:numbery coordinate of the bottom point
  • }
  • }
  • -

    Savage.path.getPointAtLength(path, length)

    +

    Savage.path.getPointAtLength(path, length)

    Return coordinates of the point located at the given length on the given path.

    Parameters

    1. path @@ -1455,7 +1473,7 @@ Return bounding box of a given cubic bezier curve
    2. y:numbery coordinate
    3. alpha:numberangle of derivative
  • }
  • -

    Savage.path.getSubpath(path, from, to)

    +

    Savage.path.getSubpath(path, from, to)

    Return subpath of a given path from given length to given length.

    Parameters

    1. path @@ -1469,7 +1487,7 @@ Return bounding box of a given cubic bezier curve position of the end of the segment

    Returns: string pathstring for the segment

    -

    Savage.path.getTotalLength(path)

    +

    Savage.path.getTotalLength(path)

    Returns length of the given path in pixels.

    Parameters

    1. path @@ -1477,7 +1495,7 @@ Return bounding box of a given cubic bezier curve SVG path string.

    Returns: number length.

    -

    Savage.path.intersection(path1, path2)

    +

    Savage.path.intersection(path1, path2)

    Utility method Finds intersections of two paths

    @@ -1498,7 +1516,7 @@ Finds intersections of two paths
  • bez1:arrayeight coordinates representing beziér curve for the segment of path1
  • bez2:arrayeight coordinates representing beziér curve for the segment of path2
  • }
  • ] -
  • Savage.path.isBBoxIntersect(bbox1, bbox2)

    +

    Savage.path.isBBoxIntersect(bbox1, bbox2)

    Utility method Returns true if two bounding boxes intersect

    @@ -1510,7 +1528,7 @@ Returns true if two bounding boxes intersect second bounding box

    Returns: boolean true if they intersect

    -

    Savage.path.isPointInside(path, x, y)

    +

    Savage.path.isPointInside(path, x, y)

    Utility method Returns true if given point is inside a given closed path.

    @@ -1525,7 +1543,7 @@ Returns true if given point is inside a given closed path. y of the point

    Returns: boolean true, if point is inside the path

    -

    Savage.path.isPointInsideBBox(bbox, x, y)

    +

    Savage.path.isPointInsideBBox(bbox, x, y)

    Utility method Returns true if given point is inside bounding box.

    @@ -1540,7 +1558,7 @@ Returns true if given point is inside bounding box. y coordinate of the point

    Returns: boolean true if point inside

    -

    Savage.path.map(path, matrix)

    +

    Savage.path.map(path, matrix)

    Transform the path string with given matrix.

    Parameters

    1. path @@ -1551,7 +1569,7 @@ Returns true if given point is inside bounding box. see Matrix

    Returns: string transformed path string

    -

    Savage.path.toAbsolute(path)

    +

    Savage.path.toAbsolute(path)

    Utility method Converts path coordinates into absolute values.

    @@ -1560,7 +1578,7 @@ Converts path coordinates into absolute values. path string

    Returns: array path string

    -

    Savage.path.toCubic(pathString)

    +

    Savage.path.toCubic(pathString)

    Utility method Converts path to a new path where all segments are cubic bezier curves.

    @@ -1569,7 +1587,7 @@ Converts path to a new path where all segments are cubic bezier curves. path string or array of segments

    Returns: array array of segments.

    -

    Savage.path.toRelative(path)

    +

    Savage.path.toRelative(path)

    Utility method Converts path coordinates into relative values.

    @@ -1578,7 +1596,7 @@ Converts path coordinates into relative values. path string

    Returns: array path string

    -

    Savage.pathBBox(path)

    +

    Savage.pathBBox(path)

    Utility method Return bounding box of a given path

    @@ -1594,7 +1612,7 @@ Return bounding box of a given path
  • width:numberwidth of the box
  • height:numberheight of the box
  • }
  • -

    Savage.rad(deg)

    +

    Savage.rad(deg)

    Transform angle to radians

    Parameters

    1. deg @@ -1602,7 +1620,7 @@ Return bounding box of a given path angle in degrees

    Returns: number angle in radians.

    -

    Savage.rgb(r, g, b)

    +

    Savage.rgb(r, g, b)

    Converts RGB values to hex representation of the colour.

    Parameters

    1. r @@ -1616,7 +1634,7 @@ Return bounding box of a given path blue

    Returns: string hex representation of the colour.

    -

    Savage.rgb2hsb(r, g, b)

    +

    Savage.rgb2hsb(r, g, b)

    Converts RGB values to HSB object.

    Parameters

    1. r @@ -1634,7 +1652,7 @@ Return bounding box of a given path
    2. snumbersaturation
    3. bnumberbrightness
  • }
  • -

    Savage.rgb2hsl(r, g, b)

    +

    Savage.rgb2hsl(r, g, b)

    Converts RGB values to HSL object.

    Parameters

    1. r @@ -1652,7 +1670,7 @@ Return bounding box of a given path
    2. snumbersaturation
    3. lnumberluminosity
  • }
  • -

    Savage.select(query)

    +

    Savage.select(query)

    Wraps DOM element specified by CSS selector as Element

    Parameters

    1. query @@ -1660,7 +1678,7 @@ Return bounding box of a given path CSS selector of the element

    Returns: Element

    -

    Savage.selectAll(query)

    +

    Savage.selectAll(query)

    Wraps DOM elements specified by CSS selector as set or array of Element

    Parameters

    1. query @@ -1668,7 +1686,7 @@ Return bounding box of a given path CSS selector of the element

    Returns: Element

    -

    Savage.snapTo(values, value, [tolerance])

    +

    Savage.snapTo(values, value, [tolerance])

    Snaps given value to given grid.

    Parameters

    1. values @@ -1684,10 +1702,10 @@ Return bounding box of a given path

    Returns: number adjusted value.

    Set

    -

    Set.clear()

    +

    Set.clear()

    Removeds all elements from the set

    -

    Set.exclude(element)

    +

    Set.exclude(element)

    Removes given element from the set

    Parameters

    1. element @@ -1695,7 +1713,7 @@ Return bounding box of a given path element to remove

    Returns: boolean true if object was found & removed from the set

    -

    Set.forEach(callback, thisArg)

    +

    Set.forEach(callback, thisArg)

    Executes given function for each element in the set.

    If function returns false it will stop loop running. @@ -1708,15 +1726,15 @@ Return bounding box of a given path context object for the callback

    Returns: object Set object

    -

    Set.pop()

    +

    Set.pop()

    Removes last element and returns it.

    Returns: object element

    -

    Set.push()

    +

    Set.push()

    Adds each argument to the current set.

    Returns: object original element

    -

    Set.splice(index, count, [insertion…])

    +

    Set.splice(index, count, [insertion…])

    Removes given element from the set

    Parameters

    1. index @@ -1731,7 +1749,7 @@ Return bounding box of a given path elements to insert

    Returns: object set elements that were deleted

    -

    mina(a, A, b, B, get, set, [easing])

    +

    mina(a, A, b, B, get, set, [easing])

    Generic animation of numbers.

    Parameters

    1. a @@ -1773,7 +1791,7 @@ Return bounding box of a given path
    2. durationfunctionduration getter/setter,
    3. stopfunctionanimation stopper
  • }
  • -

    mina.backin(n)

    +

    mina.backin(n)

    Backin easing.

    Parameters

    1. n @@ -1781,7 +1799,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.backout(n)

    +

    mina.backout(n)

    Backout easing.

    Parameters

    1. n @@ -1789,7 +1807,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.bounce(n)

    +

    mina.bounce(n)

    Bounce easing.

    Parameters

    1. n @@ -1797,7 +1815,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.easein(n)

    +

    mina.easein(n)

    Easein easing.

    Parameters

    1. n @@ -1805,7 +1823,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.easeinout(n)

    +

    mina.easeinout(n)

    Easeinout easing.

    Parameters

    1. n @@ -1813,7 +1831,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.easeout(n)

    +

    mina.easeout(n)

    Easeout easing.

    Parameters

    1. n @@ -1821,7 +1839,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.elastic(n)

    +

    mina.elastic(n)

    Elastic easing.

    Parameters

    1. n @@ -1829,7 +1847,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.getById(id)

    +

    mina.getById(id)

    Returns animation by it’s id.

    Parameters

    1. id @@ -1837,7 +1855,7 @@ Return bounding box of a given path animation’s id

    Returns: object See mina

    -

    mina.linear(n)

    +

    mina.linear(n)

    Default linear easing.

    Parameters

    1. n @@ -1845,7 +1863,7 @@ Return bounding box of a given path input 0..1

    Returns: number output 0..1

    -

    mina.time()

    +

    mina.time()

    Returns current time. Equal to

    function () {
    @@ -1858,7 +1876,7 @@ Return bounding box of a given path
         
    - +