From 300aa589f5a0ba7fce667cd62c7cdda0bd5ad904 Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Fri, 18 Nov 2011 11:43:36 +1100 Subject: [PATCH] 2.0.1 --- history.md | 1 + raphael.js | 1 + reference.html | 245 +++++++++++++++++++++++++------------------------ 3 files changed, 125 insertions(+), 122 deletions(-) diff --git a/history.md b/history.md index d38bded..84cdbeb 100644 --- a/history.md +++ b/history.md @@ -11,6 +11,7 @@ * Fixed drag'n'drop * New method [Paper.add](http://raphaeljs.com/reference.html#Paper.add) * Fix for `clip-path` + * Doc update 2.0.0 * 2011-10-03 ------------------ diff --git a/raphael.js b/raphael.js index 59fc1ec..bf6e741 100644 --- a/raphael.js +++ b/raphael.js @@ -3394,6 +3394,7 @@ }); })(); + // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ diff --git a/reference.html b/reference.html index 7222634..51a85cd 100644 --- a/reference.html +++ b/reference.html @@ -1,7 +1,7 @@ Raphaël Reference
  1. Animation
  2. Animation.delay()
  3. Animation.repeat()
  4. Element
  5. Element.animate()
  6. Element.animateWith()
  7. Element.attr()
  8. Element.click()
  9. Element.clone()
  10. Element.data()
  11. Element.dblclick()
  12. Element.drag()
  13. Element.getBBox()
  14. Element.getPointAtLength()
  15. Element.getSubpath()
  16. Element.getTotalLength()
  17. Element.glow()
  18. Element.hide()
  19. Element.hover()
  20. Element.id
  21. Element.insertAfter()
  22. Element.insertBefore()
  23. Element.mousedown()
  24. Element.mousemove()
  25. Element.mouseout()
  26. Element.mouseover()
  27. Element.mouseup()
  28. Element.next
  29. Element.node
  30. Element.onDragOver()
  31. Element.paper
  32. Element.pause()
  33. Element.prev
  34. Element.raphael
  35. Element.remove()
  36. Element.removeData()
  37. Element.resume()
  38. Element.rotate()
  39. Element.scale()
  40. Element.setTime()
  41. Element.show()
  42. Element.status()
  43. Element.stop()
  44. Element.toBack()
  45. Element.toFront()
  46. Element.touchcancel()
  47. Element.touchend()
  48. Element.touchmove()
  49. Element.touchstart()
  50. Element.transform()
  51. Element.translate()
  52. Element.unclick()
  53. Element.undblclick()
  54. Element.undrag()
  55. Element.unhover()
  56. Element.unmousedown()
  57. Element.unmousemove()
  58. Element.unmouseout()
  59. Element.unmouseover()
  60. Element.unmouseup()
  61. Element.untouchcancel()
  62. Element.untouchend()
  63. Element.untouchmove()
  64. Element.untouchstart()
  65. Matrix
  66. Matrix.add()
  67. Matrix.clone()
  68. Matrix.invert()
  69. Matrix.rotate()
  70. Matrix.scale()
  71. Matrix.split()
  72. Matrix.toTransformString()
  73. Matrix.translate()
  74. Matrix.x()
  75. Matrix.y()
  76. Paper
  77. Paper.add()
  78. Paper.bottom
  79. Paper.ca
  80. Paper.circle()
  81. Paper.clear()
  82. Paper.customAttributes
  83. Paper.ellipse()
  84. Paper.forEach()
  85. Paper.getById()
  86. Paper.getElementByPoint()
  87. Paper.getFont()
  88. Paper.image()
  89. Paper.path()
  90. Paper.print()
  91. Paper.raphael
  92. Paper.rect()
  93. Paper.remove()
  94. Paper.renderfix()
  95. Paper.safari()
  96. Paper.set()
  97. Paper.setFinish()
  98. Paper.setSize()
  99. Paper.setStart()
  100. Paper.setViewBox()
  101. Paper.text()
  102. Paper.top
  103. Raphael()
  104. Raphael.angle()
  105. Raphael.animation()
  106. Raphael.color()
  107. Raphael.createUUID()
  108. Raphael.deg()
  109. Raphael.easing_formulas
  110. Raphael.el
  111. Raphael.findDotsAtSegment()
  112. Raphael.fn
  113. Raphael.format()
  114. Raphael.fullfill()
  115. Raphael.getColor()
  116. Raphael.getColor.reset()
  117. Raphael.getPointAtLength()
  118. Raphael.getRGB()
  119. Raphael.getSubpath()
  120. Raphael.getTotalLength()
  121. Raphael.hsb()
  122. Raphael.hsb2rgb()
  123. Raphael.hsl()
  124. Raphael.hsl2rgb()
  125. Raphael.is()
  126. Raphael.matrix()
  127. Raphael.ninja()
  128. Raphael.parsePathString()
  129. Raphael.parseTransformString()
  130. Raphael.path2curve()
  131. Raphael.pathToRelative()
  132. Raphael.rad()
  133. Raphael.registerFont()
  134. Raphael.rgb()
  135. Raphael.rgb2hsb()
  136. Raphael.rgb2hsl()
  137. Raphael.setWindow()
  138. Raphael.snapTo()
  139. Raphael.st
  140. Raphael.svg
  141. Raphael.type
  142. Raphael.vml
  143. Set
  144. Set.clear()
  145. Set.exclude()
  146. Set.forEach()
  147. Set.pop()
  148. Set.push()
  149. Set.splice()
  150. eve()
  151. eve.listeners()
  152. eve.nt()
  153. eve.on()
  154. eve.once()
  155. eve.stop()
  156. eve.unbind()
  157. eve.version

Raphaël Reference

 Animation

-

 Animation.delay(delay)

+

 Animation.delay(delay)

Creates a copy of existing animation object with given delay.

Parameters @@ -15,7 +15,7 @@ circle1.animate(anim); // run the given animation immediately circle2.animate(anim.delay(500)); // run the given animation after 500 ms -

 Animation.repeat(repeat)

+

 Animation.repeat(repeat)

Creates a copy of existing animation object with given repetition.

Parameters @@ -26,7 +26,7 @@ circle2.animate(anim.delay(500)); // run

Returns: object new altered Animation object

 Element

-

 Element.animate(…)

+

 Element.animate(…)

Creates and starts animation for given element.

Parameters @@ -53,7 +53,7 @@ circle2.animate(anim.delay(500)); // run

animation object, see Raphael.animation

Returns: object original element

-

 Element.animateWith(…)

+

 Element.animateWith(…)

Acts similar to Element.animate, but ensure that given animation runs in sync with another given element.

Parameters @@ -196,7 +196,7 @@ at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can o

  • hsla(•••, •••, •••, •••) — same as above, but with opacity
  • Optionally for hsb and hsl you could specify hue as a degree: “hsl(240deg, 1, .5)” or, if you want to go fancy, “hsl(240°, 1, .5)”
  • -

     Element.click(handler)

    +

     Element.click(handler)

    Adds event handler for click for the element.

    Parameters @@ -206,9 +206,9 @@ at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can o

    handler for the event

    Returns: object Element

    -

     Element.clone()

    +

     Element.clone()

    Returns: object clone of a given element

    -

     Element.data(key, [value])

    +

     Element.data(key, [value])

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

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

     Element.dblclick(handler)

    +

     Element.dblclick(handler)

    Adds event handler for double click for the element.

    Parameters @@ -247,7 +247,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 @@ -297,7 +297,7 @@ See also Element.removeData

    1. eventobjectDOM event object

    Returns: object Element

    -

     Element.getBBox(isWithoutTransform)

    +

     Element.getBBox(isWithoutTransform)

    Return bounding box for a given element

    Parameters @@ -312,7 +312,7 @@ See also Element.removeData

  • width:numberwidth
  • height:numberheight
  • }
  • -

     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 @@ -326,7 +326,7 @@ See also Element.removeData

  • y:numbery coordinate
  • 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 @@ -339,11 +339,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.glow([glow])

    +

     Element.glow([glow])

    Return set of elements that create glow-like effect around given element. See Paper.set.

    Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself. @@ -367,7 +367,7 @@ See also Element.removeData

    Makes element invisible. See Element.show.

    Returns: object Element

    -

     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 @@ -400,7 +400,7 @@ because all events are fired in format <module>.<action>.<id>

    Inserts current object before the given one.

    Returns: object Element

    -

     Element.mousedown(handler)

    +

     Element.mousedown(handler)

    Adds event handler for mousedown for the element.

    Parameters @@ -410,7 +410,7 @@ because all events are fired in format <module>.<action>.<id>handler for the event

    Returns: object Element

    -

     Element.mousemove(handler)

    +

     Element.mousemove(handler)

    Adds event handler for mousemove for the element.

    Parameters @@ -420,7 +420,7 @@ because all events are fired in format <module>.<action>.<id>handler for the event

    Returns: object Element

    -

     Element.mouseout(handler)

    +

     Element.mouseout(handler)

    Adds event handler for mouseout for the element.

    Parameters @@ -430,7 +430,7 @@ because all events are fired in format <module>.<action>.<id>handler for the event

    Returns: object Element

    -

     Element.mouseover(handler)

    +

     Element.mouseover(handler)

    Adds event handler for mouseover for the element.

    Parameters @@ -440,7 +440,7 @@ because all events are fired in format <module>.<action>.<id>handler for the event

    Returns: object Element

    -

     Element.mouseup(handler)

    +

     Element.mouseup(handler)

    Adds event handler for mouseup for the element.

    Parameters @@ -465,7 +465,7 @@ c.node.onclick = function () { c.attr("fill", "red"); }; -

     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 @@ -485,7 +485,7 @@ c.node.onclick = function () { .attr({stroke: "red"}); } -

     Element.pause([anim])

    +

     Element.pause([anim])

    Stops animation of the element with ability to resume it later on.

    Parameters @@ -513,7 +513,7 @@ c.node.onclick = function () {

     Element.remove()

    Removes element form the paper.

    -

     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.

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

    Returns: object Element

    -

     Element.resume([anim])

    +

     Element.resume([anim])

    Resumes animation if it was paused with Element.pause method.

    Parameters @@ -581,7 +581,7 @@ transformations of the element.

    If cx & cy aren’t specified centre of the shape is used instead.

    Returns: object Element

    -

     Element.setTime(anim, value)

    +

     Element.setTime(anim, value)

    Sets the status of animation of the element in milliseconds. Similar to Element.status method.

    Parameters @@ -602,7 +602,7 @@ transformations of the element.

    Makes element visible. See Element.hide.

    Returns: object Element

    -

     Element.status([anim], [value])

    +

     Element.status([anim], [value])

    Gets or sets the status of animation of the element.

    Parameters @@ -626,7 +626,7 @@ transformations of the element.

    or

    Returns: object original element if value is specified

    -

     Element.stop([anim])

    +

     Element.stop([anim])

    Stops animation of the element.

    Parameters @@ -645,7 +645,7 @@ transformations of the element.

    Moves the element so it is the closest to the viewer’s eyes, on top of other elements.

    Returns: object Element

    -

     Element.touchcancel(handler)

    +

     Element.touchcancel(handler)

    Adds event handler for touchcancel for the element.

    Parameters @@ -655,7 +655,7 @@ transformations 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 @@ -665,7 +665,7 @@ transformations 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 @@ -675,7 +675,7 @@ transformations 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 @@ -743,7 +743,7 @@ console.log(el.transform());

    vertical shift

    Returns: object Element

    -

     Element.unclick(handler)

    +

     Element.unclick(handler)

    Removes event handler for click for the element.

    Parameters @@ -753,7 +753,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.undblclick(handler)

    +

     Element.undblclick(handler)

    Removes event handler for double click for the element.

    Parameters @@ -763,10 +763,10 @@ console.log(el.transform());

    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 @@ -779,7 +779,7 @@ console.log(el.transform());

    handler for hover out

    Returns: object Element

    -

     Element.unmousedown(handler)

    +

     Element.unmousedown(handler)

    Removes event handler for mousedown for the element.

    Parameters @@ -789,7 +789,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.unmousemove(handler)

    +

     Element.unmousemove(handler)

    Removes event handler for mousemove for the element.

    Parameters @@ -799,7 +799,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.unmouseout(handler)

    +

     Element.unmouseout(handler)

    Removes event handler for mouseout for the element.

    Parameters @@ -809,7 +809,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.unmouseover(handler)

    +

     Element.unmouseover(handler)

    Removes event handler for mouseover for the element.

    Parameters @@ -819,7 +819,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.unmouseup(handler)

    +

     Element.unmouseup(handler)

    Removes event handler for mouseup for the element.

    Parameters @@ -829,7 +829,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.untouchcancel(handler)

    +

     Element.untouchcancel(handler)

    Removes event handler for touchcancel for the element.

    Parameters @@ -839,7 +839,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.untouchend(handler)

    +

     Element.untouchend(handler)

    Removes event handler for touchend for the element.

    Parameters @@ -849,7 +849,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.untouchmove(handler)

    +

     Element.untouchmove(handler)

    Removes event handler for touchmove for the element.

    Parameters @@ -859,7 +859,7 @@ console.log(el.transform());

    handler for the event

    Returns: object Element

    -

     Element.untouchstart(handler)

    +

     Element.untouchstart(handler)

    Removes event handler for touchstart for the element.

    Parameters @@ -870,7 +870,7 @@ console.log(el.transform());

    Returns: object Element

     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 @@ -897,15 +897,15 @@ console.log(el.transform());

    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 @@ -920,7 +920,7 @@ console.log(el.transform());

    number
     
    -

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

    +

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

    Scales the matrix

    Parameters @@ -941,7 +941,7 @@ console.log(el.transform());

    number
     
    -

     Matrix.split()

    +

     Matrix.split()

    Splits matrix into primitive transformations

    Returns: object in format:

    @@ -953,11 +953,11 @@ console.log(el.transform());
  • 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 @@ -969,7 +969,7 @@ console.log(el.transform());

    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 @@ -982,7 +982,7 @@ console.log(el.transform());

     

    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 @@ -996,8 +996,8 @@ console.log(el.transform());

    Returns: number y

     Paper

    -

     Paper.add(json)

    -

    Imports elements in JSON array in format {type: type, <attributes>}) +

     Paper.add(json)

    +

    Imports elements in JSON array in format {type: type, <attributes>}

    Parameters

    @@ -1025,13 +1025,13 @@ console.log(el.transform()); } ]);
    -

     Paper.bottom

    +

     Paper.bottom

    Points to the bottom element on the paper

     Paper.ca

    object

    Shortcut for Paper.customAttributes

    -

     Paper.circle(x, y, r)

    +

     Paper.circle(x, y, r)

    Draws a circle.

    Parameters @@ -1079,7 +1079,7 @@ paper.customAttributes.hsb = function (h, s, b) { c.attr({hsb: "0.5 .8 1"}); c.animate({hsb: [1, 0, 0.5]}, 1e3); -

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

    +

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

    Draws an ellipse.

    Parameters @@ -1102,7 +1102,7 @@ c.animate({hsb: [1, 0,

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

     Paper.forEach(callback, thisArg)

    +

     Paper.forEach(callback, thisArg)

    Executes given function for each element on the paper

    If callback function returns false it will stop loop running. @@ -1117,7 +1117,7 @@ c.animate({hsb: [1, 0, context object for the callback

    Returns: object Paper object

    -

     Paper.getById(id)

    +

     Paper.getById(id)

    Returns you element by its internal ID.

    Parameters @@ -1127,7 +1127,7 @@ c.animate({hsb: [1, 0, id

    Returns: object Raphaël element object

    -

     Paper.getElementByPoint(x, y)

    +

     Paper.getElementByPoint(x, y)

    Returns you topmost element under given point.

    Returns: object Raphaël element object

    @@ -1144,7 +1144,7 @@ c.animate({hsb: [1, 0,
    paper.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
     
    -

     Paper.getFont(family, [weight], [style], [stretch])

    +

     Paper.getFont(family, [weight], [style], [stretch])

    Finds font object in the registered fonts by given parameters. You could specify only one word from the font name, like “Myriad” for “Myriad Pro”.

    Parameters @@ -1170,7 +1170,7 @@ c.animate({hsb: [1, 0,

    paper.print(100, 100, "Test string", paper.getFont("Times", 800), 30);
     
    -

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

    +

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

    Embeds an image into the surface.

    Parameters @@ -1196,7 +1196,7 @@ c.animate({hsb: [1, 0,

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

     Paper.path([pathString])

    +

     Paper.path([pathString])

    Creates a path element by given path data string.

    Parameters @@ -1234,7 +1234,7 @@ c.animate({hsb: [1, 0, // draw a diagonal line: // move to 10,10, line to 90,90 -

     Paper.print(x, y, text, font, [size], [origin], [letter_spacing])

    +

     Paper.print(x, y, text, font, [size], [origin], [letter_spacing])

    Creates set of shapes to represent given font at given position with given size. Result of the method is set object (see Paper.set) which contains each letter as separate path object.

    @@ -1272,10 +1272,10 @@ Result of the method is set object (see Pap // following line will paint first letter in red txt[0].attr({fill: "#f00"}); -

     Paper.raphael

    Points to the Raphael object/function

    -

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

    +

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

    Draws a rectangle.

    @@ -1314,12 +1314,12 @@ txt[0].attr({fill: "#f00"}); on other elements after reflow it could shift half pixel which cause for lines to lost their crispness. This method fixes the issue.

    -

     Paper.safari()

    +

     Paper.safari()

    There is an inconvenient rendering bug in Safari (WebKit): sometimes the rendering should be forced. This method should help with dealing with this bug.

    -

     Paper.set()

    +

     Paper.set()

    Creates array-like object to keep and operate several elements at once. Warning: it doesn’t create any elements for itself in the page, it just groups existing elements. Sets act as pseudo elements — all methods available to an element can be used on a set. @@ -1334,11 +1334,11 @@ st.push( ); st.attr({fill: "red"}); // changes the fill of both circles -

     Paper.setFinish()

    +

     Paper.setFinish()

    See Paper.setStart. This method finishes catching and returns resulting set.

    Returns: object set

    -

     Paper.setSize(width, height)

    +

     Paper.setSize(width, height)

    If you need to change dimensions of the canvas call this method

    Parameters @@ -1359,7 +1359,7 @@ st.push( ); st.attr({fill: "red"}); -

     Paper.setStart()

    +

     Paper.setStart()

    Creates Paper.set. All elements that will be created after calling this method and before calling Paper.setFinish will be added to the set.

    @@ -1371,7 +1371,7 @@ paper.circle(30, 10, = paper.setFinish(); st.attr({fill: "red"}); // changes the fill of both circles -

     Paper.setViewBox(x, y, w, h, fit)

    +

     Paper.setViewBox(x, y, w, h, fit)

    Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by specifying new boundaries.

    @@ -1393,7 +1393,7 @@ specifying new boundaries.
    boolean
    true if you want graphics to fit into new boundary box
    -

     Paper.text(x, y, text)

    +

     Paper.text(x, y, text)

    Draws a text string. If you need line breaks, put “\n” in the string.

    Parameters @@ -1413,7 +1413,7 @@ specifying new boundaries.

    var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!");
     
    -

     Paper.top

    +

     Paper.top

    Points to the topmost element on the paper

     Raphael(…)

    @@ -1499,7 +1499,7 @@ from this instance will be bound to this canvas. text: "Dump" }]); -

     Raphael.angle(x1, y1, x2, y2, [x3], [y3])

    +

     Raphael.angle(x1, y1, x2, y2, [x3], [y3])

    Returns angle between two or three points

    Parameters @@ -1526,7 +1526,7 @@ from this instance will be bound to this canvas.

    y coord of third point

    Returns: number angle in degrees.

    -

     Raphael.animation(params, ms, [easing], [callback])

    +

     Raphael.animation(params, ms, [easing], [callback])

    Creates an animation object that can be passed to the Element.animate or Element.animateWith methods. See also Animation.delay and Animation.repeat methods.

    @@ -1548,7 +1548,7 @@ See also Animation.delay and callback function. Will be called at the end of animation.

    Returns: object Animation

    -

     Raphael.color(clr)

    +

     Raphael.color(clr)

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

    Parameters @@ -1568,10 +1568,10 @@ See also Animation.delay and vnumbervalue (brightness),

  • lnumberlightness
  • }
  • -

     Raphael.createUUID()

    Returns RFC4122, version 4 ID

    -

     Raphael.deg(deg)

    +

     Raphael.deg(deg)

    Transform angle to degrees

    Parameters @@ -1581,7 +1581,7 @@ See also Animation.delay and angle in radians

    Returns: number angle in degrees.

    -

     Raphael.easing_formulas

    Object that contains easing formulas for animation. You could extend it with your own. By default it has following list of easing:

    See also Easing demo.

    -

     Raphael.el

    +

     Raphael.el

    object

    You can add your own method to elements. This is usefull when you want to hack default functionality or want to wrap some common transformation or attributes in one method. In difference to canvas methods, you can redefine element method at any time. Expending element methods wouldn’t affect set. @@ -1608,7 +1608,7 @@ you can redefine element method at any time. Expending element methods wouldn’ // then use it paper.circle(100, 100, 20).red(); -

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

    +

     Raphael.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.

    @@ -1655,12 +1655,13 @@ 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
  • }
  • -

     Raphael.fn

    +

     Raphael.fn

    object

    You can add your own method to the canvas. For example if you want to draw a pie chart, you can create your own pie chart function and ship it as a Raphaël plugin. To do this -you need to extend the Raphael.fn object. Please note that you can create your own namespaces -inside the fn object — methods will be run in the context of canvas anyway. You should alter -the fn object before a Raphaël instance is created, otherwise it will take no effect. +you need to extend the Raphael.fn object. You should modify the fn object before a +Raphaël instance is created, otherwise it will take no effect. Please note that the +ability for namespaced plugins was removed in Raphael 2.0. It is up to the plugin to +ensure any namespacing ensures proper context.

    Usage

    @@ -1679,7 +1680,7 @@ paper.arrow(10, 10,

     Raphael.format(token, …)

    +

     Raphael.format(token, …)

    Simple format function. Replaces construction of type “{<number>}” to the corresponding argument.

    Parameters @@ -1699,9 +1700,9 @@ paper.mystuff.star(); width = 40, height = 50; // this will draw a rectangular shape equivalent to "M10,20h40v50h-40z" -paper.path(Raphael.format("M{1},{2}h{3}v{4}h{5}z", x, y, width, height, -width)); +paper.path(Raphael.format("M{0},{1}h{2}v{3}h{4}z", x, y, width, height, -width)); -

     Raphael.fullfill(token, json)

    +

     Raphael.fullfill(token, json)

    A little bit more advanced format function than Raphael.format. Replaces construction of type “{<name>}” to the corresponding argument.

    Parameters @@ -1727,7 +1728,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w } })); -

     Raphael.getColor([value])

    +

     Raphael.getColor([value])

    On each call returns next colour in the spectrum. To reset it back to red call Raphael.getColor.reset

    Parameters @@ -1738,10 +1739,10 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    brightness, default is 0.75

    Returns: string hex representation of the colour.

    -

     Raphael.getColor.reset()

    +

     Raphael.getColor.reset()

    Resets spectrum position for Raphael.getColor back to red.

    -

     Raphael.getPointAtLength(path, length)

    +

     Raphael.getPointAtLength(path, length)

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

    Parameters @@ -1758,7 +1759,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

  • y:numbery coordinate
  • alpha:numberangle of derivative
  • }
  • -

     Raphael.getRGB(colour)

    +

     Raphael.getRGB(colour)

    Parses colour string as RGB object

    Parameters @@ -1785,7 +1786,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

  • hexstringcolor in HTML/CSS format: #••••••,
  • errorbooleantrue if string can’t be parsed
  • }
  • -

     Raphael.getSubpath(path, from, to)

    +

     Raphael.getSubpath(path, from, to)

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

    Parameters @@ -1801,7 +1802,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    position of the end of the segment

    Returns: string pathstring for the segment

    -

     Raphael.getTotalLength(path)

    +

     Raphael.getTotalLength(path)

    Returns length of the given path in pixels.

    Parameters @@ -1811,7 +1812,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    SVG path string.

    Returns: number length.

    -

     Raphael.hsb(h, s, b)

    +

     Raphael.hsb(h, s, b)

    Converts HSB values to hex representation of the colour.

    Parameters @@ -1827,7 +1828,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    value or brightness

    Returns: string hex representation of the colour.

    -

     Raphael.hsb2rgb(h, s, v)

    +

     Raphael.hsb2rgb(h, s, v)

    Converts HSB values to RGB object.

    Parameters @@ -1848,7 +1849,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

  • bnumberblue,
  • hexstringcolor in HTML/CSS format: #••••••
  • }
  • -

     Raphael.hsl(h, s, l)

    +

     Raphael.hsl(h, s, l)

    Converts HSL values to hex representation of the colour.

    Parameters @@ -1864,7 +1865,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    luminosity

    Returns: string hex representation of the colour.

    -

     Raphael.hsl2rgb(h, s, l)

    +

     Raphael.hsl2rgb(h, s, l)

    Converts HSL values to RGB object.

    Parameters @@ -1885,7 +1886,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

  • bnumberblue,
  • hexstringcolor in HTML/CSS format: #••••••
  • }
  • -

     Raphael.is(o, type)

    +

     Raphael.is(o, type)

    Handfull replacement for typeof operator.

    Parameters @@ -1898,7 +1899,7 @@ paper.path(Raphael.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative w

    name of the type, i.e. “string”, “function”, “number”, etc.

    Returns: boolean is given value is of given type

    -

     Raphael.matrix(a, b, c, d, e, f)

    +

     Raphael.matrix(a, b, c, d, e, f)

    Utility method Returns matrix based on given parameters.

    @@ -1924,7 +1925,7 @@ Returns matrix based on given parameters.
     

    Returns: object Matrix

    -

     Raphael.ninja()

    +

     Raphael.ninja()

    If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable Raphael, but anyway.) You can use ninja method. Beware, that in this case plugins could stop working, because they are depending on global variable existance.

    @@ -1936,7 +1937,7 @@ Beware, that in this case plugins could stop working, because they are depending … })(Raphael.ninja()); -

     Raphael.parsePathString(pathString)

    +

     Raphael.parsePathString(pathString)

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

    @@ -1947,7 +1948,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.

    -

     Raphael.parseTransformString(TString)

    +

     Raphael.parseTransformString(TString)

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

    @@ -1958,7 +1959,7 @@ Parses given path string into an array of transformations.
    transform string or array of transformations (in the last case it will be returned straight away)

    Returns: array array of transformations.

    -

     Raphael.path2curve(pathString)

    +

     Raphael.path2curve(pathString)

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

    @@ -1969,7 +1970,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.

    -

     Raphael.pathToRelative(pathString)

    +

     Raphael.pathToRelative(pathString)

    Utility method Converts path to relative form

    @@ -1980,7 +1981,7 @@ Converts path to relative form
    path string or array of segments

    Returns: array array of segments.

    -

     Raphael.rad(deg)

    +

     Raphael.rad(deg)

    Transform angle to radians

    Parameters @@ -1990,7 +1991,7 @@ Converts path to relative form

    angle in degrees

    Returns: number angle in radians.

    -

     Raphael.registerFont(font)

    +

     Raphael.registerFont(font)

    Adds given font to the registered set of fonts for Raphaël. Should be used as an internal call from within Cufón’s font file. Returns original parameter, so it could be used with chaining.

    @@ -2006,7 +2007,7 @@ Returns original parameter, so it could be used with chaining.

    Cufon.registerFont(Raphael.registerFont({…}));
     
    -

     Raphael.rgb(r, g, b)

    +

     Raphael.rgb(r, g, b)

    Converts RGB values to hex representation of the colour.

    Parameters @@ -2022,7 +2023,7 @@ Returns original parameter, so it could be used with chaining.

    blue

    Returns: string hex representation of the colour.

    -

     Raphael.rgb2hsb(r, g, b)

    +

     Raphael.rgb2hsb(r, g, b)

    Converts RGB values to HSB object.

    Parameters @@ -2042,7 +2043,7 @@ Returns original parameter, so it could be used with chaining.

  • snumbersaturation
  • bnumberbrightness
  • }
  • -

     Raphael.rgb2hsl(r, g, b)

    +

     Raphael.rgb2hsl(r, g, b)

    Converts RGB values to HSL object.

    Parameters @@ -2062,7 +2063,7 @@ Returns original parameter, so it could be used with chaining.

  • snumbersaturation
  • lnumberluminosity
  • }
  • -

     Raphael.setWindow(newwin)

    +

     Raphael.setWindow(newwin)

    Used when you need to draw in <iframe>. Switched window to the iframe one.

    Parameters @@ -2071,7 +2072,7 @@ Returns original parameter, so it could be used with chaining.

    window
    new window object
    -

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

    +

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

    Snaps given value to given grid.

    Parameters @@ -2088,7 +2089,7 @@ Returns original parameter, so it could be used with chaining.

    tolerance for snapping. Default is 10.

    Returns: number adjusted value.

    -

     Raphael.st

    +

     Raphael.st

    object

    You can add your own method to elements and sets. It is wise to add a set method for each element method you added, so you will be able to call the same method on sets too. See also Raphael.el. @@ -2116,10 +2117,10 @@ paper.set(paper.circle(100, 100, <

    boolean

    true if browser supports VML.

     Set

    -

     Set.clear()

    +

     Set.clear()

    Removeds all elements from the set

    -

     Set.exclude(element)

    +

     Set.exclude(element)

    Removes given element from the set

    Parameters @@ -2129,7 +2130,7 @@ paper.set(paper.circle(100, 100, <

    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. @@ -2144,15 +2145,15 @@ paper.set(paper.circle(100, 100, <

    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 -- 2.39.2