Documentation fixes
[raphael] / reference.html
1 <!DOCTYPE html>
2 <!-- Generated with Dr.js -->
3 <html lang="en"><head><meta charset="utf-8"><title>Raphaël 2.0 Reference</title><link rel="stylesheet" href="dr.css"></head><body id="dr-js"><div id="dr"><ol class="dr-toc"><li class="dr-lvl0"><a href="#Animation" class="{clas}"><span>Animation</span></a></li><li class="dr-lvl1"><a href="#Animation.delay" class="dr-method"><span>Animation.delay()</span></a></li><li class="dr-lvl1"><a href="#Animation.repeat" class="dr-method"><span>Animation.repeat()</span></a></li><li class="dr-lvl0"><a href="#Element" class="{clas}"><span>Element</span></a></li><li class="dr-lvl1"><a href="#Element.animate" class="dr-method"><span>Element.animate()</span></a></li><li class="dr-lvl1"><a href="#Element.animateWith" class="dr-method"><span>Element.animateWith()</span></a></li><li class="dr-lvl1"><a href="#Element.attr" class="dr-method"><span>Element.attr()</span></a></li><li class="dr-lvl1"><a href="#Element.click" class="dr-method"><span>Element.click()</span></a></li><li class="dr-lvl1"><a href="#Element.clone" class="dr-method"><span>Element.clone()</span></a></li><li class="dr-lvl1"><a href="#Element.data" class="dr-method"><span>Element.data()</span></a></li><li class="dr-lvl1"><a href="#Element.dblclick" class="dr-method"><span>Element.dblclick()</span></a></li><li class="dr-lvl1"><a href="#Element.drag" class="dr-method"><span>Element.drag()</span></a></li><li class="dr-lvl1"><a href="#Element.getBBox" class="dr-method"><span>Element.getBBox()</span></a></li><li class="dr-lvl1"><a href="#Element.getPointAtLength" class="dr-method"><span>Element.getPointAtLength()</span></a></li><li class="dr-lvl1"><a href="#Element.getSubpath" class="dr-method"><span>Element.getSubpath()</span></a></li><li class="dr-lvl1"><a href="#Element.getTotalLength" class="dr-method"><span>Element.getTotalLength()</span></a></li><li class="dr-lvl1"><a href="#Element.glow" class="dr-method"><span>Element.glow()</span></a></li><li class="dr-lvl1"><a href="#Element.hide" class="dr-method"><span>Element.hide()</span></a></li><li class="dr-lvl1"><a href="#Element.hover" class="dr-method"><span>Element.hover()</span></a></li><li class="dr-lvl1"><a href="#Element.id" class="dr-property"><span>Element.id</span></a></li><li class="dr-lvl1"><a href="#Element.insertAfter" class="dr-method"><span>Element.insertAfter()</span></a></li><li class="dr-lvl1"><a href="#Element.insertBefore" class="dr-method"><span>Element.insertBefore()</span></a></li><li class="dr-lvl1"><a href="#Element.mousedown" class="dr-method"><span>Element.mousedown()</span></a></li><li class="dr-lvl1"><a href="#Element.mousemove" class="dr-method"><span>Element.mousemove()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseout" class="dr-method"><span>Element.mouseout()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseover" class="dr-method"><span>Element.mouseover()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseup" class="dr-method"><span>Element.mouseup()</span></a></li><li class="dr-lvl1"><a href="#Element.next" class="dr-property"><span>Element.next</span></a></li><li class="dr-lvl1"><a href="#Element.node" class="dr-property"><span>Element.node</span></a></li><li class="dr-lvl1"><a href="#Element.onDragOver" class="dr-method"><span>Element.onDragOver()</span></a></li><li class="dr-lvl1"><a href="#Element.paper" class="dr-property"><span>Element.paper</span></a></li><li class="dr-lvl1"><a href="#Element.pause" class="dr-method"><span>Element.pause()</span></a></li><li class="dr-lvl1"><a href="#Element.prev" class="dr-property"><span>Element.prev</span></a></li><li class="dr-lvl1"><a href="#Element.raphael" class="dr-property"><span>Element.raphael</span></a></li><li class="dr-lvl1"><a href="#Element.remove" class="dr-method"><span>Element.remove()</span></a></li><li class="dr-lvl1"><a href="#Element.removeData" class="dr-method"><span>Element.removeData()</span></a></li><li class="dr-lvl1"><a href="#Element.resume" class="dr-method"><span>Element.resume()</span></a></li><li class="dr-lvl1"><a href="#Element.rotate" class="dr-method"><span>Element.rotate()</span></a></li><li class="dr-lvl1"><a href="#Element.scale" class="dr-method"><span>Element.scale()</span></a></li><li class="dr-lvl1"><a href="#Element.setTime" class="dr-method"><span>Element.setTime()</span></a></li><li class="dr-lvl1"><a href="#Element.show" class="dr-method"><span>Element.show()</span></a></li><li class="dr-lvl1"><a href="#Element.status" class="dr-method"><span>Element.status()</span></a></li><li class="dr-lvl1"><a href="#Element.stop" class="dr-method"><span>Element.stop()</span></a></li><li class="dr-lvl1"><a href="#Element.toBack" class="dr-method"><span>Element.toBack()</span></a></li><li class="dr-lvl1"><a href="#Element.toFront" class="dr-method"><span>Element.toFront()</span></a></li><li class="dr-lvl1"><a href="#Element.touchcancel" class="dr-method"><span>Element.touchcancel()</span></a></li><li class="dr-lvl1"><a href="#Element.touchend" class="dr-method"><span>Element.touchend()</span></a></li><li class="dr-lvl1"><a href="#Element.touchmove" class="dr-method"><span>Element.touchmove()</span></a></li><li class="dr-lvl1"><a href="#Element.touchstart" class="dr-method"><span>Element.touchstart()</span></a></li><li class="dr-lvl1"><a href="#Element.transform" class="dr-method"><span>Element.transform()</span></a></li><li class="dr-lvl1"><a href="#Element.translate" class="dr-method"><span>Element.translate()</span></a></li><li class="dr-lvl1"><a href="#Element.unclick" class="dr-method"><span>Element.unclick()</span></a></li><li class="dr-lvl1"><a href="#Element.undblclick" class="dr-method"><span>Element.undblclick()</span></a></li><li class="dr-lvl1"><a href="#Element.undrag" class="dr-method"><span>Element.undrag()</span></a></li><li class="dr-lvl1"><a href="#Element.unhover" class="dr-method"><span>Element.unhover()</span></a></li><li class="dr-lvl1"><a href="#Element.unmousedown" class="dr-method"><span>Element.unmousedown()</span></a></li><li class="dr-lvl1"><a href="#Element.unmousemove" class="dr-method"><span>Element.unmousemove()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseout" class="dr-method"><span>Element.unmouseout()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseover" class="dr-method"><span>Element.unmouseover()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseup" class="dr-method"><span>Element.unmouseup()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchcancel" class="dr-method"><span>Element.untouchcancel()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchend" class="dr-method"><span>Element.untouchend()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchmove" class="dr-method"><span>Element.untouchmove()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchstart" class="dr-method"><span>Element.untouchstart()</span></a></li><li class="dr-lvl0"><a href="#Matrix" class="{clas}"><span>Matrix</span></a></li><li class="dr-lvl1"><a href="#Matrix.add" class="dr-method"><span>Matrix.add()</span></a></li><li class="dr-lvl1"><a href="#Matrix.clone" class="dr-method"><span>Matrix.clone()</span></a></li><li class="dr-lvl1"><a href="#Matrix.invert" class="dr-method"><span>Matrix.invert()</span></a></li><li class="dr-lvl1"><a href="#Matrix.rotate" class="dr-method"><span>Matrix.rotate()</span></a></li><li class="dr-lvl1"><a href="#Matrix.scale" class="dr-method"><span>Matrix.scale()</span></a></li><li class="dr-lvl1"><a href="#Matrix.split" class="dr-method"><span>Matrix.split()</span></a></li><li class="dr-lvl1"><a href="#Matrix.toTransformString" class="dr-method"><span>Matrix.toTransformString()</span></a></li><li class="dr-lvl1"><a href="#Matrix.translate" class="dr-method"><span>Matrix.translate()</span></a></li><li class="dr-lvl1"><a href="#Matrix.x" class="dr-method"><span>Matrix.x()</span></a></li><li class="dr-lvl1"><a href="#Matrix.y" class="dr-method"><span>Matrix.y()</span></a></li><li class="dr-lvl0"><a href="#Paper" class="{clas}"><span>Paper</span></a></li><li class="dr-lvl1"><a href="#Paper.bottom" class="dr-property"><span>Paper.bottom</span></a></li><li class="dr-lvl1"><a href="#Paper.circle" class="dr-method"><span>Paper.circle()</span></a></li><li class="dr-lvl1"><a href="#Paper.clear" class="dr-method"><span>Paper.clear()</span></a></li><li class="dr-lvl1"><a href="#Paper.customAttributes" class="dr-property"><span>Paper.customAttributes</span></a></li><li class="dr-lvl1"><a href="#Paper.ellipse" class="dr-method"><span>Paper.ellipse()</span></a></li><li class="dr-lvl1"><a href="#Paper.forEach" class="dr-method"><span>Paper.forEach()</span></a></li><li class="dr-lvl1"><a href="#Paper.getById" class="dr-method"><span>Paper.getById()</span></a></li><li class="dr-lvl1"><a href="#Paper.getElementByPoint" class="dr-method"><span>Paper.getElementByPoint()</span></a></li><li class="dr-lvl1"><a href="#Paper.getFont" class="dr-method"><span>Paper.getFont()</span></a></li><li class="dr-lvl1"><a href="#Paper.image" class="dr-method"><span>Paper.image()</span></a></li><li class="dr-lvl1"><a href="#Paper.path" class="dr-method"><span>Paper.path()</span></a></li><li class="dr-lvl1"><a href="#Paper.print" class="dr-method"><span>Paper.print()</span></a></li><li class="dr-lvl1"><a href="#Paper.raphael" class="dr-property"><span>Paper.raphael</span></a></li><li class="dr-lvl1"><a href="#Paper.rect" class="dr-method"><span>Paper.rect()</span></a></li><li class="dr-lvl1"><a href="#Paper.remove" class="dr-method"><span>Paper.remove()</span></a></li><li class="dr-lvl1"><a href="#Paper.renderfix" class="dr-method"><span>Paper.renderfix()</span></a></li><li class="dr-lvl1"><a href="#Paper.safari" class="dr-method"><span>Paper.safari()</span></a></li><li class="dr-lvl1"><a href="#Paper.set" class="dr-method"><span>Paper.set()</span></a></li><li class="dr-lvl1"><a href="#Paper.setFinish" class="dr-method"><span>Paper.setFinish()</span></a></li><li class="dr-lvl1"><a href="#Paper.setSize" class="dr-method"><span>Paper.setSize()</span></a></li><li class="dr-lvl1"><a href="#Paper.setStart" class="dr-method"><span>Paper.setStart()</span></a></li><li class="dr-lvl1"><a href="#Paper.setViewBox" class="dr-method"><span>Paper.setViewBox()</span></a></li><li class="dr-lvl1"><a href="#Paper.text" class="dr-method"><span>Paper.text()</span></a></li><li class="dr-lvl1"><a href="#Paper.top" class="dr-property"><span>Paper.top</span></a></li><li class="dr-lvl0"><a href="#Raphael" class="dr-method"><span>Raphael()</span></a></li><li class="dr-lvl1"><a href="#Raphael.angle" class="dr-method"><span>Raphael.angle()</span></a></li><li class="dr-lvl1"><a href="#Raphael.animation" class="dr-method"><span>Raphael.animation()</span></a></li><li class="dr-lvl1"><a href="#Raphael.color" class="dr-method"><span>Raphael.color()</span></a></li><li class="dr-lvl1"><a href="#Raphael.deg" class="dr-method"><span>Raphael.deg()</span></a></li><li class="dr-lvl1"><a href="#Raphael.easing_formulas" class="dr-property"><span>Raphael.easing_formulas</span></a></li><li class="dr-lvl1"><a href="#Raphael.el" class="dr-property"><span>Raphael.el</span></a></li><li class="dr-lvl1"><a href="#Raphael.findDotsAtSegment" class="dr-method"><span>Raphael.findDotsAtSegment()</span></a></li><li class="dr-lvl1"><a href="#Raphael.fn" class="dr-property"><span>Raphael.fn</span></a></li><li class="dr-lvl1"><a href="#Raphael.format" class="dr-method"><span>Raphael.format()</span></a></li><li class="dr-lvl1"><a href="#Raphael.fullfill" class="dr-method"><span>Raphael.fullfill()</span></a></li><li class="dr-lvl1"><a href="#Raphael.getColor" class="dr-method"><span>Raphael.getColor()</span></a></li><li class="dr-lvl2"><a href="#Raphael.getColor.reset" class="dr-method"><span>Raphael.getColor.reset()</span></a></li><li class="dr-lvl1"><a href="#Raphael.getPointAtLength" class="dr-method"><span>Raphael.getPointAtLength()</span></a></li><li class="dr-lvl1"><a href="#Raphael.getRGB" class="dr-method"><span>Raphael.getRGB()</span></a></li><li class="dr-lvl1"><a href="#Raphael.getSubpath" class="dr-method"><span>Raphael.getSubpath()</span></a></li><li class="dr-lvl1"><a href="#Raphael.getTotalLength" class="dr-method"><span>Raphael.getTotalLength()</span></a></li><li class="dr-lvl1"><a href="#Raphael.hsb" class="dr-method"><span>Raphael.hsb()</span></a></li><li class="dr-lvl1"><a href="#Raphael.hsb2rgb" class="dr-method"><span>Raphael.hsb2rgb()</span></a></li><li class="dr-lvl1"><a href="#Raphael.hsl" class="dr-method"><span>Raphael.hsl()</span></a></li><li class="dr-lvl1"><a href="#Raphael.hsl2rgb" class="dr-method"><span>Raphael.hsl2rgb()</span></a></li><li class="dr-lvl1"><a href="#Raphael.is" class="dr-method"><span>Raphael.is()</span></a></li><li class="dr-lvl1"><a href="#Raphael.matrix" class="dr-method"><span>Raphael.matrix()</span></a></li><li class="dr-lvl1"><a href="#Raphael.ninja" class="dr-method"><span>Raphael.ninja()</span></a></li><li class="dr-lvl1"><a href="#Raphael.parsePathString" class="dr-method"><span>Raphael.parsePathString()</span></a></li><li class="dr-lvl1"><a href="#Raphael.parseTransformString" class="dr-method"><span>Raphael.parseTransformString()</span></a></li><li class="dr-lvl1"><a href="#Raphael.path2curve" class="dr-method"><span>Raphael.path2curve()</span></a></li><li class="dr-lvl1"><a href="#Raphael.pathToRelative" class="dr-method"><span>Raphael.pathToRelative()</span></a></li><li class="dr-lvl1"><a href="#Raphael.rad" class="dr-method"><span>Raphael.rad()</span></a></li><li class="dr-lvl1"><a href="#Raphael.registerFont" class="dr-method"><span>Raphael.registerFont()</span></a></li><li class="dr-lvl1"><a href="#Raphael.rgb" class="dr-method"><span>Raphael.rgb()</span></a></li><li class="dr-lvl1"><a href="#Raphael.rgb2hsb" class="dr-method"><span>Raphael.rgb2hsb()</span></a></li><li class="dr-lvl1"><a href="#Raphael.rgb2hsl" class="dr-method"><span>Raphael.rgb2hsl()</span></a></li><li class="dr-lvl1"><a href="#Raphael.setWindow" class="dr-method"><span>Raphael.setWindow()</span></a></li><li class="dr-lvl1"><a href="#Raphael.snapTo" class="dr-method"><span>Raphael.snapTo()</span></a></li><li class="dr-lvl1"><a href="#Raphael.st" class="dr-property"><span>Raphael.st</span></a></li><li class="dr-lvl1"><a href="#Raphael.svg" class="dr-property"><span>Raphael.svg</span></a></li><li class="dr-lvl1"><a href="#Raphael.type" class="dr-property"><span>Raphael.type</span></a></li><li class="dr-lvl1"><a href="#Raphael.vml" class="dr-property"><span>Raphael.vml</span></a></li><li class="dr-lvl0"><a href="#Set" class="{clas}"><span>Set</span></a></li><li class="dr-lvl1"><a href="#Set.forEach" class="dr-method"><span>Set.forEach()</span></a></li><li class="dr-lvl1"><a href="#Set.pop" class="dr-method"><span>Set.pop()</span></a></li><li class="dr-lvl1"><a href="#Set.push" class="dr-method"><span>Set.push()</span></a></li><li class="dr-lvl0"><a href="#eve" class="dr-method"><span>eve()</span></a></li><li class="dr-lvl1"><a href="#eve.listeners" class="dr-method"><span>eve.listeners()</span></a></li><li class="dr-lvl1"><a href="#eve.nt" class="dr-method"><span>eve.nt()</span></a></li><li class="dr-lvl1"><a href="#eve.on" class="dr-method"><span>eve.on()</span></a></li><li class="dr-lvl1"><a href="#eve.stop" class="dr-method"><span>eve.stop()</span></a></li><li class="dr-lvl1"><a href="#eve.unbind" class="dr-method"><span>eve.unbind()</span></a></li><li class="dr-lvl1"><a href="#eve.version" class="dr-property"><span>eve.version</span></a></li></ol><div class="dr-doc"><h1>Raphaël 2.0 Reference</h1><div class="Animation-section"><h2 id="Animation" class="undefined"><i class="dr-trixie">&#160;</i>Animation<a href="#Animation" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
4 <div class="extra"></div></div><div class="Animation.delay-section"><h3 id="Animation.delay" class="dr-method"><i class="dr-trixie">&#160;</i>Animation.delay(delay)<a href="#Animation.delay" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3608 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3608">&#x27ad;</a></h3>
5 <div class="dr-method"><p>Creates a copy of existing animation object with given delay.
6 </p>
7 <p class="header">Parameters
8 </p>
9 <dl class="dr-parameters"><dt class="dr-param">delay</dt>
10 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
11 <dd class="dr-description">number of ms to pass between animation start and actual animation</dd>
12 </dl>
13 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">new altered Animation object</span></p>
14 </div><div class="extra"></div></div><div class="Animation.repeat-section"><h3 id="Animation.repeat" class="dr-method"><i class="dr-trixie">&#160;</i>Animation.repeat(repeat)<a href="#Animation.repeat" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3626 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3626">&#x27ad;</a></h3>
15 <div class="dr-method"><p>Creates a copy of existing animation object with given repetition.
16 </p>
17 <p class="header">Parameters
18 </p>
19 <dl class="dr-parameters"><dt class="dr-param">repeat</dt>
20 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
21 <dd class="dr-description">number iterations of animation. For infinite animation pass <code>Infinity</code></dd>
22 </dl>
23 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">new altered Animation object</span></p>
24 </div><div class="extra"></div></div><div class="Element-section"><h2 id="Element" class="undefined"><i class="dr-trixie">&#160;</i>Element<a href="#Element" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
25 <div class="extra"></div></div><div class="Element.animate-section"><h3 id="Element.animate" class="dr-method"><i class="dr-trixie">&#160;</i>Element.animate(…)<a href="#Element.animate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3890 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3890">&#x27ad;</a></h3>
26 <div class="dr-method"><p>Creates and starts animation for given element.
27 </p>
28 <p class="header">Parameters
29 </p>
30 <dl class="dr-parameters"><dt class="dr-param">params</dt>
31 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
32 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
33 <dt class="dr-param">ms</dt>
34 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
35 <dd class="dr-description">number of milliseconds for animation to run</dd>
36 <dt class="dr-param optional">easing</dt>
37 <dd class="dr-optional">optional</dd>
38 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
39 <dd class="dr-description">easing type. Accept one of <a href="#Raphael.easing_formulas" class="dr-link">Raphael.easing_formulas</a> or CSS format: <code>cubic&#x2010;bezier(XX,&#160;XX,&#160;XX,&#160;XX)</code></dd>
40 <dt class="dr-param optional">callback</dt>
41 <dd class="dr-optional">optional</dd>
42 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
43 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
44 </dl>
45 <p>or
46 </p>
47 <dl class="dr-parameters"><dt class="dr-param">animation</dt>
48 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
49 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
50 </dl>
51 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
52 </div><div class="extra"></div></div><div class="Element.animateWith-section"><h3 id="Element.animateWith" class="dr-method"><i class="dr-trixie">&#160;</i>Element.animateWith(…)<a href="#Element.animateWith" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3513 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3513">&#x27ad;</a></h3>
53 <div class="dr-method"><p>Acts similar to <a href="#Element.animate" class="dr-link">Element.animate</a>, but ensure that given animation runs in sync with another given element.
54 </p>
55 <p class="header">Parameters
56 </p>
57 <dl class="dr-parameters"><dt class="dr-param">params</dt>
58 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
59 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
60 <dt class="dr-param">ms</dt>
61 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
62 <dd class="dr-description">number of milliseconds for animation to run</dd>
63 <dt class="dr-param optional">easing</dt>
64 <dd class="dr-optional">optional</dd>
65 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
66 <dd class="dr-description">easing type. Accept on of <a href="#Raphael.easing_formulas" class="dr-link">Raphael.easing_formulas</a> or CSS format: <code>cubic&#x2010;bezier(XX,&#160;XX,&#160;XX,&#160;XX)</code></dd>
67 <dt class="dr-param optional">callback</dt>
68 <dd class="dr-optional">optional</dd>
69 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
70 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
71 </dl>
72 <p>or
73 </p>
74 <dl class="dr-parameters"><dt class="dr-param">animation</dt>
75 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
76 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
77 </dl>
78 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
79 </div><div class="extra"></div></div><div class="Element.attr-section"><h3 id="Element.attr" class="dr-method"><i class="dr-trixie">&#160;</i>Element.attr(…)<a href="#Element.attr" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 980 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L980">&#x27ad;</a></h3>
80 <div class="dr-method"><p>Sets the attributes of the element.
81 </p>
82 <p class="header">Parameters
83 </p>
84 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
85 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
86 <dd class="dr-description">attribute’s name</dd>
87 <dt class="dr-param">value</dt>
88 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
89 <dd class="dr-description">value</dd>
90 </dl>
91 <p>or
92 </p>
93 <dl class="dr-parameters"><dt class="dr-param">params</dt>
94 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
95 <dd class="dr-description">object of name/value pairs</dd>
96 </dl>
97 <p>or
98 </p>
99 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
100 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
101 <dd class="dr-description">attribute’s name</dd>
102 </dl>
103 <p>or
104 </p>
105 <dl class="dr-parameters"><dt class="dr-param">attrNames</dt>
106 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
107 <dd class="dr-description">in this case method returns array of current values for given attribute names</dd>
108 </dl>
109 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a> if attrsName <em class="amp">&amp;</em> value or params are passed in.</span></p>
110 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-...">...</em> <span class="dr-description">value of the attribute if only attrsName is passed in.</span></p>
111 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of values of the attribute if attrsNames is passed in.</span></p>
112 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">object of attributes if nothing is passed in.</span></p>
113 <p class="header">Possible parameters
114 </p>
115 <p>Please refer to the <a href="http://www.w3.org/TR/SVG/" title="The W3C Recommendation for the SVG language describes these properties in detail.">SVG specification</a> for an explanation of these parameters.</p>
116 <ol class="dr-json"><li><span class="dr-json-key">arrow-end</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">arrowhead on the end of the path. The format for string is <code>&lt;type>[-&lt;width>[-&lt;length>]]</code>. Possible types: <code>classic</code>, <code>block</code>, <code>open</code>, <code>oval</code>, <code>diamond</code>, <code>none</code>, width: <code>wide</code>, <code>narrow</code>, <code>midium</code>, length: <code>long</code>, <code>short</code>, <code>midium</code>.</span>
117 <li><span class="dr-json-key">clip-rect</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">comma or space separated values: x, y, width and height</span>
118 <li><span class="dr-json-key">cursor</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">CSS type of the cursor</span>
119 <li><span class="dr-json-key">cx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
120 <li><span class="dr-json-key">cy</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
121 <li><span class="dr-json-key">fill</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">colour, gradient or image</span>
122 <li><span class="dr-json-key">fill-opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
123 <li><span class="dr-json-key">font</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
124 <li><span class="dr-json-key">font-family</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
125 <li><span class="dr-json-key">font-size</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">font size in pixels</span>
126 <li><span class="dr-json-key">font-weight</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
127 <li><span class="dr-json-key">height</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
128 <li><span class="dr-json-key">href</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">URL, if specified element behaves as hyperlink</span>
129 <li><span class="dr-json-key">opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
130 <li><span class="dr-json-key">path</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">SVG path string format</span>
131 <li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
132 <li><span class="dr-json-key">rx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
133 <li><span class="dr-json-key">ry</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
134 <li><span class="dr-json-key">src</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">image URL, only works for <a href="#Element.image" class="dr-link">Element.image</a> element</span>
135 <li><span class="dr-json-key">stroke</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">stroke colour</span>
136 <li><span class="dr-json-key">stroke-dasharray</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“”, “<code>-</code>”, “<code>.</code>”, “<code>-.</code>”, “<code>-..</code>”, “<code>. </code>”, “<code>- </code>”, “<code>--</code>”, “<code>- .</code>”, “<code>--.</code>”, “<code>--..</code>”]</span>
137 <li><span class="dr-json-key">stroke-linecap</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>butt</code>”, “<code>square</code>”, “<code>round</code>”]</span>
138 <li><span class="dr-json-key">stroke-linejoin</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>bevel</code>”, “<code>round</code>”, “<code>miter</code>”]</span>
139 <li><span class="dr-json-key">stroke-miterlimit</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
140 <li><span class="dr-json-key">stroke-opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
141 <li><span class="dr-json-key">stroke-width</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">stroke width in pixels, default is '1'</span>
142 <li><span class="dr-json-key">target</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">used with href</span>
143 <li><span class="dr-json-key">text</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">contents of the text element. Use <code>\n</code> for multiline text</span>
144 <li><span class="dr-json-key">text-anchor</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>start</code>”, “<code>middle</code>”, “<code>end</code>”], default is “<code>middle</code>”</span>
145 <li><span class="dr-json-key">title</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">will create tooltip with a given text</span>
146 <li><span class="dr-json-key">transform</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">see <a href="#Element.transform" class="dr-link">Element.transform</a></span>
147 <li><span class="dr-json-key">width</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
148 <li><span class="dr-json-key">x</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
149 <li><span class="dr-json-key">y</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
150 </ol>
151 <p class="header">Gradients
152 <p>Linear gradient format: “<code>‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>90-#fff-#000</code>” – 90°
153 gradient from white to black or “<code>0-#fff-#f00:20-#000</code>” – 0° gradient from white via red (at 20%) to black.
154 </p>
155 <p>radial gradient: “<code>r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>r#fff-#000</code>” –
156 gradient from white to black or “<code>r(0.25, 0.75)#fff-#000</code>” – gradient from white to black with focus point
157 at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
158 </p>
159 <p class="header">Path String
160 </p>
161 <p>Please refer to <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path’s data attribute’s format are described in the SVG specification.">SVG documentation regarding path string</a>. Raphaël fully supports it.</p>
162 <p class="header">Colour Parsing
163 </p>
164 <ul>
165     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
166     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
167     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
168     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
169     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
170     <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200,&nbsp;100,&nbsp;0, .5)</code>”)</li>
171     <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%,&nbsp;175%,&nbsp;0%, 50%)</code>”)</li>
172     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
173     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
174     <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
175     <li>hsl(•••, •••, •••) — almost the same as hsb, see <a href="http://en.wikipedia.org/wiki/HSL_and_HSV" title="HSL and HSV - Wikipedia, the free encyclopedia">Wikipedia page</a></li>
176     <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
177     <li>hsla(•••, •••, •••, •••) — same as above, but with opacity</li>
178     <li>Optionally for hsb and hsl you could specify hue as a degree: “<code>hsl(240deg,&nbsp;1,&nbsp;.5)</code>” or, if you want to go fancy, “<code>hsl(240°,&nbsp;1,&nbsp;.5)</code>”</li>
179 </ul>
180 </div><div class="extra"></div></div><div class="Element.click-section"><h3 id="Element.click" class="dr-method"><i class="dr-trixie">&#160;</i>Element.click(handler)<a href="#Element.click" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2264 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2264">&#x27ad;</a></h3>
181 <div class="dr-method"><p>Adds event handler for click for the element.
182 </p>
183 <p class="header">Parameters
184 </p>
185 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
186 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
187 <dd class="dr-description">handler for the event</dd>
188 </dl>
189 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
190 </div><div class="extra"></div></div><div class="Element.clone-section"><h3 id="Element.clone" class="dr-method"><i class="dr-trixie">&#160;</i>Element.clone()<a href="#Element.clone" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3046 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3046">&#x27ad;</a></h3>
191 <div class="dr-method"><p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">clone of a given element</span></p>
192 </div><div class="extra"></div></div><div class="Element.data-section"><h3 id="Element.data" class="dr-method"><i class="dr-trixie">&#160;</i>Element.data(key, [value])<a href="#Element.data" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2509 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2509">&#x27ad;</a></h3>
193 <div class="dr-method"><p>Adds or retrieves given value asociated with given key.
194 See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
195 </p>
196 <p class="header">Parameters
197 </p>
198 <dl class="dr-parameters"><dt class="dr-param">key</dt>
199 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
200 <dd class="dr-description">key to store data</dd>
201 <dt class="dr-param optional">value</dt>
202 <dd class="dr-optional">optional</dd>
203 <dd class="dr-type"><em class="dr-type-any">any</em></dd>
204 <dd class="dr-description">value to store</dd>
205 </dl>
206 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
207 <p>or, if value is not specified:
208 </p>
209 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-any">any</em> <span class="dr-description">value</span></p>
210 <p class="header">Usage
211 </p>
212 <pre class="javascript code"><code><b>for</b> (<b>var</b> i<span class="s"> = </span><span class="d">0</span>, i &lt; <span class="d">5</span>, i++) {
213     paper.circle(<span class="d">10</span><span class="s"> + </span><span class="d">15</span><span class="s"> * </span>i, <span class="d">10</span>, <span class="d">10</span>)
214          .attr({fill: <i>"#<span class="d">000</span>"</i>})
215          .data(<i>"i"</i>, i)
216          .click(<b>function</b> () {
217             alert(<b>this</b>.data(<i>"i"</i>));
218          });
219 }
220 </code></pre>
221 </div><div class="extra"></div></div><div class="Element.dblclick-section"><h3 id="Element.dblclick" class="dr-method"><i class="dr-trixie">&#160;</i>Element.dblclick(handler)<a href="#Element.dblclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2283 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2283">&#x27ad;</a></h3>
222 <div class="dr-method"><p>Adds event handler for double click for the element.
223 </p>
224 <p class="header">Parameters
225 </p>
226 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
227 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
228 <dd class="dr-description">handler for the event</dd>
229 </dl>
230 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
231 </div><div class="extra"></div></div><div class="Element.drag-section"><h3 id="Element.drag" class="dr-method"><i class="dr-trixie">&#160;</i>Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])<a href="#Element.drag" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2601 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2601">&#x27ad;</a></h3>
232 <div class="dr-method"><p>Adds event handlers for drag of the element.
233 </p>
234 <p class="header">Parameters
235 </p>
236 <dl class="dr-parameters"><dt class="dr-param">onmove</dt>
237 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
238 <dd class="dr-description">handler for moving</dd>
239 <dt class="dr-param">onstart</dt>
240 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
241 <dd class="dr-description">handler for drag start</dd>
242 <dt class="dr-param">onend</dt>
243 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
244 <dd class="dr-description">handler for drag end</dd>
245 <dt class="dr-param optional">mcontext</dt>
246 <dd class="dr-optional">optional</dd>
247 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
248 <dd class="dr-description">context for moving handler</dd>
249 <dt class="dr-param optional">scontext</dt>
250 <dd class="dr-optional">optional</dd>
251 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
252 <dd class="dr-description">context for drag start handler</dd>
253 <dt class="dr-param optional">econtext</dt>
254 <dd class="dr-optional">optional</dd>
255 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
256 <dd class="dr-description">context for drag end handler</dd>
257 </dl>
258 <p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start, 
259 <code>drag.end.&lt;id></code> on end and <code>drag.move.&lt;id></code> on every move. When element will be dragged over another element 
260 <code>drag.over.&lt;id></code> will be fired as well.
261 </p>
262 <p>Start event and start handler will be called in specified context or in context of the element with following parameters:
263 </p>
264 <ol class="dr-json"><li><span class="dr-json-key">x</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x position of the mouse</span>
265 <li><span class="dr-json-key">y</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y position of the mouse</span>
266 <li><span class="dr-json-key">event</span><span class="dr-type"><em class="dr-type-object">object</em></span><span class="dr-json-description">DOM event object</span>
267 </ol>
268 <p>Move event and move handler will be called in specified context or in context of the element with following parameters:
269 </p>
270 <ol class="dr-json"><li><span class="dr-json-key">dx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">shift by x from the start point</span>
271 <li><span class="dr-json-key">dy</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">shift by y from the start point</span>
272 <li><span class="dr-json-key">x</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x position of the mouse</span>
273 <li><span class="dr-json-key">y</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y position of the mouse</span>
274 <li><span class="dr-json-key">event</span><span class="dr-type"><em class="dr-type-object">object</em></span><span class="dr-json-description">DOM event object</span>
275 </ol>
276 <p>End event and end handler will be called in specified context or in context of the element with following parameters:
277 </p>
278 <ol class="dr-json"><li><span class="dr-json-key">event</span><span class="dr-type"><em class="dr-type-object">object</em></span><span class="dr-json-description">DOM event object</span>
279 </ol>
280 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
281 </div><div class="extra"></div></div><div class="Element.getBBox-section"><h3 id="Element.getBBox" class="dr-method"><i class="dr-trixie">&#160;</i>Element.getBBox(isWithoutTransform)<a href="#Element.getBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3014 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3014">&#x27ad;</a></h3>
282 <div class="dr-method"><p>Return bounding box for a given element
283 </p>
284 <p class="header">Parameters
285 </p>
286 <dl class="dr-parameters"><dt class="dr-param">isWithoutTransform</dt>
287 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
288 <dd class="dr-description">flag, <code>true</code> if you want to have bounding box before transformations. Default is <code>false</code>.</dd>
289 </dl>
290 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Bounding box object:</span></p>
291 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">top left corner x</span>
292 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">top left corner y</span>
293 <li><span class="dr-json-key">width:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">width</span>
294 <li><span class="dr-json-key">height:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">height</span>
295 </ol></li><li>}</li></ol>
296 </div><div class="extra"></div></div><div class="Element.getPointAtLength-section"><h3 id="Element.getPointAtLength" class="dr-method"><i class="dr-trixie">&#160;</i>Element.getPointAtLength(length)<a href="#Element.getPointAtLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3264 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3264">&#x27ad;</a></h3>
297 <div class="dr-method"><p>Return coordinates of the point located at the given length on the given path. Only works for element of “path” type.
298 </p>
299 <p class="header">Parameters
300 </p>
301 <dl class="dr-parameters"><dt class="dr-param">length</dt>
302 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
303 <dd class="dr-description">&#160;</dd>
304 </dl>
305 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">representation of the point:</span></p>
306 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate</span>
307 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate</span>
308 <li><span class="dr-json-key">alpha:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">angle of derivative</span>
309 </ol></li><li>}</li></ol>
310 </div><div class="extra"></div></div><div class="Element.getSubpath-section"><h3 id="Element.getSubpath" class="dr-method"><i class="dr-trixie">&#160;</i>Element.getSubpath(from, to)<a href="#Element.getSubpath" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3281 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3281">&#x27ad;</a></h3>
311 <div class="dr-method"><p>Return subpath of a given element from given length to given length. Only works for element of “path” type.
312 </p>
313 <p class="header">Parameters
314 </p>
315 <dl class="dr-parameters"><dt class="dr-param">from</dt>
316 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
317 <dd class="dr-description">position of the start of the segment</dd>
318 <dt class="dr-param">to</dt>
319 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
320 <dd class="dr-description">position of the end of the segment</dd>
321 </dl>
322 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">pathstring for the segment</span></p>
323 </div><div class="extra"></div></div><div class="Element.getTotalLength-section"><h3 id="Element.getTotalLength" class="dr-method"><i class="dr-trixie">&#160;</i>Element.getTotalLength()<a href="#Element.getTotalLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3240 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3240">&#x27ad;</a></h3>
324 <div class="dr-method"><p>Returns length of the path in pixels. Only works for element of “path” type.
325 </p>
326 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
327 </div><div class="extra"></div></div><div class="Element.glow-section"><h3 id="Element.glow" class="dr-method"><i class="dr-trixie">&#160;</i>Element.glow([glow])<a href="#Element.glow" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3073 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3073">&#x27ad;</a></h3>
328 <div class="dr-method"><p>Return set of elements that create glow-like effect around given element. See <a href="#Paper.set" class="dr-link">Paper.set</a>.
329 </p>
330 <p>Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself.
331 </p>
332 <p class="header">Parameters
333 </p>
334 <dl class="dr-parameters"><dt class="dr-param optional">glow</dt>
335 <dd class="dr-optional">optional</dd>
336 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
337 <dd class="dr-description">parameters object with all properties optional:</dd>
338 </dl>
339 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">width</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">size of the glow, default is <code>10</code></span>
340 <li><span class="dr-json-key">fill</span><span class="dr-type"><em class="dr-type-boolean">boolean</em></span><span class="dr-json-description">will it be filled, default is <code>false</code></span>
341 <li><span class="dr-json-key">opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">opacity, default is <code>0.5</code></span>
342 <li><span class="dr-json-key">offsetx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">horizontal offset, default is <code>0</code></span>
343 <li><span class="dr-json-key">offsety</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">vertical offset, default is <code>0</code></span>
344 <li><span class="dr-json-key">color</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">glow colour, default is <code>black</code></span>
345 </ol></li><li>}</li></ol>
346 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Paper.set" class="dr-link">Paper.set</a> of elements that represents glow</span></p>
347 </div><div class="extra"></div></div><div class="Element.hide-section"><h3 id="Element.hide" class="dr-method"><i class="dr-trixie">&#160;</i>Element.hide()<a href="#Element.hide" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 850 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L850">&#x27ad;</a></h3>
348 <div class="dr-method"><p>Makes element invisible. See <a href="#Element.show" class="dr-link">Element.show</a>.
349 </p>
350 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
351 </div><div class="extra"></div></div><div class="Element.hover-section"><h3 id="Element.hover" class="dr-method"><i class="dr-trixie">&#160;</i>Element.hover(f_in, f_out, [icontext], [ocontext])<a href="#Element.hover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2555 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2555">&#x27ad;</a></h3>
352 <div class="dr-method"><p>Adds event handlers for hover for the element.
353 </p>
354 <p class="header">Parameters
355 </p>
356 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
357 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
358 <dd class="dr-description">handler for hover in</dd>
359 <dt class="dr-param">f_out</dt>
360 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
361 <dd class="dr-description">handler for hover out</dd>
362 <dt class="dr-param optional">icontext</dt>
363 <dd class="dr-optional">optional</dd>
364 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
365 <dd class="dr-description">context for hover in handler</dd>
366 <dt class="dr-param optional">ocontext</dt>
367 <dd class="dr-optional">optional</dd>
368 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
369 <dd class="dr-description">context for hover out handler</dd>
370 </dl>
371 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
372 </div><div class="extra"></div></div><div class="Element.id-section"><h3 id="Element.id" class="dr-property"><i class="dr-trixie">&#160;</i>Element.id<a href="#Element.id" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 638 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L638">&#x27ad;</a></h3>
373 <div class="dr-property"><em class="dr-type dr-type-number">number</em><p>Unique id of the element. Especially usesful when you want to listen to events of the element, 
374 because all events are fired in format <code>&lt;module>.&lt;action>.&lt;id></code>. Also useful for <a href="#Paper.getById" class="dr-link">Paper.getById</a> method.
375 </p>
376 </div><div class="extra"></div></div><div class="Element.insertAfter-section"><h3 id="Element.insertAfter" class="dr-method"><i class="dr-trixie">&#160;</i>Element.insertAfter()<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1078 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1078">&#x27ad;</a></h3>
377 <div class="dr-method"><p>Inserts current object after the given one.
378 </p>
379 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
380 </div><div class="extra"></div></div><div class="Element.insertBefore-section"><h3 id="Element.insertBefore" class="dr-method"><i class="dr-trixie">&#160;</i>Element.insertBefore()<a href="#Element.insertBefore" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1098 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1098">&#x27ad;</a></h3>
381 <div class="dr-method"><p>Inserts current object before the given one.
382 </p>
383 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
384 </div><div class="extra"></div></div><div class="Element.mousedown-section"><h3 id="Element.mousedown" class="dr-method"><i class="dr-trixie">&#160;</i>Element.mousedown(handler)<a href="#Element.mousedown" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2302 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2302">&#x27ad;</a></h3>
385 <div class="dr-method"><p>Adds event handler for mousedown for the element.
386 </p>
387 <p class="header">Parameters
388 </p>
389 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
390 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
391 <dd class="dr-description">handler for the event</dd>
392 </dl>
393 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
394 </div><div class="extra"></div></div><div class="Element.mousemove-section"><h3 id="Element.mousemove" class="dr-method"><i class="dr-trixie">&#160;</i>Element.mousemove(handler)<a href="#Element.mousemove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2321 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2321">&#x27ad;</a></h3>
395 <div class="dr-method"><p>Adds event handler for mousemove for the element.
396 </p>
397 <p class="header">Parameters
398 </p>
399 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
400 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
401 <dd class="dr-description">handler for the event</dd>
402 </dl>
403 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
404 </div><div class="extra"></div></div><div class="Element.mouseout-section"><h3 id="Element.mouseout" class="dr-method"><i class="dr-trixie">&#160;</i>Element.mouseout(handler)<a href="#Element.mouseout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2340 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2340">&#x27ad;</a></h3>
405 <div class="dr-method"><p>Adds event handler for mouseout for the element.
406 </p>
407 <p class="header">Parameters
408 </p>
409 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
410 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
411 <dd class="dr-description">handler for the event</dd>
412 </dl>
413 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
414 </div><div class="extra"></div></div><div class="Element.mouseover-section"><h3 id="Element.mouseover" class="dr-method"><i class="dr-trixie">&#160;</i>Element.mouseover(handler)<a href="#Element.mouseover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2359 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2359">&#x27ad;</a></h3>
415 <div class="dr-method"><p>Adds event handler for mouseover for the element.
416 </p>
417 <p class="header">Parameters
418 </p>
419 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
420 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
421 <dd class="dr-description">handler for the event</dd>
422 </dl>
423 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
424 </div><div class="extra"></div></div><div class="Element.mouseup-section"><h3 id="Element.mouseup" class="dr-method"><i class="dr-trixie">&#160;</i>Element.mouseup(handler)<a href="#Element.mouseup" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2378 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2378">&#x27ad;</a></h3>
425 <div class="dr-method"><p>Adds event handler for mouseup for the element.
426 </p>
427 <p class="header">Parameters
428 </p>
429 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
430 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
431 <dd class="dr-description">handler for the event</dd>
432 </dl>
433 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
434 </div><div class="extra"></div></div><div class="Element.next-section"><h3 id="Element.next" class="dr-property"><i class="dr-trixie">&#160;</i>Element.next<a href="#Element.next" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 681 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L681">&#x27ad;</a></h3>
435 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the next element in the hierarchy.
436 </p>
437 </div><div class="extra"></div></div><div class="Element.node-section"><h3 id="Element.node" class="dr-property"><i class="dr-trixie">&#160;</i>Element.node<a href="#Element.node" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 617 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L617">&#x27ad;</a></h3>
438 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
439 Note: Don’t mess with it.
440 </p>
441 <p class="header">Usage
442 </p>
443 <pre class="javascript code"><code><span class="c">// draw a circle at coordinate <span class="d">10</span>,<span class="d">10</span> <b>with</b> radius of <span class="d">10</span></span>
444 <b>var</b> c<span class="s"> = </span>paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">10</span>);
445 c.node.onclick<span class="s"> = </span><b>function</b> () {
446     c.attr(<i>"fill"</i>, <i>"red"</i>);
447 };
448 </code></pre>
449 </div><div class="extra"></div></div><div class="Element.onDragOver-section"><h3 id="Element.onDragOver" class="dr-method"><i class="dr-trixie">&#160;</i>Element.onDragOver(f)<a href="#Element.onDragOver" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2628 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2628">&#x27ad;</a></h3>
450 <div class="dr-method"><p>Shortcut for assigning event handler for <code>drag.over.&lt;id></code> event, where id is id of the element (see <a href="#Element.id" class="dr-link">Element.id</a>).
451 </p>
452 <p class="header">Parameters
453 </p>
454 <dl class="dr-parameters"><dt class="dr-param">f</dt>
455 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
456 <dd class="dr-description">handler for event</dd>
457 </dl>
458 </div><div class="extra"></div></div><div class="Element.paper-section"><h3 id="Element.paper" class="dr-property"><i class="dr-trixie">&#160;</i>Element.paper<a href="#Element.paper" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 654 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L654">&#x27ad;</a></h3>
459 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Internal reference to “paper” where object drawn. Mainly for use in plugins and element extensions.
460 </p>
461 <p class="header">Usage
462 </p>
463 <pre class="javascript code"><code>Raphael.el.cross<span class="s"> = </span><b>function</b> () {
464     <b>this</b>.attr({fill: <i>"red"</i>});
465     <b>this</b>.paper.path(<i>"M10,10L50,50M50,10L10,<span class="d">50</span>"</i>)
466         .attr({stroke: <i>"red"</i>});
467 }
468 </code></pre>
469 </div><div class="extra"></div></div><div class="Element.pause-section"><h3 id="Element.pause" class="dr-method"><i class="dr-trixie">&#160;</i>Element.pause([anim])<a href="#Element.pause" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3980 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3980">&#x27ad;</a></h3>
470 <div class="dr-method"><p>Stops animation of the element with ability to resume it later on.
471 </p>
472 <p class="header">Parameters
473 </p>
474 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
475 <dd class="dr-optional">optional</dd>
476 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
477 <dd class="dr-description">animation object</dd>
478 </dl>
479 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
480 </div><div class="extra"></div></div><div class="Element.prev-section"><h3 id="Element.prev" class="dr-property"><i class="dr-trixie">&#160;</i>Element.prev<a href="#Element.prev" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 672 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L672">&#x27ad;</a></h3>
481 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the previous element in the hierarchy.
482 </p>
483 </div><div class="extra"></div></div><div class="Element.raphael-section"><h3 id="Element.raphael" class="dr-property"><i class="dr-trixie">&#160;</i>Element.raphael<a href="#Element.raphael" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 630 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L630">&#x27ad;</a></h3>
484 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Internal reference to <a href="#Raphael" class="dr-link">Raphael</a> object. In case it is not available.
485 </p>
486 <p class="header">Usage
487 </p>
488 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
489     <b>var</b> hsb<span class="s"> = </span><b>this</b>.paper.raphael.rgb2hsb(<b>this</b>.attr(<i>"fill"</i>));
490     hsb.h<span class="s"> = </span><span class="d">1</span>;
491     <b>this</b>.attr({fill: <b>this</b>.paper.raphael.hsb2rgb(hsb).hex});
492 }
493 </code></pre>
494 </div><div class="extra"></div></div><div class="Element.remove-section"><h3 id="Element.remove" class="dr-method"><i class="dr-trixie">&#160;</i>Element.remove()<a href="#Element.remove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 871 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L871">&#x27ad;</a></h3>
495 <div class="dr-method"><p>Removes element form the paper.
496 </p>
497 </div><div class="extra"></div></div><div class="Element.removeData-section"><h3 id="Element.removeData" class="dr-method"><i class="dr-trixie">&#160;</i>Element.removeData([key])<a href="#Element.removeData" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2535 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2535">&#x27ad;</a></h3>
498 <div class="dr-method"><p>Removes value associated with an element by given key.
499 If key is not provided, removes all the data of the element.
500 </p>
501 <p class="header">Parameters
502 </p>
503 <dl class="dr-parameters"><dt class="dr-param optional">key</dt>
504 <dd class="dr-optional">optional</dd>
505 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
506 <dd class="dr-description">key</dd>
507 </dl>
508 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
509 </div><div class="extra"></div></div><div class="Element.resume-section"><h3 id="Element.resume" class="dr-method"><i class="dr-trixie">&#160;</i>Element.resume([anim])<a href="#Element.resume" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4000 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4000">&#x27ad;</a></h3>
510 <div class="dr-method"><p>Resumes animation if it was paused with <a href="#Element.pause" class="dr-link">Element.pause</a> method.
511 </p>
512 <p class="header">Parameters
513 </p>
514 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
515 <dd class="dr-optional">optional</dd>
516 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
517 <dd class="dr-description">animation object</dd>
518 </dl>
519 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
520 </div><div class="extra"></div></div><div class="Element.rotate-section"><h3 id="Element.rotate" class="dr-method"><i class="dr-trixie">&#160;</i>Element.rotate(deg, [cx], [cy])<a href="#Element.rotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 713 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L713">&#x27ad;</a></h3>
521 <div class="dr-method"><p>Adds rotation by given angle around given point to the list of
522 transformations of the element.
523 </p>
524 <p class="header">Parameters
525 </p>
526 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
527 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
528 <dd class="dr-description">angle in degrees</dd>
529 <dt class="dr-param optional">cx</dt>
530 <dd class="dr-optional">optional</dd>
531 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
532 <dd class="dr-description">x coordinate of the centre of rotation</dd>
533 <dt class="dr-param optional">cy</dt>
534 <dd class="dr-optional">optional</dd>
535 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
536 <dd class="dr-description">y coordinate of the centre of rotation</dd>
537 </dl>
538 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used as a point of rotation.
539 </p>
540 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
541 </div><div class="extra"></div></div><div class="Element.scale-section"><h3 id="Element.scale" class="dr-method"><i class="dr-trixie">&#160;</i>Element.scale(sx, sy, [cx], [cy])<a href="#Element.scale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 746 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L746">&#x27ad;</a></h3>
542 <div class="dr-method"><p>Adds scale by given amount relative to given point to the list of
543 transformations of the element.
544 </p>
545 <p class="header">Parameters
546 </p>
547 <dl class="dr-parameters"><dt class="dr-param">sx</dt>
548 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
549 <dd class="dr-description">horisontal scale amount</dd>
550 <dt class="dr-param">sy</dt>
551 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
552 <dd class="dr-description">vertical scale amount</dd>
553 <dt class="dr-param optional">cx</dt>
554 <dd class="dr-optional">optional</dd>
555 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
556 <dd class="dr-description">x coordinate of the centre of scale</dd>
557 <dt class="dr-param optional">cy</dt>
558 <dd class="dr-optional">optional</dd>
559 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
560 <dd class="dr-description">y coordinate of the centre of scale</dd>
561 </dl>
562 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used instead.
563 </p>
564 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
565 </div><div class="extra"></div></div><div class="Element.setTime-section"><h3 id="Element.setTime" class="dr-method"><i class="dr-trixie">&#160;</i>Element.setTime(anim, value)<a href="#Element.setTime" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3916 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3916">&#x27ad;</a></h3>
566 <div class="dr-method"><p>Sets the status of animation of the element in milliseconds. Similar to <a href="#Element.status" class="dr-link">Element.status</a> method.
567 </p>
568 <p class="header">Parameters
569 </p>
570 <dl class="dr-parameters"><dt class="dr-param">anim</dt>
571 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
572 <dd class="dr-description">animation object</dd>
573 <dt class="dr-param">value</dt>
574 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
575 <dd class="dr-description">number of milliseconds from the beginning of the animation</dd>
576 </dl>
577 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element if <code>value</code> is specified</span></p>
578 <p>Note, that during animation following events are triggered:
579 </p>
580 <p>On each animation frame event <code>anim.frame.&lt;id></code>, on start <code>anim.start.&lt;id></code> and on end <code>anim.finish.&lt;id></code>.
581 </p>
582 </div><div class="extra"></div></div><div class="Element.show-section"><h3 id="Element.show" class="dr-method"><i class="dr-trixie">&#160;</i>Element.show()<a href="#Element.show" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 861 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L861">&#x27ad;</a></h3>
583 <div class="dr-method"><p>Makes element visible. See <a href="#Element.hide" class="dr-link">Element.hide</a>.
584 </p>
585 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
586 </div><div class="extra"></div></div><div class="Element.status-section"><h3 id="Element.status" class="dr-method"><i class="dr-trixie">&#160;</i>Element.status([anim], [value])<a href="#Element.status" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3943 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3943">&#x27ad;</a></h3>
587 <div class="dr-method"><p>Gets or sets the status of animation of the element.
588 </p>
589 <p class="header">Parameters
590 </p>
591 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
592 <dd class="dr-optional">optional</dd>
593 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
594 <dd class="dr-description">animation object</dd>
595 <dt class="dr-param optional">value</dt>
596 <dd class="dr-optional">optional</dd>
597 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
598 <dd class="dr-description">0 – 1. If specified, method works like a setter and sets the status of a given animation to the value. This will cause animation to jump to the given position.</dd>
599 </dl>
600 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">status</span></p>
601 <p>or
602 </p>
603 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">status if <code>anim</code> is not specified. Array of objects in format:</span></p>
604 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">anim:</span><span class="dr-type"><em class="dr-type-object">object</em></span><span class="dr-json-description">animation object</span>
605 <li><span class="dr-json-key">status:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">status</span>
606 </ol></li><li>}</li></ol>
607 <p>or
608 </p>
609 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element if <code>value</code> is specified</span></p>
610 </div><div class="extra"></div></div><div class="Element.stop-section"><h3 id="Element.stop" class="dr-method"><i class="dr-trixie">&#160;</i>Element.stop([anim])<a href="#Element.stop" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4022 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4022">&#x27ad;</a></h3>
611 <div class="dr-method"><p>Stops animation of the element.
612 </p>
613 <p class="header">Parameters
614 </p>
615 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
616 <dd class="dr-optional">optional</dd>
617 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
618 <dd class="dr-description">animation object</dd>
619 </dl>
620 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
621 </div><div class="extra"></div></div><div class="Element.toBack-section"><h3 id="Element.toBack" class="dr-method"><i class="dr-trixie">&#160;</i>Element.toBack()<a href="#Element.toBack" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1060 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1060">&#x27ad;</a></h3>
622 <div class="dr-method"><p>Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
623 </p>
624 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
625 </div><div class="extra"></div></div><div class="Element.toFront-section"><h3 id="Element.toFront" class="dr-method"><i class="dr-trixie">&#160;</i>Element.toFront()<a href="#Element.toFront" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1044 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1044">&#x27ad;</a></h3>
626 <div class="dr-method"><p>Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
627 </p>
628 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
629 </div><div class="extra"></div></div><div class="Element.touchcancel-section"><h3 id="Element.touchcancel" class="dr-method"><i class="dr-trixie">&#160;</i>Element.touchcancel(handler)<a href="#Element.touchcancel" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2454 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2454">&#x27ad;</a></h3>
630 <div class="dr-method"><p>Adds event handler for touchcancel for the element.
631 </p>
632 <p class="header">Parameters
633 </p>
634 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
635 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
636 <dd class="dr-description">handler for the event</dd>
637 </dl>
638 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
639 </div><div class="extra"></div></div><div class="Element.touchend-section"><h3 id="Element.touchend" class="dr-method"><i class="dr-trixie">&#160;</i>Element.touchend(handler)<a href="#Element.touchend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2435 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2435">&#x27ad;</a></h3>
640 <div class="dr-method"><p>Adds event handler for touchend for the element.
641 </p>
642 <p class="header">Parameters
643 </p>
644 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
645 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
646 <dd class="dr-description">handler for the event</dd>
647 </dl>
648 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
649 </div><div class="extra"></div></div><div class="Element.touchmove-section"><h3 id="Element.touchmove" class="dr-method"><i class="dr-trixie">&#160;</i>Element.touchmove(handler)<a href="#Element.touchmove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2416 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2416">&#x27ad;</a></h3>
650 <div class="dr-method"><p>Adds event handler for touchmove for the element.
651 </p>
652 <p class="header">Parameters
653 </p>
654 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
655 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
656 <dd class="dr-description">handler for the event</dd>
657 </dl>
658 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
659 </div><div class="extra"></div></div><div class="Element.touchstart-section"><h3 id="Element.touchstart" class="dr-method"><i class="dr-trixie">&#160;</i>Element.touchstart(handler)<a href="#Element.touchstart" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2397 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2397">&#x27ad;</a></h3>
660 <div class="dr-method"><p>Adds event handler for touchstart for the element.
661 </p>
662 <p class="header">Parameters
663 </p>
664 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
665 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
666 <dd class="dr-description">handler for the event</dd>
667 </dl>
668 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
669 </div><div class="extra"></div></div><div class="Element.transform-section"><h3 id="Element.transform" class="dr-method"><i class="dr-trixie">&#160;</i>Element.transform([tstr])<a href="#Element.transform" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 825 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L825">&#x27ad;</a></h3>
670 <div class="dr-method"><p>Adds transformation to the element which is separate to other attributes,
671 i.e. translation doesn’t change <code>x</code> or <code>y</code> of the rectange. The format
672 of transformation string is similar to the path string syntax:
673 </p>
674 <pre class="javascript code"><code><i>"t100,100r30,<span class="d">100</span>,100s2,<span class="d">2</span>,<span class="d">100</span>,100r45s1<span class="d">.5</span>"</i>
675 </code></pre>
676 <p>Each letter is a command. There are four commands: <code>t</code> is for translate, <code>r</code> is for rotate, <code>s</code> is for
677 scale and <code>m</code> is for matrix.
678 </p>
679 <p>So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100;
680 rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin
681 coordinates as optional parameters, the default is the centre point of the element.
682 Matrix accepts six parameters.
683 </p>
684 <p class="header">Usage
685 </p>
686 <pre class="javascript code"><code><b>var</b> el<span class="s"> = </span>paper.rect(<span class="d">10</span>, <span class="d">20</span>, <span class="d">300</span>, <span class="d">200</span>);
687 <span class="c">// translate <span class="d">100</span>, <span class="d">100</span>, rotate <span class="d">45</span>°, translate -<span class="d">100</span>, <span class="d">0</span></span>
688 el.transform(<i>"t100,100r45t-<span class="d">100</span>,<span class="d">0</span>"</i>);
689 <span class="c">// <b>if</b> you want you can append or prepend transformations</span>
690 el.transform(<i>"...t50,<span class="d">50</span>"</i>);
691 el.transform(<i>"s2..."</i>);
692 <span class="c">// or even wrap</span>
693 el.transform(<i>"t50,<span class="d">50</span>...t-<span class="d">50</span>-<span class="d">50</span>"</i>);
694 <span class="c">// to reset transformation call method <b>with</b> empty string</span>
695 el.transform(<i>""</i>);
696 <span class="c">// to get current value call it without parameters</span>
697 console.log(el.transform());
698 </code></pre>
699 <p class="header">Parameters
700 </p>
701 <dl class="dr-parameters"><dt class="dr-param optional">tstr</dt>
702 <dd class="dr-optional">optional</dd>
703 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
704 <dd class="dr-description">transformation string</dd>
705 </dl>
706 <p>If tstr isn’t specified
707 </p>
708 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">current transformation string</span></p>
709 <p>else
710 </p>
711 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
712 </div><div class="extra"></div></div><div class="Element.translate-section"><h3 id="Element.translate" class="dr-method"><i class="dr-trixie">&#160;</i>Element.translate(dx, dy)<a href="#Element.translate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 777 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L777">&#x27ad;</a></h3>
713 <div class="dr-method"><p>Adds translation by given amount to the list of transformations of the element.
714 </p>
715 <p class="header">Parameters
716 </p>
717 <dl class="dr-parameters"><dt class="dr-param">dx</dt>
718 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
719 <dd class="dr-description">horisontal shift</dd>
720 <dt class="dr-param">dy</dt>
721 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
722 <dd class="dr-description">vertical shift</dd>
723 </dl>
724 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
725 </div><div class="extra"></div></div><div class="Element.unclick-section"><h3 id="Element.unclick" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unclick(handler)<a href="#Element.unclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2273 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2273">&#x27ad;</a></h3>
726 <div class="dr-method"><p>Removes event handler for click for the element.
727 </p>
728 <p class="header">Parameters
729 </p>
730 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
731 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
732 <dd class="dr-description">handler for the event</dd>
733 </dl>
734 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
735 </div><div class="extra"></div></div><div class="Element.undblclick-section"><h3 id="Element.undblclick" class="dr-method"><i class="dr-trixie">&#160;</i>Element.undblclick(handler)<a href="#Element.undblclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2292 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2292">&#x27ad;</a></h3>
736 <div class="dr-method"><p>Removes event handler for double click for the element.
737 </p>
738 <p class="header">Parameters
739 </p>
740 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
741 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
742 <dd class="dr-description">handler for the event</dd>
743 </dl>
744 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
745 </div><div class="extra"></div></div><div class="Element.undrag-section"><h3 id="Element.undrag" class="dr-method"><i class="dr-trixie">&#160;</i>Element.undrag()<a href="#Element.undrag" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2637 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2637">&#x27ad;</a></h3>
746 <div class="dr-method"><p>Removes all drag event handlers from given element.
747 </p>
748 </div><div class="extra"></div></div><div class="Element.unhover-section"><h3 id="Element.unhover" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unhover(f_in, f_out)<a href="#Element.unhover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2568 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2568">&#x27ad;</a></h3>
749 <div class="dr-method"><p>Removes event handlers for hover for the element.
750 </p>
751 <p class="header">Parameters
752 </p>
753 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
754 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
755 <dd class="dr-description">handler for hover in</dd>
756 <dt class="dr-param">f_out</dt>
757 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
758 <dd class="dr-description">handler for hover out</dd>
759 </dl>
760 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
761 </div><div class="extra"></div></div><div class="Element.unmousedown-section"><h3 id="Element.unmousedown" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unmousedown(handler)<a href="#Element.unmousedown" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2311 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2311">&#x27ad;</a></h3>
762 <div class="dr-method"><p>Removes event handler for mousedown for the element.
763 </p>
764 <p class="header">Parameters
765 </p>
766 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
767 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
768 <dd class="dr-description">handler for the event</dd>
769 </dl>
770 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
771 </div><div class="extra"></div></div><div class="Element.unmousemove-section"><h3 id="Element.unmousemove" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unmousemove(handler)<a href="#Element.unmousemove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2330 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2330">&#x27ad;</a></h3>
772 <div class="dr-method"><p>Removes event handler for mousemove for the element.
773 </p>
774 <p class="header">Parameters
775 </p>
776 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
777 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
778 <dd class="dr-description">handler for the event</dd>
779 </dl>
780 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
781 </div><div class="extra"></div></div><div class="Element.unmouseout-section"><h3 id="Element.unmouseout" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unmouseout(handler)<a href="#Element.unmouseout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2349 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2349">&#x27ad;</a></h3>
782 <div class="dr-method"><p>Removes event handler for mouseout for the element.
783 </p>
784 <p class="header">Parameters
785 </p>
786 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
787 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
788 <dd class="dr-description">handler for the event</dd>
789 </dl>
790 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
791 </div><div class="extra"></div></div><div class="Element.unmouseover-section"><h3 id="Element.unmouseover" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unmouseover(handler)<a href="#Element.unmouseover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2368 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2368">&#x27ad;</a></h3>
792 <div class="dr-method"><p>Removes event handler for mouseover for the element.
793 </p>
794 <p class="header">Parameters
795 </p>
796 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
797 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
798 <dd class="dr-description">handler for the event</dd>
799 </dl>
800 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
801 </div><div class="extra"></div></div><div class="Element.unmouseup-section"><h3 id="Element.unmouseup" class="dr-method"><i class="dr-trixie">&#160;</i>Element.unmouseup(handler)<a href="#Element.unmouseup" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2387 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2387">&#x27ad;</a></h3>
802 <div class="dr-method"><p>Removes event handler for mouseup for the element.
803 </p>
804 <p class="header">Parameters
805 </p>
806 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
807 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
808 <dd class="dr-description">handler for the event</dd>
809 </dl>
810 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
811 </div><div class="extra"></div></div><div class="Element.untouchcancel-section"><h3 id="Element.untouchcancel" class="dr-method"><i class="dr-trixie">&#160;</i>Element.untouchcancel(handler)<a href="#Element.untouchcancel" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2463 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2463">&#x27ad;</a></h3>
812 <div class="dr-method"><p>Removes event handler for touchcancel for the element.
813 </p>
814 <p class="header">Parameters
815 </p>
816 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
817 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
818 <dd class="dr-description">handler for the event</dd>
819 </dl>
820 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
821 </div><div class="extra"></div></div><div class="Element.untouchend-section"><h3 id="Element.untouchend" class="dr-method"><i class="dr-trixie">&#160;</i>Element.untouchend(handler)<a href="#Element.untouchend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2444 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2444">&#x27ad;</a></h3>
822 <div class="dr-method"><p>Removes event handler for touchend for the element.
823 </p>
824 <p class="header">Parameters
825 </p>
826 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
827 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
828 <dd class="dr-description">handler for the event</dd>
829 </dl>
830 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
831 </div><div class="extra"></div></div><div class="Element.untouchmove-section"><h3 id="Element.untouchmove" class="dr-method"><i class="dr-trixie">&#160;</i>Element.untouchmove(handler)<a href="#Element.untouchmove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2425 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2425">&#x27ad;</a></h3>
832 <div class="dr-method"><p>Removes event handler for touchmove for the element.
833 </p>
834 <p class="header">Parameters
835 </p>
836 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
837 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
838 <dd class="dr-description">handler for the event</dd>
839 </dl>
840 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
841 </div><div class="extra"></div></div><div class="Element.untouchstart-section"><h3 id="Element.untouchstart" class="dr-method"><i class="dr-trixie">&#160;</i>Element.untouchstart(handler)<a href="#Element.untouchstart" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2406 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2406">&#x27ad;</a></h3>
842 <div class="dr-method"><p>Removes event handler for touchstart for the element.
843 </p>
844 <p class="header">Parameters
845 </p>
846 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
847 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
848 <dd class="dr-description">handler for the event</dd>
849 </dl>
850 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
851 </div><div class="extra"></div></div><div class="Matrix-section"><h2 id="Matrix" class="undefined"><i class="dr-trixie">&#160;</i>Matrix<a href="#Matrix" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
852 <div class="extra"></div></div><div class="Matrix.add-section"><h3 id="Matrix.add" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.add(a, b, c, d, e, f, matrix)<a href="#Matrix.add" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1893 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1893">&#x27ad;</a></h3>
853 <div class="dr-method"><p>Adds given matrix to existing one.
854 </p>
855 <p class="header">Parameters
856 </p>
857 <dl class="dr-parameters"><dt class="dr-param">a</dt>
858 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
859 <dd class="dr-description">&#160;</dd>
860 <dt class="dr-param">b</dt>
861 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
862 <dd class="dr-description">&#160;</dd>
863 <dt class="dr-param">c</dt>
864 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
865 <dd class="dr-description">&#160;</dd>
866 <dt class="dr-param">d</dt>
867 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
868 <dd class="dr-description">&#160;</dd>
869 <dt class="dr-param">e</dt>
870 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
871 <dd class="dr-description">&#160;</dd>
872 <dt class="dr-param">f</dt>
873 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
874 <dd class="dr-description">&#160;</dd>
875 <dt class="dr-param">matrix</dt>
876 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
877 <dd class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></dd>
878 </dl>
879 </div><div class="extra"></div></div><div class="Matrix.clone-section"><h3 id="Matrix.clone" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.clone()<a href="#Matrix.clone" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1938 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1938">&#x27ad;</a></h3>
880 <div class="dr-method"><p>Returns copy of the matrix
881 </p>
882 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span></p>
883 </div><div class="extra"></div></div><div class="Matrix.invert-section"><h3 id="Matrix.invert" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.invert()<a href="#Matrix.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1926 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1926">&#x27ad;</a></h3>
884 <div class="dr-method"><p>Returns inverted version of the matrix
885 </p>
886 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span></p>
887 </div><div class="extra"></div></div><div class="Matrix.rotate-section"><h3 id="Matrix.rotate" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.rotate(a, x, y)<a href="#Matrix.rotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1980 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1980">&#x27ad;</a></h3>
888 <div class="dr-method"><p>Rotates the matrix
889 </p>
890 <p class="header">Parameters
891 </p>
892 <dl class="dr-parameters"><dt class="dr-param">a</dt>
893 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
894 <dd class="dr-description">&#160;</dd>
895 <dt class="dr-param">x</dt>
896 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
897 <dd class="dr-description">&#160;</dd>
898 <dt class="dr-param">y</dt>
899 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
900 <dd class="dr-description">&#160;</dd>
901 </dl>
902 </div><div class="extra"></div></div><div class="Matrix.scale-section"><h3 id="Matrix.scale" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.scale(x, [y], [cx], [cy])<a href="#Matrix.scale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1964 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1964">&#x27ad;</a></h3>
903 <div class="dr-method"><p>Scales the matrix
904 </p>
905 <p class="header">Parameters
906 </p>
907 <dl class="dr-parameters"><dt class="dr-param">x</dt>
908 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
909 <dd class="dr-description">&#160;</dd>
910 <dt class="dr-param optional">y</dt>
911 <dd class="dr-optional">optional</dd>
912 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
913 <dd class="dr-description">&#160;</dd>
914 <dt class="dr-param optional">cx</dt>
915 <dd class="dr-optional">optional</dd>
916 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
917 <dd class="dr-description">&#160;</dd>
918 <dt class="dr-param optional">cy</dt>
919 <dd class="dr-optional">optional</dd>
920 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
921 <dd class="dr-description">&#160;</dd>
922 </dl>
923 </div><div class="extra"></div></div><div class="Matrix.split-section"><h3 id="Matrix.split" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.split()<a href="#Matrix.split" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2053 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2053">&#x27ad;</a></h3>
924 <div class="dr-method"><p>Splits matrix into primitive transformations
925 </p>
926 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">in format:</span></p>
927 <ol class="dr-json"><li><span class="dr-json-key">dx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">translation by x</span>
928 <li><span class="dr-json-key">dy</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">translation by y</span>
929 <li><span class="dr-json-key">scalex</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">scale by x</span>
930 <li><span class="dr-json-key">scaley</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">scale by y</span>
931 <li><span class="dr-json-key">shear</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">shear</span>
932 <li><span class="dr-json-key">rotate</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">rotation in deg</span>
933 <li><span class="dr-json-key">isSimple</span><span class="dr-type"><em class="dr-type-boolean">boolean</em></span><span class="dr-json-description">could it be represented via simple transformations</span>
934 </ol>
935 </div><div class="extra"></div></div><div class="Matrix.toTransformString-section"><h3 id="Matrix.toTransformString" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.toTransformString()<a href="#Matrix.toTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2095 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2095">&#x27ad;</a></h3>
936 <div class="dr-method"><p>Return transform string that represents given matrix
937 </p>
938 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">transform string</span></p>
939 </div><div class="extra"></div></div><div class="Matrix.translate-section"><h3 id="Matrix.translate" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.translate(x, y)<a href="#Matrix.translate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1950 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1950">&#x27ad;</a></h3>
940 <div class="dr-method"><p>Translate the matrix
941 </p>
942 <p class="header">Parameters
943 </p>
944 <dl class="dr-parameters"><dt class="dr-param">x</dt>
945 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
946 <dd class="dr-description">&#160;</dd>
947 <dt class="dr-param">y</dt>
948 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
949 <dd class="dr-description">&#160;</dd>
950 </dl>
951 </div><div class="extra"></div></div><div class="Matrix.x-section"><h3 id="Matrix.x" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.x(x, y)<a href="#Matrix.x" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1999 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1999">&#x27ad;</a></h3>
952 <div class="dr-method"><p>Return x coordinate for given point after transformation described by the matrix. See also <a href="#Matrix.y" class="dr-link">Matrix.y</a>
953 </p>
954 <p class="header">Parameters
955 </p>
956 <dl class="dr-parameters"><dt class="dr-param">x</dt>
957 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
958 <dd class="dr-description">&#160;</dd>
959 <dt class="dr-param">y</dt>
960 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
961 <dd class="dr-description">&#160;</dd>
962 </dl>
963 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">x</span></p>
964 </div><div class="extra"></div></div><div class="Matrix.y-section"><h3 id="Matrix.y" class="dr-method"><i class="dr-trixie">&#160;</i>Matrix.y(x, y)<a href="#Matrix.y" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2012 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2012">&#x27ad;</a></h3>
965 <div class="dr-method"><p>Return y coordinate for given point after transformation described by the matrix. See also <a href="#Matrix.x" class="dr-link">Matrix.x</a>
966 </p>
967 <p class="header">Parameters
968 </p>
969 <dl class="dr-parameters"><dt class="dr-param">x</dt>
970 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
971 <dd class="dr-description">&#160;</dd>
972 <dt class="dr-param">y</dt>
973 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
974 <dd class="dr-description">&#160;</dd>
975 </dl>
976 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">y</span></p>
977 </div><div class="extra"></div></div><div class="Paper-section"><h2 id="Paper" class="undefined"><i class="dr-trixie">&#160;</i>Paper<a href="#Paper" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
978 <div class="extra"></div></div><div class="Paper.bottom-section"><h3 id="Paper.bottom" class="dr-property"><i class="dr-trixie">&#160;</i>Paper.bottom<a href="#Paper.bottom" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2886 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2886">&#x27ad;</a></h3>
979 <div class="dr-property"><p>Points to the bottom element on the paper
980 </p>
981 </div><div class="extra"></div></div><div class="Paper.circle-section"><h3 id="Paper.circle" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2662 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2662">&#x27ad;</a></h3>
982 <div class="dr-method"><p>Draws a circle.
983 </p>
984 <p class="header">Parameters
985 </p>
986 <dl class="dr-parameters"><dt class="dr-param">x</dt>
987 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
988 <dd class="dr-description">x coordinate of the centre</dd>
989 <dt class="dr-param">y</dt>
990 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
991 <dd class="dr-description">y coordinate of the centre</dd>
992 <dt class="dr-param">r</dt>
993 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
994 <dd class="dr-description">radius</dd>
995 </dl>
996 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “circle”</span></p>
997 <p class="header">Usage
998 </p>
999 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.circle(<span class="d">50</span>, <span class="d">50</span>, <span class="d">40</span>);
1000 </code></pre>
1001 </div><div class="extra"></div></div><div class="Paper.clear-section"><h3 id="Paper.clear" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1304 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1304">&#x27ad;</a></h3>
1002 <div class="dr-method"><p>Clears the paper, i.e. removes all the elements.
1003 </p>
1004 </div><div class="extra"></div></div><div class="Paper.customAttributes-section"><h3 id="Paper.customAttributes" class="dr-property"><i class="dr-trixie">&#160;</i>Paper.customAttributes<a href="#Paper.customAttributes" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 362 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L362">&#x27ad;</a></h3>
1005 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>If you have a set of attributes that you would like to represent
1006 as a function of some number you can do it easily with custom attributes:
1007 </p>
1008 <p class="header">Usage
1009 </p>
1010 <pre class="javascript code"><code>paper.customAttributes.hue<span class="s"> = </span><b>function</b> (num) {
1011     num<span class="s"> = </span>num<span class="s"> % </span><span class="d">1</span>;
1012     <b>return</b> {fill: <i>"hsb("</i><span class="s"> + </span>num<span class="s"> + </span><i>", <span class="d">.75</span>, <span class="d">1</span>)"</i>};
1013 };
1014 <span class="c">// Custom attribute “hue” will change fill</span>
1015 <span class="c">// to be given hue <b>with</b> fixed saturation and brightness.</span>
1016 <span class="c">// Now you can use it like <b>this</b>:</span>
1017 <b>var</b> c<span class="s"> = </span>paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">10</span>).attr({hue: <span class="d">.45</span>});
1018 <span class="c">// or even like <b>this</b>:</span>
1019 c.animate({hue: <span class="d">1</span>}, <span class="d">1e3</span>);
1020
1021 <span class="c">// You could also create custom attribute</span>
1022 <span class="c">// <b>with</b> multiple parameters:</span>
1023 paper.customAttributes.hsb<span class="s"> = </span><b>function</b> (h, s, b) {
1024     <b>return</b> {fill: <i>"hsb("</i><span class="s"> + </span>[h, s, b].join(<i>","</i>)<span class="s"> + </span><i>")"</i>};
1025 };
1026 c.attr({hsb: <i>"<span class="d">.5</span> <span class="d">.8</span> <span class="d">1</span>"</i>});
1027 c.animate({hsb: <i>"<span class="d">1</span> <span class="d">0</span> <span class="d">.5</span>"</i>}, <span class="d">1e3</span>);
1028 </code></pre>
1029 </div><div class="extra"></div></div><div class="Paper.ellipse-section"><h3 id="Paper.ellipse" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2710 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2710">&#x27ad;</a></h3>
1030 <div class="dr-method"><p>Draws an ellipse.
1031 </p>
1032 <p class="header">Parameters
1033 </p>
1034 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1035 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1036 <dd class="dr-description">x coordinate of the centre</dd>
1037 <dt class="dr-param">y</dt>
1038 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1039 <dd class="dr-description">y coordinate of the centre</dd>
1040 <dt class="dr-param">rx</dt>
1041 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1042 <dd class="dr-description">horizontal radius</dd>
1043 <dt class="dr-param">ry</dt>
1044 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1045 <dd class="dr-description">vertical radius</dd>
1046 </dl>
1047 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “ellipse”</span></p>
1048 <p class="header">Usage
1049 </p>
1050 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.ellipse(<span class="d">50</span>, <span class="d">50</span>, <span class="d">40</span>, <span class="d">20</span>);
1051 </code></pre>
1052 </div><div class="extra"></div></div><div class="Paper.forEach-section"><h3 id="Paper.forEach" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.forEach(callback, thisArg)<a href="#Paper.forEach" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2981 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2981">&#x27ad;</a></h3>
1053 <div class="dr-method"><p>Executes given function for each element on the paper
1054 </p>
1055 <p>If callback function returns <code>false</code> it will stop loop running.
1056 </p>
1057 <p class="header">Parameters
1058 </p>
1059 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
1060 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1061 <dd class="dr-description">function to run</dd>
1062 <dt class="dr-param">thisArg</dt>
1063 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1064 <dd class="dr-description">context object for the callback</dd>
1065 </dl>
1066 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Paper object</span></p>
1067 </div><div class="extra"></div></div><div class="Paper.getById-section"><h3 id="Paper.getById" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.getById(id)<a href="#Paper.getById" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2957 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2957">&#x27ad;</a></h3>
1068 <div class="dr-method"><p>Returns you element by its internal ID.
1069 </p>
1070 <p class="header">Parameters
1071 </p>
1072 <dl class="dr-parameters"><dt class="dr-param">id</dt>
1073 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1074 <dd class="dr-description">id</dd>
1075 </dl>
1076 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object</span></p>
1077 </div><div class="extra"></div></div><div class="Paper.getElementByPoint-section"><h3 id="Paper.getElementByPoint" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.getElementByPoint(x, y)<a href="#Paper.getElementByPoint" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2921 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2921">&#x27ad;</a></h3>
1078 <div class="dr-method"><p>Returns you topmost element under given point.
1079 </p>
1080 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object</span></p>
1081 <p class="header">Parameters
1082 </p>
1083 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1084 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1085 <dd class="dr-description">x coordinate from the top left corner of the window</dd>
1086 <dt class="dr-param">y</dt>
1087 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1088 <dd class="dr-description">y coordinate from the top left corner of the window</dd>
1089 </dl>
1090 <p class="header">Usage
1091 </p>
1092 <pre class="javascript code"><code>paper.getElementByPoint(mouseX, mouseY).attr({stroke: <i>"#f00"</i>});
1093 </code></pre>
1094 </div><div class="extra"></div></div><div class="Paper.getFont-section"><h3 id="Paper.getFont" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.getFont(family, [weight], [style], [stretch])<a href="#Paper.getFont" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4259 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4259">&#x27ad;</a></h3>
1095 <div class="dr-method"><p>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”.
1096 </p>
1097 <p class="header">Parameters
1098 </p>
1099 <dl class="dr-parameters"><dt class="dr-param">family</dt>
1100 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1101 <dd class="dr-description">font family name or any word from it</dd>
1102 <dt class="dr-param optional">weight</dt>
1103 <dd class="dr-optional">optional</dd>
1104 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1105 <dd class="dr-description">font weight</dd>
1106 <dt class="dr-param optional">style</dt>
1107 <dd class="dr-optional">optional</dd>
1108 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1109 <dd class="dr-description">font style</dd>
1110 <dt class="dr-param optional">stretch</dt>
1111 <dd class="dr-optional">optional</dd>
1112 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1113 <dd class="dr-description">font stretch</dd>
1114 </dl>
1115 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">the font object</span></p>
1116 <p class="header">Usage
1117 </p>
1118 <pre class="javascript code"><code>paper.print(<span class="d">100</span>, <span class="d">100</span>, <i>"Test string"</i>, paper.getFont(<i>"Times"</i>, <span class="d">800</span>), <span class="d">30</span>);
1119 </code></pre>
1120 </div><div class="extra"></div></div><div class="Paper.image-section"><h3 id="Paper.image" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2756 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2756">&#x27ad;</a></h3>
1121 <div class="dr-method"><p>Embeds an image into the surface.
1122 </p>
1123 <p class="header">Parameters
1124 </p>
1125 <dl class="dr-parameters"><dt class="dr-param">src</dt>
1126 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1127 <dd class="dr-description">URI of the source image</dd>
1128 <dt class="dr-param">x</dt>
1129 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1130 <dd class="dr-description">x coordinate position</dd>
1131 <dt class="dr-param">y</dt>
1132 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1133 <dd class="dr-description">y coordinate position</dd>
1134 <dt class="dr-param">width</dt>
1135 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1136 <dd class="dr-description">width of the image</dd>
1137 <dt class="dr-param">height</dt>
1138 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1139 <dd class="dr-description">height of the image</dd>
1140 </dl>
1141 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “image”</span></p>
1142 <p class="header">Usage
1143 </p>
1144 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.image(<i>"apple.png"</i>, <span class="d">10</span>, <span class="d">10</span>, <span class="d">80</span>, <span class="d">80</span>);
1145 </code></pre>
1146 </div><div class="extra"></div></div><div class="Paper.path-section"><h3 id="Paper.path" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.path(pathString)<a href="#Paper.path" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2732 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2732">&#x27ad;</a></h3>
1147 <div class="dr-method"><p>Creates a path element by given path data string.
1148 </p>
1149 <p class="header">Parameters
1150 </p>
1151 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1152 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1153 <dd class="dr-description">path data in SVG path string format.</dd>
1154 </dl>
1155 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “path”</span></p>
1156 Details of a path's data attribute's format are described in the <a href="http://www.w3.org/TR/SVG/paths.html#PathData">SVG specification</a>.
1157 <p class="header">Usage
1158 </p>
1159 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.path(<i>"M10 10L90 <span class="d">90</span>"</i>);
1160 <span class="c">// draw a diagonal line:</span>
1161 <span class="c">// move to <span class="d">10</span>,<span class="d">10</span>, line to <span class="d">90</span>,<span class="d">90</span></span>
1162 </code></pre>
1163 </div><div class="extra"></div></div><div class="Paper.print-section"><h3 id="Paper.print" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.print(x, y, text, font, [size], [origin], [letter_spacing])<a href="#Paper.print" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4309 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4309">&#x27ad;</a></h3>
1164 <div class="dr-method"><p>Creates set of shapes to represent given font at given position with given size.
1165 Result of the method is set object (see <a href="#Paper.set" class="dr-link">Paper.set</a>) which contains each letter as separate path object.
1166 </p>
1167 <p class="header">Parameters
1168 </p>
1169 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1170 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1171 <dd class="dr-description">x position of the text</dd>
1172 <dt class="dr-param">y</dt>
1173 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1174 <dd class="dr-description">y position of the text</dd>
1175 <dt class="dr-param">text</dt>
1176 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1177 <dd class="dr-description">text to print</dd>
1178 <dt class="dr-param">font</dt>
1179 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1180 <dd class="dr-description">font object, see <a href="#Paper.getFont" class="dr-link">Paper.getFont</a></dd>
1181 <dt class="dr-param optional">size</dt>
1182 <dd class="dr-optional">optional</dd>
1183 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1184 <dd class="dr-description">size of the font, default is <code>16</code></dd>
1185 <dt class="dr-param optional">origin</dt>
1186 <dd class="dr-optional">optional</dd>
1187 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1188 <dd class="dr-description">could be <code>"baseline"</code> or <code>"middle"</code>, default is <code>"middle"</code></dd>
1189 <dt class="dr-param optional">letter_spacing</dt>
1190 <dd class="dr-optional">optional</dd>
1191 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1192 <dd class="dr-description">number in range <code>-1..1</code>, default is <code>0</code></dd>
1193 </dl>
1194 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">resulting set of letters</span></p>
1195 <p class="header">Usage
1196 </p>
1197 <pre class="javascript code"><code><b>var</b> txt<span class="s"> = </span>r.print(<span class="d">10</span>, <span class="d">50</span>, <i>"print"</i>, r.getFont(<i>"Museo"</i>), <span class="d">30</span>).attr({fill: <i>"#fff"</i>});
1198 <span class="c">// following line will paint first letter <b>in</b> red</span>
1199 txt[<span class="d">0</span>].attr({fill: <i>"#f00"</i>});
1200 </code></pre>
1201 </div><div class="extra"></div></div><div class="Paper.raphael-section"><h3 id="Paper.raphael" class="dr-property"><i class="dr-trixie">&#160;</i>Paper.raphael<a href="#Paper.raphael" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2893 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2893">&#x27ad;</a></h3>
1202 <div class="dr-property"><p>Points to the <a href="#Raphael" class="dr-link">Raphael</a> object/function
1203 </p>
1204 </div><div class="extra"></div></div><div class="Paper.rect-section"><h3 id="Paper.rect" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.rect(x, y, width, height, [r])<a href="#Paper.rect" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2688 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2688">&#x27ad;</a></h3>
1205 <div class="dr-method"><p></p>
1206 <p>Draws a rectangle.
1207 </p>
1208 <p class="header">Parameters
1209 </p>
1210 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1211 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1212 <dd class="dr-description">x coordinate of the top left corner</dd>
1213 <dt class="dr-param">y</dt>
1214 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1215 <dd class="dr-description">y coordinate of the top left corner</dd>
1216 <dt class="dr-param">width</dt>
1217 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1218 <dd class="dr-description">width</dd>
1219 <dt class="dr-param">height</dt>
1220 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1221 <dd class="dr-description">height</dd>
1222 <dt class="dr-param optional">r</dt>
1223 <dd class="dr-optional">optional</dd>
1224 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1225 <dd class="dr-description">radius for rounded corners, default is 0</dd>
1226 </dl>
1227 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “rect”</span></p>
1228 <p class="header">Usage
1229 </p>
1230 <pre class="javascript code"><code><span class="c">// regular rectangle</span>
1231 <b>var</b> c<span class="s"> = </span>paper.rect(<span class="d">10</span>, <span class="d">10</span>, <span class="d">50</span>, <span class="d">50</span>);
1232 <span class="c">// rectangle <b>with</b> rounded corners</span>
1233 <b>var</b> c<span class="s"> = </span>paper.rect(<span class="d">40</span>, <span class="d">40</span>, <span class="d">50</span>, <span class="d">50</span>, <span class="d">10</span>);
1234 </code></pre>
1235 </div><div class="extra"></div></div><div class="Paper.remove-section"><h3 id="Paper.remove" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.remove()<a href="#Paper.remove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1321 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1321">&#x27ad;</a></h3>
1236 <div class="dr-method"><p>Removes the paper from the DOM.
1237 </p>
1238 </div><div class="extra"></div></div><div class="Paper.renderfix-section"><h3 id="Paper.renderfix" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.renderfix()<a href="#Paper.renderfix" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1281 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1281">&#x27ad;</a></h3>
1239 <div class="dr-method"><p>Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependant
1240 on other elements after reflow it could shift half pixel which cause for lines to lost their crispness.
1241 This method fixes the issue.
1242 </p>
1243 </div><div class="extra"></div></div><div class="Paper.safari-section"><h3 id="Paper.safari" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.safari()<a href="#Paper.safari" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2117 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2117">&#x27ad;</a></h3>
1244 <div class="dr-method"><p>There is an inconvenient rendering bug in Safari (WebKit):
1245 sometimes the rendering should be forced.
1246 This method should help with dealing with this bug.
1247 </p>
1248 </div><div class="extra"></div></div><div class="Paper.set-section"><h3 id="Paper.set" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.set()<a href="#Paper.set" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2799 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2799">&#x27ad;</a></h3>
1249 <div class="dr-method"><p>Creates array-like object to keep and operate several elements at once.
1250 Warning: it doesn’t create any elements for itself in the page, it just groups existing elements.
1251 Sets act as pseudo elements — all methods available to an element can be used on a set.
1252 </p>
1253 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">array-like object that represents set of elements</span></p>
1254 <p class="header">Usage
1255 </p>
1256 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1257 st.push(
1258     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1259     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1260 );
1261 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1262 </code></pre>
1263 </div><div class="extra"></div></div><div class="Paper.setFinish-section"><h3 id="Paper.setFinish" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setFinish()<a href="#Paper.setFinish" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2830 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2830">&#x27ad;</a></h3>
1264 <div class="dr-method"><p>See <a href="#Paper.setStart" class="dr-link">Paper.setStart</a>. This method finishes catching and returns resulting set.
1265 </p>
1266 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">set</span></p>
1267 </div><div class="extra"></div></div><div class="Paper.setSize-section"><h3 id="Paper.setSize" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setSize(width, height)<a href="#Paper.setSize" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2853 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2853">&#x27ad;</a></h3>
1268 <div class="dr-method"><p>If you need to change dimensions of the canvas call this method
1269 </p>
1270 <p class="header">Parameters
1271 </p>
1272 <dl class="dr-parameters"><dt class="dr-param">width</dt>
1273 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1274 <dd class="dr-description">new width of the canvas</dd>
1275 <dt class="dr-param">height</dt>
1276 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1277 <dd class="dr-description">new height of the canvas</dd>
1278 </dl>
1279 <p class="header">Usage
1280 </p>
1281 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1282 st.push(
1283     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1284     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1285 );
1286 st.attr({fill: <i>"red"</i>});
1287 </code></pre>
1288 </div><div class="extra"></div></div><div class="Paper.setStart-section"><h3 id="Paper.setStart" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setStart()<a href="#Paper.setStart" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2819 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2819">&#x27ad;</a></h3>
1289 <div class="dr-method"><p>Creates <a href="#Paper.set" class="dr-link">Paper.set</a>. All elements that will be created after calling this method and before calling
1290 <a href="#Paper.setFinish" class="dr-link">Paper.setFinish</a> will be added to the set.
1291 </p>
1292 <p class="header">Usage
1293 </p>
1294 <pre class="javascript code"><code>paper.setStart();
1295 paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1296 paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1297 <b>var</b> st<span class="s"> = </span>paper.setFinish();
1298 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1299 </code></pre>
1300 </div><div class="extra"></div></div><div class="Paper.setViewBox-section"><h3 id="Paper.setViewBox" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setViewBox(x, y, w, h, fit)<a href="#Paper.setViewBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2871 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2871">&#x27ad;</a></h3>
1301 <div class="dr-method"><p>Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by 
1302 specifying new boundaries.
1303 </p>
1304 <p class="header">Parameters
1305 </p>
1306 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1307 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1308 <dd class="dr-description">new x position, default is <code>0</code></dd>
1309 <dt class="dr-param">y</dt>
1310 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1311 <dd class="dr-description">new y position, default is <code>0</code></dd>
1312 <dt class="dr-param">w</dt>
1313 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1314 <dd class="dr-description">new width of the canvas</dd>
1315 <dt class="dr-param">h</dt>
1316 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1317 <dd class="dr-description">new height of the canvas</dd>
1318 <dt class="dr-param">fit</dt>
1319 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
1320 <dd class="dr-description"><code>true</code> if you want graphics to fit into new boundary box</dd>
1321 </dl>
1322 </div><div class="extra"></div></div><div class="Paper.text-section"><h3 id="Paper.text" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2777 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2777">&#x27ad;</a></h3>
1323 <div class="dr-method"><p>Draws a text string. If you need line breaks, put “\n” in the string.
1324 </p>
1325 <p class="header">Parameters
1326 </p>
1327 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1328 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1329 <dd class="dr-description">x coordinate position</dd>
1330 <dt class="dr-param">y</dt>
1331 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1332 <dd class="dr-description">y coordinate position</dd>
1333 <dt class="dr-param">text</dt>
1334 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1335 <dd class="dr-description">The text string to draw</dd>
1336 </dl>
1337 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphaël element object with type “text”</span></p>
1338 <p class="header">Usage
1339 </p>
1340 <pre class="javascript code"><code><b>var</b> t<span class="s"> = </span>paper.text(<span class="d">50</span>, <span class="d">50</span>, <i>"Raphaël\nkicks\nbutt!"</i>);
1341 </code></pre>
1342 </div><div class="extra"></div></div><div class="Paper.top-section"><h3 id="Paper.top" class="dr-property"><i class="dr-trixie">&#160;</i>Paper.top<a href="#Paper.top" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2880 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2880">&#x27ad;</a></h3>
1343 <div class="dr-property"><p>Points to the topmost element on the paper
1344 </p>
1345 </div><div class="extra"></div></div><div class="Raphael-section"><h2 id="Raphael" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael(…)<a href="#Raphael" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 59 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L59">&#x27ad;</a></h2>
1346 <div class="dr-method"><p>Creates a canvas object on which to draw.
1347 You must do this first, as all future calls to drawing methods
1348 from this instance will be bound to this canvas.
1349 </p>
1350 <p class="header">Parameters
1351 </p>
1352 <dl class="dr-parameters"><dt class="dr-param">container</dt>
1353 <dd class="dr-type"><em class="dr-type-HTMLElement">HTMLElement</em> <em class="dr-type-string">string</em></dd>
1354 <dd class="dr-description">DOM element or its ID which is going to be a parent for drawing surface</dd>
1355 <dt class="dr-param">width</dt>
1356 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1357 <dd class="dr-description">&#160;</dd>
1358 <dt class="dr-param">height</dt>
1359 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1360 <dd class="dr-description">&#160;</dd>
1361 <dt class="dr-param optional">callback</dt>
1362 <dd class="dr-optional">optional</dd>
1363 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1364 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1365 </dl>
1366 <p>or
1367 </p>
1368 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1369 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1370 <dd class="dr-description">&#160;</dd>
1371 <dt class="dr-param">y</dt>
1372 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1373 <dd class="dr-description">&#160;</dd>
1374 <dt class="dr-param">width</dt>
1375 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1376 <dd class="dr-description">&#160;</dd>
1377 <dt class="dr-param">height</dt>
1378 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1379 <dd class="dr-description">&#160;</dd>
1380 <dt class="dr-param optional">callback</dt>
1381 <dd class="dr-optional">optional</dd>
1382 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1383 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1384 </dl>
1385 <p>or
1386 </p>
1387 <dl class="dr-parameters"><dt class="dr-param">all</dt>
1388 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
1389 <dd class="dr-description">(first 3 or 4 elements in the array are equal to [containerID, width, height] or [x, y, width, height]. The rest are element descriptions in format {type: type, &lt;attributes>})</dd>
1390 <dt class="dr-param optional">callback</dt>
1391 <dd class="dr-optional">optional</dd>
1392 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1393 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1394 </dl>
1395 <p>or
1396 </p>
1397 <dl class="dr-parameters"><dt class="dr-param">onReadyCallback</dt>
1398 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1399 <dd class="dr-description">function that is going to be called on DOM ready event. You can also subscribe to this event via Eve’s “DOMLoad” event. In this case method returns <code>undefined</code>.</dd>
1400 </dl>
1401 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Paper" class="dr-link">Paper</a></span></p>
1402 <p class="header">Usage
1403 </p>
1404 <pre class="javascript code"><code><span class="c">// Each of the following examples create a canvas</span>
1405 <span class="c">// that is 320px wide by 200px high.</span>
1406 <span class="c">// Canvas is created at the viewport’s <span class="d">10</span>,<span class="d">50</span> coordinate.</span>
1407 <b>var</b> paper<span class="s"> = </span>Raphael(<span class="d">10</span>, <span class="d">50</span>, <span class="d">320</span>, <span class="d">200</span>);
1408 <span class="c">// Canvas is created at the top left corner of the #notepad element</span>
1409 <span class="c">// (or its top right corner <b>in</b> dir=<i>"rtl"</i> elements)</span>
1410 <b>var</b> paper<span class="s"> = </span>Raphael(document.getElementById(<i>"notepad"</i>), <span class="d">320</span>, <span class="d">200</span>);
1411 <span class="c">// Same as above</span>
1412 <b>var</b> paper<span class="s"> = </span>Raphael(<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>);
1413 <span class="c">// Image dump</span>
1414 <b>var</b> set<span class="s"> = </span>Raphael([<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>, {
1415     type: <i>"rect"</i>,
1416     x: <span class="d">10</span>,
1417     y: <span class="d">10</span>,
1418     width: <span class="d">25</span>,
1419     height: <span class="d">25</span>,
1420     stroke: <i>"#f00"</i>
1421 }, {
1422     type: <i>"text"</i>,
1423     x: <span class="d">30</span>,
1424     y: <span class="d">40</span>,
1425     text: <i>"Dump"</i>
1426 }]);
1427 </code></pre>
1428 </div><div class="extra"></div></div><div class="Raphael.angle-section"><h3 id="Raphael.angle" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.angle(x1, y1, x2, y2, [x3], [y3])<a href="#Raphael.angle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 403 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L403">&#x27ad;</a></h3>
1429 <div class="dr-method"><p>Returns angle between two or three points
1430 </p>
1431 <p class="header">Parameters
1432 </p>
1433 <dl class="dr-parameters"><dt class="dr-param">x1</dt>
1434 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1435 <dd class="dr-description">x coord of first point</dd>
1436 <dt class="dr-param">y1</dt>
1437 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1438 <dd class="dr-description">y coord of first point</dd>
1439 <dt class="dr-param">x2</dt>
1440 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1441 <dd class="dr-description">x coord of second point</dd>
1442 <dt class="dr-param">y2</dt>
1443 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1444 <dd class="dr-description">y coord of second point</dd>
1445 <dt class="dr-param optional">x3</dt>
1446 <dd class="dr-optional">optional</dd>
1447 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1448 <dd class="dr-description">x coord of third point</dd>
1449 <dt class="dr-param optional">y3</dt>
1450 <dd class="dr-optional">optional</dd>
1451 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1452 <dd class="dr-description">y coord of third point</dd>
1453 </dl>
1454 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">angle in degrees.</span></p>
1455 </div><div class="extra"></div></div><div class="Raphael.animation-section"><h3 id="Raphael.animation" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.animation(params, ms, [easing], [callback])<a href="#Raphael.animation" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3851 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3851">&#x27ad;</a></h3>
1456 <div class="dr-method"><p>Creates an animation object that can be passed to the <a href="#Element.animate" class="dr-link">Element.animate</a> or <a href="#Element.animateWith" class="dr-link">Element.animateWith</a> methods.
1457 See also <a href="#Animation.delay" class="dr-link">Animation.delay</a> and <a href="#Animation.repeat" class="dr-link">Animation.repeat</a> methods.
1458 </p>
1459 <p class="header">Parameters
1460 </p>
1461 <dl class="dr-parameters"><dt class="dr-param">params</dt>
1462 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1463 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
1464 <dt class="dr-param">ms</dt>
1465 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1466 <dd class="dr-description">number of milliseconds for animation to run</dd>
1467 <dt class="dr-param optional">easing</dt>
1468 <dd class="dr-optional">optional</dd>
1469 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1470 <dd class="dr-description">easing type. Accept one of <a href="#Raphael.easing_formulas" class="dr-link">Raphael.easing_formulas</a> or CSS format: <code>cubic&#x2010;bezier(XX,&#160;XX,&#160;XX,&#160;XX)</code></dd>
1471 <dt class="dr-param optional">callback</dt>
1472 <dd class="dr-optional">optional</dd>
1473 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1474 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
1475 </dl>
1476 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Animation" class="dr-link">Animation</a></span></p>
1477 </div><div class="extra"></div></div><div class="Raphael.color-section"><h3 id="Raphael.color" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.color(clr)<a href="#Raphael.color" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 597 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L597">&#x27ad;</a></h3>
1478 <div class="dr-method"><p>Parses the color string and returns object with all values for the given color.
1479 </p>
1480 <p class="header">Parameters
1481 </p>
1482 <dl class="dr-parameters"><dt class="dr-param">clr</dt>
1483 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1484 <dd class="dr-description">color string in one of the supported formats (see <a href="#Raphael.getRGB" class="dr-link">Raphael.getRGB</a>)</dd>
1485 </dl>
1486 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Combined RGB <em class="amp">&amp;</em> HSB object in format:</span></p>
1487 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">red,</span>
1488 <li><span class="dr-json-key">g</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">green,</span>
1489 <li><span class="dr-json-key">b</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">blue,</span>
1490 <li><span class="dr-json-key">hex</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">color in HTML/CSS format: #••••••,</span>
1491 <li><span class="dr-json-key">error</span><span class="dr-type"><em class="dr-type-boolean">boolean</em></span><span class="dr-json-description"><code>true</code> if string can’t be parsed,</span>
1492 <li><span class="dr-json-key">h</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">hue,</span>
1493 <li><span class="dr-json-key">s</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">saturation,</span>
1494 <li><span class="dr-json-key">v</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">value (brightness),</span>
1495 <li><span class="dr-json-key">l</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">lightness</span>
1496 </ol></li><li>}</li></ol>
1497 </div><div class="extra"></div></div><div class="Raphael.deg-section"><h3 id="Raphael.deg" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.deg(deg)<a href="#Raphael.deg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 436 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L436">&#x27ad;</a></h3>
1498 <div class="dr-method"><p>Transform angle to degrees
1499 </p>
1500 <p class="header">Parameters
1501 </p>
1502 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1503 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1504 <dd class="dr-description">angle in radians</dd>
1505 </dl>
1506 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">angle in degrees.</span></p>
1507 </div><div class="extra"></div></div><div class="Raphael.easing_formulas-section"><h3 id="Raphael.easing_formulas" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.easing_formulas<a href="#Raphael.easing_formulas" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3302 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3302">&#x27ad;</a></h3>
1508 <div class="dr-property"><p>Object that contains easing formulas for animation. You could extend it with your own. By default it has following list of easing:
1509 </p>
1510 <ul>
1511     <li>“linear”</li>
1512     <li>“&lt;” or “easeIn” or “ease-in”</li>
1513     <li>“>” or “easeOut” or “ease-out”</li>
1514     <li>“&lt;>” or “easeInOut” or “ease-in-out”</li>
1515     <li>“backIn” or “back-in”</li>
1516     <li>“backOut” or “back-out”</li>
1517     <li>“elastic”</li>
1518     <li>“bounce”</li>
1519 </ul>
1520 <p>See also <a href="http://raphaeljs.com/easing.html">Easing demo</a>.</p>
1521 </div><div class="extra"></div></div><div class="Raphael.el-section"><h3 id="Raphael.el" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.el<a href="#Raphael.el" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2254 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2254">&#x27ad;</a></h3>
1522 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>You can add your own method to elements. This is usefull when you want to hack default functionality or
1523 want to wrap some common transformation or attributes in one method. In difference to canvas methods,
1524 you can redefine element method at any time. Expending element methods wouldn’t affect set.
1525 </p>
1526 <p class="header">Usage
1527 </p>
1528 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
1529     <b>this</b>.attr({fill: <i>"#f00"</i>});
1530 };
1531 <span class="c">// then use it</span>
1532 paper.circle(<span class="d">100</span>, <span class="d">100</span>, <span class="d">20</span>).red();
1533 </code></pre>
1534 </div><div class="extra"></div></div><div class="Raphael.findDotsAtSegment-section"><h3 id="Raphael.findDotsAtSegment" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)<a href="#Raphael.findDotsAtSegment" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1110 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1110">&#x27ad;</a></h3>
1535 <div class="dr-method"><p>Utility method
1536 Find dot coordinates on the given cubic bezier curve at the given t.
1537 </p>
1538 <p class="header">Parameters
1539 </p>
1540 <dl class="dr-parameters"><dt class="dr-param">p1x</dt>
1541 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1542 <dd class="dr-description">x of the first point of the curve</dd>
1543 <dt class="dr-param">p1y</dt>
1544 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1545 <dd class="dr-description">y of the first point of the curve</dd>
1546 <dt class="dr-param">c1x</dt>
1547 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1548 <dd class="dr-description">x of the first anchor of the curve</dd>
1549 <dt class="dr-param">c1y</dt>
1550 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1551 <dd class="dr-description">y of the first anchor of the curve</dd>
1552 <dt class="dr-param">c2x</dt>
1553 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1554 <dd class="dr-description">x of the second anchor of the curve</dd>
1555 <dt class="dr-param">c2y</dt>
1556 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1557 <dd class="dr-description">y of the second anchor of the curve</dd>
1558 <dt class="dr-param">p2x</dt>
1559 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1560 <dd class="dr-description">x of the second point of the curve</dd>
1561 <dt class="dr-param">p2y</dt>
1562 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1563 <dd class="dr-description">y of the second point of the curve</dd>
1564 <dt class="dr-param">t</dt>
1565 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1566 <dd class="dr-description">position on the curve (0..1)</dd>
1567 </dl>
1568 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">point information in format:</span></p>
1569 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate of the point</span>
1570 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate of the point</span>
1571 <li>    m: {<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate of the left anchor</span>
1572 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate of the left anchor</span>
1573 </ol></li><li>    }</li><li>    n: {<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate of the right anchor</span>
1574 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate of the right anchor</span>
1575 </ol></li><li>    }</li><li>    start: {<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate of the start of the curve</span>
1576 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate of the start of the curve</span>
1577 </ol></li><li>    }</li><li>    end: {<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate of the end of the curve</span>
1578 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate of the end of the curve</span>
1579 </ol></li><li>    }</li><li><span class="dr-json-key">alpha:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">angle of the curve derivative at the point</span>
1580 </ol></li><li>}</li></ol>
1581 </div><div class="extra"></div></div><div class="Raphael.fn-section"><h3 id="Raphael.fn" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.fn<a href="#Raphael.fn" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 335 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L335">&#x27ad;</a></h3>
1582 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>You can add your own method to the canvas. For example if you want to draw a pie chart,
1583 you can create your own pie chart function and ship it as a Raphaël plugin. To do this
1584 you need to extend the <code>Raphael.fn</code> object. Please note that you can create your own namespaces
1585 inside the <code>fn</code> object — methods will be run in the context of canvas anyway. You should alter
1586 the <code>fn</code> object before a Raphaël instance is created, otherwise it will take no effect.
1587 </p>
1588 <p class="header">Usage
1589 </p>
1590 <pre class="javascript code"><code>Raphael.fn.arrow<span class="s"> = </span><b>function</b> (x1, y1, x2, y2, size) {
1591     <b>return</b> <b>this</b>.path( ... );
1592 };
1593 <span class="c">// or create namespace</span>
1594 Raphael.fn.mystuff<span class="s"> = </span>{
1595     arrow: <b>function</b> () {…},
1596     star: <b>function</b> () {…},
1597     <span class="c">// etc…</span>
1598 };
1599 <b>var</b> paper<span class="s"> = </span>Raphael(<span class="d">10</span>, <span class="d">10</span>, <span class="d">630</span>, <span class="d">480</span>);
1600 <span class="c">// then use it</span>
1601 paper.arrow(<span class="d">10</span>, <span class="d">10</span>, <span class="d">30</span>, <span class="d">30</span>, <span class="d">5</span>).attr({fill: <i>"#f00"</i>});
1602 paper.mystuff.arrow();
1603 paper.mystuff.star();
1604 </code></pre>
1605 </div><div class="extra"></div></div><div class="Raphael.format-section"><h3 id="Raphael.format" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.format(token, …)<a href="#Raphael.format" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4357 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4357">&#x27ad;</a></h3>
1606 <div class="dr-method"><p>Simple format function. Replaces construction of type “<code>{&lt;number>}</code>” to the corresponding argument.
1607 </p>
1608 <p class="header">Parameters
1609 </p>
1610 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1611 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1612 <dd class="dr-description">string to format</dd>
1613 <dt class="dr-param">…</dt>
1614 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1615 <dd class="dr-description">rest of arguments will be treated as parameters for replacement</dd>
1616 </dl>
1617 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">formated string</span></p>
1618 <p class="header">Usage
1619 </p>
1620 <pre class="javascript code"><code><b>var</b> x<span class="s"> = </span><span class="d">10</span>,
1621     y<span class="s"> = </span><span class="d">20</span>,
1622     width<span class="s"> = </span><span class="d">40</span>,
1623     height<span class="s"> = </span><span class="d">50</span>;
1624 <span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1625 paper.path(Raphael.format(<i>"M{<span class="d">1</span>},{<span class="d">2</span>}h{<span class="d">3</span>}v{<span class="d">4</span>}h{<span class="d">5</span>}z"</i>, x, y, width, height, -width));
1626 </code></pre>
1627 </div><div class="extra"></div></div><div class="Raphael.fullfill-section"><h3 id="Raphael.fullfill" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.fullfill(token, json)<a href="#Raphael.fullfill" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4387 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4387">&#x27ad;</a></h3>
1628 <div class="dr-method"><p>A little bit more advanced format function than <a href="#Raphael.format" class="dr-link">Raphael.format</a>. Replaces construction of type “<code>{&lt;name>}</code>” to the corresponding argument.
1629 </p>
1630 <p class="header">Parameters
1631 </p>
1632 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1633 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1634 <dd class="dr-description">string to format</dd>
1635 <dt class="dr-param">json</dt>
1636 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1637 <dd class="dr-description">object which properties will be used as a replacement</dd>
1638 </dl>
1639 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">formated string</span></p>
1640 <p class="header">Usage
1641 </p>
1642 <pre class="javascript code"><code><span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1643 paper.path(Raphael.format(<i>"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z"</i>, {
1644     x: <span class="d">10</span>,
1645     y: <span class="d">20</span>,
1646     dim: {
1647         width: <span class="d">40</span>,
1648         height: <span class="d">50</span>,
1649         <i>"negative width"</i>: -<span class="d">40</span>
1650     }
1651 }));
1652 </code></pre>
1653 </div><div class="extra"></div></div><div class="Raphael.getColor-section"><h3 id="Raphael.getColor" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getColor([value])<a href="#Raphael.getColor" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 973 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L973">&#x27ad;</a></h3>
1654 <div class="dr-method"><p>On each call returns next colour in the spectrum. To reset it back to red call <a href="#Raphael.getColor.reset" class="dr-link">Raphael.getColor.reset</a>
1655 </p>
1656 <p class="header">Parameters
1657 </p>
1658 <dl class="dr-parameters"><dt class="dr-param optional">value</dt>
1659 <dd class="dr-optional">optional</dd>
1660 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1661 <dd class="dr-description">brightness, default is <code>0.75</code></dd>
1662 </dl>
1663 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">hex representation of the colour.</span></p>
1664 </div><div class="extra"></div></div><div class="Raphael.getColor.reset-section"><h4 id="Raphael.getColor.reset" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getColor.reset()<a href="#Raphael.getColor.reset" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 990 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L990">&#x27ad;</a></h4>
1665 <div class="dr-method"><p>Resets spectrum position for <a href="#Raphael.getColor" class="dr-link">Raphael.getColor</a> back to red.
1666 </p>
1667 </div><div class="extra"></div></div><div class="Raphael.getPointAtLength-section"><h3 id="Raphael.getPointAtLength" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getPointAtLength(path, length)<a href="#Raphael.getPointAtLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3211 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3211">&#x27ad;</a></h3>
1668 <div class="dr-method"><p>Return coordinates of the point located at the given length on the given path.
1669 </p>
1670 <p class="header">Parameters
1671 </p>
1672 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1673 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1674 <dd class="dr-description">SVG path string</dd>
1675 <dt class="dr-param">length</dt>
1676 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1677 <dd class="dr-description">&#160;</dd>
1678 </dl>
1679 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">representation of the point:</span></p>
1680 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">x:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">x coordinate</span>
1681 <li><span class="dr-json-key">y:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y coordinate</span>
1682 <li><span class="dr-json-key">alpha:</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">angle of derivative</span>
1683 </ol></li><li>}</li></ol>
1684 </div><div class="extra"></div></div><div class="Raphael.getRGB-section"><h3 id="Raphael.getRGB" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getRGB(colour)<a href="#Raphael.getRGB" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 851 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L851">&#x27ad;</a></h3>
1685 <div class="dr-method"><p>Parses colour string as RGB object
1686 </p>
1687 <p class="header">Parameters
1688 </p>
1689 <dl class="dr-parameters"><dt class="dr-param">colour</dt>
1690 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1691 <dd class="dr-description">colour string in one of formats:</dd>
1692 </dl>
1693 <ul>
1694     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
1695     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
1696     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
1697     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
1698     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
1699     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
1700     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
1701     <li>hsl(•••, •••, •••) — same as hsb</li>
1702     <li>hsl(•••%, •••%, •••%) — same as hsb</li>
1703 </ul>
1704 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">RGB object in format:</span></p>
1705 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">red,</span>
1706 <li><span class="dr-json-key">g</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">green,</span>
1707 <li><span class="dr-json-key">b</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">blue</span>
1708 <li><span class="dr-json-key">hex</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">color in HTML/CSS format: #••••••,</span>
1709 <li><span class="dr-json-key">error</span><span class="dr-type"><em class="dr-type-boolean">boolean</em></span><span class="dr-json-description">true if string can’t be parsed</span>
1710 </ol></li><li>}</li></ol>
1711 </div><div class="extra"></div></div><div class="Raphael.getSubpath-section"><h3 id="Raphael.getSubpath" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getSubpath(path, from, to)<a href="#Raphael.getSubpath" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3226 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3226">&#x27ad;</a></h3>
1712 <div class="dr-method"><p>Return subpath of a given path from given length to given length.
1713 </p>
1714 <p class="header">Parameters
1715 </p>
1716 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1717 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1718 <dd class="dr-description">SVG path string</dd>
1719 <dt class="dr-param">from</dt>
1720 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1721 <dd class="dr-description">position of the start of the segment</dd>
1722 <dt class="dr-param">to</dt>
1723 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1724 <dd class="dr-description">position of the end of the segment</dd>
1725 </dl>
1726 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">pathstring for the segment</span></p>
1727 </div><div class="extra"></div></div><div class="Raphael.getTotalLength-section"><h3 id="Raphael.getTotalLength" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.getTotalLength(path)<a href="#Raphael.getTotalLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3192 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3192">&#x27ad;</a></h3>
1728 <div class="dr-method"><p>Returns length of the given path in pixels.
1729 </p>
1730 <p class="header">Parameters
1731 </p>
1732 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1733 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1734 <dd class="dr-description">SVG path string.</dd>
1735 </dl>
1736 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
1737 </div><div class="extra"></div></div><div class="Raphael.hsb-section"><h3 id="Raphael.hsb" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.hsb(h, s, b)<a href="#Raphael.hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 933 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L933">&#x27ad;</a></h3>
1738 <div class="dr-method"><p>Converts HSB values to hex representation of the colour.
1739 </p>
1740 <p class="header">Parameters
1741 </p>
1742 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1743 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1744 <dd class="dr-description">hue</dd>
1745 <dt class="dr-param">s</dt>
1746 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1747 <dd class="dr-description">saturation</dd>
1748 <dt class="dr-param">b</dt>
1749 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1750 <dd class="dr-description">value or brightness</dd>
1751 </dl>
1752 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">hex representation of the colour.</span></p>
1753 </div><div class="extra"></div></div><div class="Raphael.hsb2rgb-section"><h3 id="Raphael.hsb2rgb" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.hsb2rgb(h, s, v)<a href="#Raphael.hsb2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 647 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L647">&#x27ad;</a></h3>
1754 <div class="dr-method"><p>Converts HSB values to RGB object.
1755 </p>
1756 <p class="header">Parameters
1757 </p>
1758 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1759 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1760 <dd class="dr-description">hue</dd>
1761 <dt class="dr-param">s</dt>
1762 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1763 <dd class="dr-description">saturation</dd>
1764 <dt class="dr-param">v</dt>
1765 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1766 <dd class="dr-description">value or brightness</dd>
1767 </dl>
1768 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">RGB object in format:</span></p>
1769 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">red,</span>
1770 <li><span class="dr-json-key">g</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">green,</span>
1771 <li><span class="dr-json-key">b</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">blue,</span>
1772 <li><span class="dr-json-key">hex</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">color in HTML/CSS format: #••••••</span>
1773 </ol></li><li>}</li></ol>
1774 </div><div class="extra"></div></div><div class="Raphael.hsl-section"><h3 id="Raphael.hsl" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.hsl(h, s, l)<a href="#Raphael.hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 947 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L947">&#x27ad;</a></h3>
1775 <div class="dr-method"><p>Converts HSL values to hex representation of the colour.
1776 </p>
1777 <p class="header">Parameters
1778 </p>
1779 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1780 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1781 <dd class="dr-description">hue</dd>
1782 <dt class="dr-param">s</dt>
1783 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1784 <dd class="dr-description">saturation</dd>
1785 <dt class="dr-param">l</dt>
1786 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1787 <dd class="dr-description">luminosity</dd>
1788 </dl>
1789 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">hex representation of the colour.</span></p>
1790 </div><div class="extra"></div></div><div class="Raphael.hsl2rgb-section"><h3 id="Raphael.hsl2rgb" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.hsl2rgb(h, s, l)<a href="#Raphael.hsl2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 684 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L684">&#x27ad;</a></h3>
1791 <div class="dr-method"><p>Converts HSL values to RGB object.
1792 </p>
1793 <p class="header">Parameters
1794 </p>
1795 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1796 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1797 <dd class="dr-description">hue</dd>
1798 <dt class="dr-param">s</dt>
1799 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1800 <dd class="dr-description">saturation</dd>
1801 <dt class="dr-param">l</dt>
1802 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1803 <dd class="dr-description">luminosity</dd>
1804 </dl>
1805 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">RGB object in format:</span></p>
1806 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">red,</span>
1807 <li><span class="dr-json-key">g</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">green,</span>
1808 <li><span class="dr-json-key">b</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">blue,</span>
1809 <li><span class="dr-json-key">hex</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">color in HTML/CSS format: #••••••</span>
1810 </ol></li><li>}</li></ol>
1811 </div><div class="extra"></div></div><div class="Raphael.is-section"><h3 id="Raphael.is" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.is(o, type)<a href="#Raphael.is" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 375 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L375">&#x27ad;</a></h3>
1812 <div class="dr-method"><p>Handfull replacement for <code>typeof</code> operator.
1813 </p>
1814 <p class="header">Parameters
1815 </p>
1816 <dl class="dr-parameters"><dt class="dr-param">o</dt>
1817 <dd class="dr-type"><em class="dr-type-…">…</em></dd>
1818 <dd class="dr-description">any object or primitive</dd>
1819 <dt class="dr-param">type</dt>
1820 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1821 <dd class="dr-description">name of the type, i.e. “string”, “function”, “number”, etc.</dd>
1822 </dl>
1823 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-boolean">boolean</em> <span class="dr-description">is given value is of given type</span></p>
1824 </div><div class="extra"></div></div><div class="Raphael.matrix-section"><h3 id="Raphael.matrix" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.matrix(a, b, c, d, e, f)<a href="#Raphael.matrix" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1857 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1857">&#x27ad;</a></h3>
1825 <div class="dr-method"><p>Utility method
1826 Returns matrix based on given parameters.
1827 </p>
1828 <p class="header">Parameters
1829 </p>
1830 <dl class="dr-parameters"><dt class="dr-param">a</dt>
1831 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1832 <dd class="dr-description">&#160;</dd>
1833 <dt class="dr-param">b</dt>
1834 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1835 <dd class="dr-description">&#160;</dd>
1836 <dt class="dr-param">c</dt>
1837 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1838 <dd class="dr-description">&#160;</dd>
1839 <dt class="dr-param">d</dt>
1840 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1841 <dd class="dr-description">&#160;</dd>
1842 <dt class="dr-param">e</dt>
1843 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1844 <dd class="dr-description">&#160;</dd>
1845 <dt class="dr-param">f</dt>
1846 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1847 <dd class="dr-description">&#160;</dd>
1848 </dl>
1849 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span></p>
1850 </div><div class="extra"></div></div><div class="Raphael.ninja-section"><h3 id="Raphael.ninja" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.ninja()<a href="#Raphael.ninja" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4424 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4424">&#x27ad;</a></h3>
1851 <div class="dr-method"><p>If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable <code>Raphael</code>, but anyway.) You can use <code>ninja</code> method.
1852 Beware, that in this case plugins could stop working, because they are depending on global variable existance.
1853 </p>
1854 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Raphael object</span></p>
1855 <p class="header">Usage
1856 </p>
1857 <pre class="javascript code"><code>(<b>function</b> (local_raphael) {
1858     <b>var</b> paper<span class="s"> = </span>local_raphael(<span class="d">10</span>, <span class="d">10</span>, <span class="d">320</span>, <span class="d">200</span>);
1859     …
1860 })(Raphael.ninja());
1861 </code></pre>
1862 </div><div class="extra"></div></div><div class="Raphael.parsePathString-section"><h3 id="Raphael.parsePathString" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.parsePathString(pathString)<a href="#Raphael.parsePathString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1005 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1005">&#x27ad;</a></h3>
1863 <div class="dr-method"><p>Utility method
1864 Parses given path string into an array of arrays of path segments.
1865 </p>
1866 <p class="header">Parameters
1867 </p>
1868 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1869 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1870 <dd class="dr-description">path string or array of segments (in the last case it will be returned straight away)</dd>
1871 </dl>
1872 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of segments.</span></p>
1873 </div><div class="extra"></div></div><div class="Raphael.parseTransformString-section"><h3 id="Raphael.parseTransformString" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.parseTransformString(TString)<a href="#Raphael.parseTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1048 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1048">&#x27ad;</a></h3>
1874 <div class="dr-method"><p>Utility method
1875 Parses given path string into an array of transformations.
1876 </p>
1877 <p class="header">Parameters
1878 </p>
1879 <dl class="dr-parameters"><dt class="dr-param">TString</dt>
1880 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1881 <dd class="dr-description">transform string or array of transformations (in the last case it will be returned straight away)</dd>
1882 </dl>
1883 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of transformations.</span></p>
1884 </div><div class="extra"></div></div><div class="Raphael.path2curve-section"><h3 id="Raphael.path2curve" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.path2curve(pathString)<a href="#Raphael.path2curve" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1840 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1840">&#x27ad;</a></h3>
1885 <div class="dr-method"><p>Utility method
1886 Converts path to a new path where all segments are cubic bezier curves.
1887 </p>
1888 <p class="header">Parameters
1889 </p>
1890 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1891 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1892 <dd class="dr-description">path string or array of segments</dd>
1893 </dl>
1894 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of segments.</span></p>
1895 </div><div class="extra"></div></div><div class="Raphael.pathToRelative-section"><h3 id="Raphael.pathToRelative" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.pathToRelative(pathString)<a href="#Raphael.pathToRelative" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1827 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1827">&#x27ad;</a></h3>
1896 <div class="dr-method"><p>Utility method
1897 Converts path to relative form
1898 </p>
1899 <p class="header">Parameters
1900 </p>
1901 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1902 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1903 <dd class="dr-description">path string or array of segments</dd>
1904 </dl>
1905 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of segments.</span></p>
1906 </div><div class="extra"></div></div><div class="Raphael.rad-section"><h3 id="Raphael.rad" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.rad(deg)<a href="#Raphael.rad" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 424 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L424">&#x27ad;</a></h3>
1907 <div class="dr-method"><p>Transform angle to radians
1908 </p>
1909 <p class="header">Parameters
1910 </p>
1911 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1912 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1913 <dd class="dr-description">angle in degrees</dd>
1914 </dl>
1915 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">angle in radians.</span></p>
1916 </div><div class="extra"></div></div><div class="Raphael.registerFont-section"><h3 id="Raphael.registerFont" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.registerFont(font)<a href="#Raphael.registerFont" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4204 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4204">&#x27ad;</a></h3>
1917 <div class="dr-method"><p>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.
1918 Returns original parameter, so it could be used with chaining.
1919 </p>
1920 <a href="http://wiki.github.com/sorccu/cufon/about">More about Cufón and how to convert your font form TTF, OTF, etc to JavaScript file.</a>
1921 <p class="header">Parameters
1922 </p>
1923 <dl class="dr-parameters"><dt class="dr-param">font</dt>
1924 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1925 <dd class="dr-description">the font to register</dd>
1926 </dl>
1927 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">the font you passed in</span></p>
1928 <p class="header">Usage
1929 </p>
1930 <pre class="javascript code"><code>Cufon.registerFont(Raphael.registerFont({…}));
1931 </code></pre>
1932 </div><div class="extra"></div></div><div class="Raphael.rgb-section"><h3 id="Raphael.rgb" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.rgb(r, g, b)<a href="#Raphael.rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 961 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L961">&#x27ad;</a></h3>
1933 <div class="dr-method"><p>Converts RGB values to hex representation of the colour.
1934 </p>
1935 <p class="header">Parameters
1936 </p>
1937 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1938 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1939 <dd class="dr-description">red</dd>
1940 <dt class="dr-param">g</dt>
1941 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1942 <dd class="dr-description">green</dd>
1943 <dt class="dr-param">b</dt>
1944 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1945 <dd class="dr-description">blue</dd>
1946 </dl>
1947 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">hex representation of the colour.</span></p>
1948 </div><div class="extra"></div></div><div class="Raphael.rgb2hsb-section"><h3 id="Raphael.rgb2hsb" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.rgb2hsb(r, g, b)<a href="#Raphael.rgb2hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 724 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L724">&#x27ad;</a></h3>
1949 <div class="dr-method"><p>Converts RGB values to HSB object.
1950 </p>
1951 <p class="header">Parameters
1952 </p>
1953 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1954 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1955 <dd class="dr-description">red</dd>
1956 <dt class="dr-param">g</dt>
1957 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1958 <dd class="dr-description">green</dd>
1959 <dt class="dr-param">b</dt>
1960 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1961 <dd class="dr-description">blue</dd>
1962 </dl>
1963 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">HSB object in format:</span></p>
1964 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">h</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">hue</span>
1965 <li><span class="dr-json-key">s</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">saturation</span>
1966 <li><span class="dr-json-key">b</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">brightness</span>
1967 </ol></li><li>}</li></ol>
1968 </div><div class="extra"></div></div><div class="Raphael.rgb2hsl-section"><h3 id="Raphael.rgb2hsl" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.rgb2hsl(r, g, b)<a href="#Raphael.rgb2hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 758 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L758">&#x27ad;</a></h3>
1969 <div class="dr-method"><p>Converts RGB values to HSL object.
1970 </p>
1971 <p class="header">Parameters
1972 </p>
1973 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1974 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1975 <dd class="dr-description">red</dd>
1976 <dt class="dr-param">g</dt>
1977 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1978 <dd class="dr-description">green</dd>
1979 <dt class="dr-param">b</dt>
1980 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1981 <dd class="dr-description">blue</dd>
1982 </dl>
1983 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">HSL object in format:</span></p>
1984 <ol class="dr-json"><li>{<ol class="dr-json"><li><span class="dr-json-key">h</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">hue</span>
1985 <li><span class="dr-json-key">s</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">saturation</span>
1986 <li><span class="dr-json-key">l</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">luminosity</span>
1987 </ol></li><li>}</li></ol>
1988 </div><div class="extra"></div></div><div class="Raphael.setWindow-section"><h3 id="Raphael.setWindow" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.setWindow(newwin)<a href="#Raphael.setWindow" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 488 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L488">&#x27ad;</a></h3>
1989 <div class="dr-method"><p>Used when you need to draw in <code>&lt;iframe></code>. Switched window to the iframe one.
1990 </p>
1991 <p class="header">Parameters
1992 </p>
1993 <dl class="dr-parameters"><dt class="dr-param">newwin</dt>
1994 <dd class="dr-type"><em class="dr-type-window">window</em></dd>
1995 <dd class="dr-description">new window object</dd>
1996 </dl>
1997 </div><div class="extra"></div></div><div class="Raphael.snapTo-section"><h3 id="Raphael.snapTo" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.snapTo(values, value, [tolerance])<a href="#Raphael.snapTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 450 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L450">&#x27ad;</a></h3>
1998 <div class="dr-method"><p>Snaps given value to given grid.
1999 </p>
2000 <p class="header">Parameters
2001 </p>
2002 <dl class="dr-parameters"><dt class="dr-param">values</dt>
2003 <dd class="dr-type"><em class="dr-type-array">array</em> <em class="dr-type-number">number</em></dd>
2004 <dd class="dr-description">given array of values or step of the grid</dd>
2005 <dt class="dr-param">value</dt>
2006 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2007 <dd class="dr-description">value to adjust</dd>
2008 <dt class="dr-param optional">tolerance</dt>
2009 <dd class="dr-optional">optional</dd>
2010 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2011 <dd class="dr-description">tolerance for snapping. Default is <code>10</code>.</dd>
2012 </dl>
2013 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">adjusted value.</span></p>
2014 </div><div class="extra"></div></div><div class="Raphael.st-section"><h3 id="Raphael.st" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.st<a href="#Raphael.st" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4448 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4448">&#x27ad;</a></h3>
2015 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>You can add your own method to elements and sets. It is wise to add a set method for each element method
2016 you added, so you will be able to call the same method on sets too.
2017 See also <a href="#Raphael.el" class="dr-link">Raphael.el</a>.
2018 </p>
2019 <p class="header">Usage
2020 </p>
2021 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
2022     <b>this</b>.attr({fill: <i>"#f00"</i>});
2023 };
2024 Raphael.st.red<span class="s"> = </span><b>function</b> () {
2025     <b>this</b>.forEach(<b>function</b> () {
2026         <b>this</b>.red();
2027     });
2028 };
2029 <span class="c">// then use it</span>
2030 paper.set(paper.circle(<span class="d">100</span>, <span class="d">100</span>, <span class="d">20</span>), paper.circle(<span class="d">110</span>, <span class="d">100</span>, <span class="d">20</span>)).red();
2031 </code></pre>
2032 </div><div class="extra"></div></div><div class="Raphael.svg-section"><h3 id="Raphael.svg" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.svg<a href="#Raphael.svg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 302 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L302">&#x27ad;</a></h3>
2033 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports SVG.
2034 </p>
2035 </div><div class="extra"></div></div><div class="Raphael.type-section"><h3 id="Raphael.type" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.type<a href="#Raphael.type" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 284 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L284">&#x27ad;</a></h3>
2036 <div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Can be “SVG”, “VML” or empty, depending on browser support.
2037 </p>
2038 </div><div class="extra"></div></div><div class="Raphael.vml-section"><h3 id="Raphael.vml" class="dr-property"><i class="dr-trixie">&#160;</i>Raphael.vml<a href="#Raphael.vml" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 308 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L308">&#x27ad;</a></h3>
2039 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports VML.
2040 </p>
2041 </div><div class="extra"></div></div><div class="Set-section"><h2 id="Set" class="undefined"><i class="dr-trixie">&#160;</i>Set<a href="#Set" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
2042 <div class="extra"></div></div><div class="Set.forEach-section"><h3 id="Set.forEach" class="dr-method"><i class="dr-trixie">&#160;</i>Set.forEach(callback, thisArg)<a href="#Set.forEach" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4094 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4094">&#x27ad;</a></h3>
2043 <div class="dr-method"><p>Executes given function for each element in the set.
2044 </p>
2045 <p>If function returns <code>false</code> it will stop loop running.
2046 </p>
2047 <p class="header">Parameters
2048 </p>
2049 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
2050 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2051 <dd class="dr-description">function to run</dd>
2052 <dt class="dr-param">thisArg</dt>
2053 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2054 <dd class="dr-description">context object for the callback</dd>
2055 </dl>
2056 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">Set object</span></p>
2057 </div><div class="extra"></div></div><div class="Set.pop-section"><h3 id="Set.pop" class="dr-method"><i class="dr-trixie">&#160;</i>Set.pop()<a href="#Set.pop" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4076 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4076">&#x27ad;</a></h3>
2058 <div class="dr-method"><p>Removes last element and returns it.
2059 </p>
2060 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">element</span></p>
2061 </div><div class="extra"></div></div><div class="Set.push-section"><h3 id="Set.push" class="dr-method"><i class="dr-trixie">&#160;</i>Set.push()<a href="#Set.push" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4056 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4056">&#x27ad;</a></h3>
2062 <div class="dr-method"><p>Adds each argument to the current set.
2063 </p>
2064 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
2065 </div><div class="extra"></div></div><div class="eve-section"><h2 id="eve" class="dr-method"><i class="dr-trixie">&#160;</i>eve(name, scope, varargs)<a href="#eve" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 34 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L34">&#x27ad;</a></h2>
2066 <div class="dr-method"><p>Fires event with given <code>name</code>, given scope and other parameters.
2067 </p>
2068 <p class="header">Arguments
2069 </p>
2070 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2071 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2072 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2073 <dt class="dr-param">scope</dt>
2074 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2075 <dd class="dr-description">context for the event handlers</dd>
2076 <dt class="dr-param">varargs</dt>
2077 <dd class="dr-type"><em class="dr-type-...">...</em></dd>
2078 <dd class="dr-description">the rest of arguments will be sent to event handlers</dd>
2079 </dl>
2080 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">array of returned values from the listeners</span></p>
2081 </div><div class="extra"></div></div><div class="eve.listeners-section"><h3 id="eve.listeners" class="dr-method"><i class="dr-trixie">&#160;</i>eve.listeners(name)<a href="#eve.listeners" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 101 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L101">&#x27ad;</a></h3>
2082 <div class="dr-method"><p>Internal method which gives you array of all event handlers that will be triggered by the given <code>name</code>.
2083 </p>
2084 <p class="header">Arguments
2085 </p>
2086 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2087 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2088 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2089 </dl>
2090 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of event handlers</span></p>
2091 </div><div class="extra"></div></div><div class="eve.nt-section"><h3 id="eve.nt" class="dr-method"><i class="dr-trixie">&#160;</i>eve.nt([subname])<a href="#eve.nt" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 198 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L198">&#x27ad;</a></h3>
2092 <div class="dr-method"><p>Could be used inside event handler to figure out actual name of the event.
2093 </p>
2094 <p class="header">Arguments
2095 </p>
2096 <dl class="dr-parameters"><dt class="dr-param optional">subname</dt>
2097 <dd class="dr-optional">optional</dd>
2098 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2099 <dd class="dr-description">subname of the event</dd>
2100 </dl>
2101 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-string">string</em> <span class="dr-description">name of the event, if <code>subname</code> is not specified</span></p>
2102 <p>or
2103 </p>
2104 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-boolean">boolean</em> <span class="dr-description"><code>true</code>, if current event’s name contains <code>subname</code></span></p>
2105 </div><div class="extra"></div></div><div class="eve.on-section"><h3 id="eve.on" class="dr-method"><i class="dr-trixie">&#160;</i>eve.on(name, f)<a href="#eve.on" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 156 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L156">&#x27ad;</a></h3>
2106 <div class="dr-method"><p>Binds given event handler with a given name. You can use wildcards “<code>*</code>” for the names:
2107 </p>
2108 <pre class="javascript code"><code>eve.on(<i>"*.under.*"</i>, f);
2109 eve(<i>"mouse.under.floor"</i>); <span class="c">// triggers f</span>
2110 </code></pre>
2111 <p>Use <a href="#eve" class="dr-link">eve</a> to trigger the listener.
2112 </p>
2113 <p class="header">Arguments
2114 </p>
2115 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2116 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2117 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2118 <dt class="dr-param">f</dt>
2119 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2120 <dd class="dr-description">event handler function</dd>
2121 </dl>
2122 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-function">function</em> <span class="dr-description">returned function accept one number parameter that represents z-index of the handler. It is optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. </span></p>
2123 <p class="header">Example:
2124 </p>
2125 <pre class="javascript code"><code>eve.on(<i>"mouse"</i>, eat)(<span class="d">2</span>);
2126 eve.on(<i>"mouse"</i>, scream);
2127 eve.on(<i>"mouse"</i>, <b>catch</b>)(<span class="d">1</span>);
2128 </code></pre>
2129 <p>This will ensure that <code>catch</code> function will be called before <code>eat</code>.
2130 If you want to put you hadler before not indexed handlers specify negative value.
2131 Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
2132 </p>
2133 </div><div class="extra"></div></div><div class="eve.stop-section"><h3 id="eve.stop" class="dr-method"><i class="dr-trixie">&#160;</i>eve.stop()<a href="#eve.stop" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 181 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L181">&#x27ad;</a></h3>
2134 <div class="dr-method"><p>Is used inside event handler to stop event
2135 </p>
2136 </div><div class="extra"></div></div><div class="eve.unbind-section"><h3 id="eve.unbind" class="dr-method"><i class="dr-trixie">&#160;</i>eve.unbind(name, f)<a href="#eve.unbind" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 215 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L215">&#x27ad;</a></h3>
2137 <div class="dr-method"><p>Removes given function from the list of event listeners assigned to given name.
2138 </p>
2139 <p class="header">Arguments
2140 </p>
2141 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2142 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2143 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2144 <dt class="dr-param">f</dt>
2145 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2146 <dd class="dr-description">event handler function</dd>
2147 </dl>
2148 </div><div class="extra"></div></div><div class="eve.version-section"><h3 id="eve.version" class="dr-property"><i class="dr-trixie">&#160;</i>eve.version<a href="#eve.version" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 272 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L272">&#x27ad;</a></h3>
2149 <div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Current version of the library.
2150 </p>
2151 </div><div class="extra"></div></div></div></div></body></html>