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.path" class="dr-method"><span>Element.path()</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.clear" class="dr-method"><span>Set.clear()</span></a></li><li class="dr-lvl1"><a href="#Set.exclude" class="dr-method"><span>Set.exclude()</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-lvl1"><a href="#Set.splice" class="dr-method"><span>Set.splice()</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 3645 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3645">&#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 3663 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3663">&#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 3933 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3933">&#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 3556 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3556">&#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">element</dt>
58 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
59 <dd class="dr-description">element to sync with</dd>
60 <dt class="dr-param">anim</dt>
61 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
62 <dd class="dr-description">animation to sync with</dd>
63 <dt class="dr-param optional">params</dt>
64 <dd class="dr-optional">optional</dd>
65 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
66 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
67 <dt class="dr-param optional">ms</dt>
68 <dd class="dr-optional">optional</dd>
69 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
70 <dd class="dr-description">number of milliseconds for animation to run</dd>
71 <dt class="dr-param optional">easing</dt>
72 <dd class="dr-optional">optional</dd>
73 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
74 <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>
75 <dt class="dr-param optional">callback</dt>
76 <dd class="dr-optional">optional</dd>
77 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
78 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
79 </dl>
80 <p>or
81 </p>
82 <dl class="dr-parameters"><dt class="dr-param">element</dt>
83 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
84 <dd class="dr-description">element to sync with</dd>
85 <dt class="dr-param">anim</dt>
86 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
87 <dd class="dr-description">animation to sync with</dd>
88 <dt class="dr-param optional">animation</dt>
89 <dd class="dr-optional">optional</dd>
90 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
91 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
92 </dl>
93 <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>
94 </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 1009 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1009">&#x27ad;</a></h3>
95 <div class="dr-method"><p>Sets the attributes of the element.
96 </p>
97 <p class="header">Parameters
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 <dt class="dr-param">value</dt>
103 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
104 <dd class="dr-description">value</dd>
105 </dl>
106 <p>or
107 </p>
108 <dl class="dr-parameters"><dt class="dr-param">params</dt>
109 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
110 <dd class="dr-description">object of name/value pairs</dd>
111 </dl>
112 <p>or
113 </p>
114 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
115 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
116 <dd class="dr-description">attribute’s name</dd>
117 </dl>
118 <p>or
119 </p>
120 <dl class="dr-parameters"><dt class="dr-param">attrNames</dt>
121 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
122 <dd class="dr-description">in this case method returns array of current values for given attribute names</dd>
123 </dl>
124 <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>
125 <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>
126 <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>
127 <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>
128 <p class="header">Possible parameters
129 </p>
130 <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>
131 <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>
132 <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>
133 <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>
134 <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>
135 <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>
136 <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>
137 <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>
138 <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>
139 <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>
140 <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>
141 <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>
142 <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>
143 <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>
144 <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>
145 <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>
146 <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>
147 <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>
148 <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>
149 <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>
150 <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>
151 <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>
152 <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>
153 <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>
154 <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>
155 <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>
156 <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>
157 <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>
158 <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>
159 <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>
160 <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>
161 <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>
162 <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>
163 <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>
164 <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>
165 </ol>
166 <p class="header">Gradients
167 <p>Linear gradient format: “<code>‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>90-#fff-#000</code>” – 90°
168 gradient from white to black or “<code>0-#fff-#f00:20-#000</code>” – 0° gradient from white via red (at 20%) to black.
169 </p>
170 <p>radial gradient: “<code>r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>r#fff-#000</code>” –
171 gradient from white to black or “<code>r(0.25, 0.75)#fff-#000</code>” – gradient from white to black with focus point
172 at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
173 </p>
174 <p class="header">Path String
175 </p>
176 <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>
177 <p class="header">Colour Parsing
178 </p>
179 <ul>
180     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
181     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
182     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
183     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
184     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
185     <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200,&nbsp;100,&nbsp;0, .5)</code>”)</li>
186     <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%,&nbsp;175%,&nbsp;0%, 50%)</code>”)</li>
187     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
188     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
189     <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
190     <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>
191     <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
192     <li>hsla(•••, •••, •••, •••) — same as above, but with opacity</li>
193     <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>
194 </ul>
195 </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 2303 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2303">&#x27ad;</a></h3>
196 <div class="dr-method"><p>Adds event handler for click for the element.
197 </p>
198 <p class="header">Parameters
199 </p>
200 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
201 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
202 <dd class="dr-description">handler for the event</dd>
203 </dl>
204 <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>
205 </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 3085 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3085">&#x27ad;</a></h3>
206 <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>
207 </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 2548 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2548">&#x27ad;</a></h3>
208 <div class="dr-method"><p>Adds or retrieves given value asociated with given key.
209 See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
210 </p>
211 <p class="header">Parameters
212 </p>
213 <dl class="dr-parameters"><dt class="dr-param">key</dt>
214 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
215 <dd class="dr-description">key to store data</dd>
216 <dt class="dr-param optional">value</dt>
217 <dd class="dr-optional">optional</dd>
218 <dd class="dr-type"><em class="dr-type-any">any</em></dd>
219 <dd class="dr-description">value to store</dd>
220 </dl>
221 <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>
222 <p>or, if value is not specified:
223 </p>
224 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-any">any</em> <span class="dr-description">value</span></p>
225 <p class="header">Usage
226 </p>
227 <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++) {
228     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>)
229          .attr({fill: <i>"#<span class="d">000</span>"</i>})
230          .data(<i>"i"</i>, i)
231          .click(<b>function</b> () {
232             alert(<b>this</b>.data(<i>"i"</i>));
233          });
234 }
235 </code></pre>
236 </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 2322 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2322">&#x27ad;</a></h3>
237 <div class="dr-method"><p>Adds event handler for double click for the element.
238 </p>
239 <p class="header">Parameters
240 </p>
241 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
242 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
243 <dd class="dr-description">handler for the event</dd>
244 </dl>
245 <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>
246 </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 2640 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2640">&#x27ad;</a></h3>
247 <div class="dr-method"><p>Adds event handlers for drag of the element.
248 </p>
249 <p class="header">Parameters
250 </p>
251 <dl class="dr-parameters"><dt class="dr-param">onmove</dt>
252 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
253 <dd class="dr-description">handler for moving</dd>
254 <dt class="dr-param">onstart</dt>
255 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
256 <dd class="dr-description">handler for drag start</dd>
257 <dt class="dr-param">onend</dt>
258 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
259 <dd class="dr-description">handler for drag end</dd>
260 <dt class="dr-param optional">mcontext</dt>
261 <dd class="dr-optional">optional</dd>
262 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
263 <dd class="dr-description">context for moving handler</dd>
264 <dt class="dr-param optional">scontext</dt>
265 <dd class="dr-optional">optional</dd>
266 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
267 <dd class="dr-description">context for drag start handler</dd>
268 <dt class="dr-param optional">econtext</dt>
269 <dd class="dr-optional">optional</dd>
270 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
271 <dd class="dr-description">context for drag end handler</dd>
272 </dl>
273 <p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start, 
274 <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 
275 <code>drag.over.&lt;id></code> will be fired as well.
276 </p>
277 <p>Start event and start handler will be called in specified context or in context of the element with following parameters:
278 </p>
279 <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>
280 <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>
281 <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>
282 </ol>
283 <p>Move event and move handler will be called in specified context or in context of the element with following parameters:
284 </p>
285 <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>
286 <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>
287 <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>
288 <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>
289 <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>
290 </ol>
291 <p>End event and end handler will be called in specified context or in context of the element with following parameters:
292 </p>
293 <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>
294 </ol>
295 <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>
296 </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 3053 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3053">&#x27ad;</a></h3>
297 <div class="dr-method"><p>Return bounding box for a given element
298 </p>
299 <p class="header">Parameters
300 </p>
301 <dl class="dr-parameters"><dt class="dr-param">isWithoutTransform</dt>
302 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
303 <dd class="dr-description">flag, <code>true</code> if you want to have bounding box before transformations. Default is <code>false</code>.</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">Bounding box object:</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">top left corner x</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">top left corner y</span>
308 <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>
309 <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>
310 </ol></li><li>}</li></ol>
311 </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 3303 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3303">&#x27ad;</a></h3>
312 <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.
313 </p>
314 <p class="header">Parameters
315 </p>
316 <dl class="dr-parameters"><dt class="dr-param">length</dt>
317 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
318 <dd class="dr-description">&#160;</dd>
319 </dl>
320 <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>
321 <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>
322 <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>
323 <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>
324 </ol></li><li>}</li></ol>
325 </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 3320 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3320">&#x27ad;</a></h3>
326 <div class="dr-method"><p>Return subpath of a given element from given length to given length. Only works for element of “path” type.
327 </p>
328 <p class="header">Parameters
329 </p>
330 <dl class="dr-parameters"><dt class="dr-param">from</dt>
331 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
332 <dd class="dr-description">position of the start of the segment</dd>
333 <dt class="dr-param">to</dt>
334 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
335 <dd class="dr-description">position of the end of the segment</dd>
336 </dl>
337 <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>
338 </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 3279 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3279">&#x27ad;</a></h3>
339 <div class="dr-method"><p>Returns length of the path in pixels. Only works for element of “path” type.
340 </p>
341 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
342 </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 3112 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3112">&#x27ad;</a></h3>
343 <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>.
344 </p>
345 <p>Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself.
346 </p>
347 <p class="header">Parameters
348 </p>
349 <dl class="dr-parameters"><dt class="dr-param optional">glow</dt>
350 <dd class="dr-optional">optional</dd>
351 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
352 <dd class="dr-description">parameters object with all properties optional:</dd>
353 </dl>
354 <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>
355 <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>
356 <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>
357 <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>
358 <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>
359 <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>
360 </ol></li><li>}</li></ol>
361 <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>
362 </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 879 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L879">&#x27ad;</a></h3>
363 <div class="dr-method"><p>Makes element invisible. See <a href="#Element.show" class="dr-link">Element.show</a>.
364 </p>
365 <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>
366 </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 2594 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2594">&#x27ad;</a></h3>
367 <div class="dr-method"><p>Adds event handlers for hover for the element.
368 </p>
369 <p class="header">Parameters
370 </p>
371 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
372 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
373 <dd class="dr-description">handler for hover in</dd>
374 <dt class="dr-param">f_out</dt>
375 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
376 <dd class="dr-description">handler for hover out</dd>
377 <dt class="dr-param optional">icontext</dt>
378 <dd class="dr-optional">optional</dd>
379 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
380 <dd class="dr-description">context for hover in handler</dd>
381 <dt class="dr-param optional">ocontext</dt>
382 <dd class="dr-optional">optional</dd>
383 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
384 <dd class="dr-description">context for hover out handler</dd>
385 </dl>
386 <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>
387 </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 637 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L637">&#x27ad;</a></h3>
388 <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, 
389 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.
390 </p>
391 </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 1107 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1107">&#x27ad;</a></h3>
392 <div class="dr-method"><p>Inserts current object after the given one.
393 </p>
394 <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>
395 </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 1127 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1127">&#x27ad;</a></h3>
396 <div class="dr-method"><p>Inserts current object before the given one.
397 </p>
398 <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>
399 </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 2341 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2341">&#x27ad;</a></h3>
400 <div class="dr-method"><p>Adds event handler for mousedown for the element.
401 </p>
402 <p class="header">Parameters
403 </p>
404 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
405 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
406 <dd class="dr-description">handler for the event</dd>
407 </dl>
408 <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>
409 </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 2360 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2360">&#x27ad;</a></h3>
410 <div class="dr-method"><p>Adds event handler for mousemove for the element.
411 </p>
412 <p class="header">Parameters
413 </p>
414 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
415 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
416 <dd class="dr-description">handler for the event</dd>
417 </dl>
418 <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>
419 </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 2379 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2379">&#x27ad;</a></h3>
420 <div class="dr-method"><p>Adds event handler for mouseout for the element.
421 </p>
422 <p class="header">Parameters
423 </p>
424 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
425 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
426 <dd class="dr-description">handler for the event</dd>
427 </dl>
428 <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>
429 </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 2398 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2398">&#x27ad;</a></h3>
430 <div class="dr-method"><p>Adds event handler for mouseover for the element.
431 </p>
432 <p class="header">Parameters
433 </p>
434 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
435 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
436 <dd class="dr-description">handler for the event</dd>
437 </dl>
438 <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>
439 </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 2417 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2417">&#x27ad;</a></h3>
440 <div class="dr-method"><p>Adds event handler for mouseup for the element.
441 </p>
442 <p class="header">Parameters
443 </p>
444 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
445 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
446 <dd class="dr-description">handler for the event</dd>
447 </dl>
448 <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>
449 </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 680 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L680">&#x27ad;</a></h3>
450 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the next element in the hierarchy.
451 </p>
452 </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 616 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L616">&#x27ad;</a></h3>
453 <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.
454 Note: Don’t mess with it.
455 </p>
456 <p class="header">Usage
457 </p>
458 <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>
459 <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>);
460 c.node.onclick<span class="s"> = </span><b>function</b> () {
461     c.attr(<i>"fill"</i>, <i>"red"</i>);
462 };
463 </code></pre>
464 </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 2667 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2667">&#x27ad;</a></h3>
465 <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>).
466 </p>
467 <p class="header">Parameters
468 </p>
469 <dl class="dr-parameters"><dt class="dr-param">f</dt>
470 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
471 <dd class="dr-description">handler for event</dd>
472 </dl>
473 </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 653 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L653">&#x27ad;</a></h3>
474 <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.
475 </p>
476 <p class="header">Usage
477 </p>
478 <pre class="javascript code"><code>Raphael.el.cross<span class="s"> = </span><b>function</b> () {
479     <b>this</b>.attr({fill: <i>"red"</i>});
480     <b>this</b>.paper.path(<i>"M10,10L50,50M50,10L10,<span class="d">50</span>"</i>)
481         .attr({stroke: <i>"red"</i>});
482 }
483 </code></pre>
484 </div><div class="extra"></div></div><div class="Element.path-section"><h3 id="Element.path" class="dr-method"><i class="dr-trixie">&#160;</i>Element.path([pathString])<a href="#Element.path" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 717 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L717">&#x27ad;</a></h3>
485 <div class="dr-method"><p>Creates a path element by given path data string.
486 </p>
487 <p class="header">Parameters
488 </p>
489 <dl class="dr-parameters"><dt class="dr-param optional">pathString</dt>
490 <dd class="dr-optional">optional</dd>
491 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
492 <dd class="dr-description">path string in SVG format.</dd>
493 </dl>
494 <p>Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example:
495 </p>
496 <pre class="javascript code"><code><i>"M10,20L30,<span class="d">40</span>"</i>
497 </code></pre>
498 <p>Here we can see two commands: “M”, with arguments <code>(10, 20)</code> and “L” with arguments <code>(30, 40)</code>. Upper case letter mean command is absolute, lower case—relative.
499 </p>
500 <p></p>
501 </p>
502 <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
503 <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
504 <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
505 <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
506 <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
507 <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
508 <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
509 <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
510 <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
511 <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
512 <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
513 <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
514 <p>* “Catmull-Rom curveto” is a not standard SVG command and added in 2.0 to make life easier.
515 </p>
516 <p class="header">Usage
517 </p>
518 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.path(<i>"M10 10L90 <span class="d">90</span>"</i>);
519 <span class="c">// draw a diagonal line:</span>
520 <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>
521 </code></pre>
522 </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 4026 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4026">&#x27ad;</a></h3>
523 <div class="dr-method"><p>Stops animation of the element with ability to resume it later on.
524 </p>
525 <p class="header">Parameters
526 </p>
527 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
528 <dd class="dr-optional">optional</dd>
529 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
530 <dd class="dr-description">animation object</dd>
531 </dl>
532 <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>
533 </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 671 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L671">&#x27ad;</a></h3>
534 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the previous element in the hierarchy.
535 </p>
536 </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 629 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L629">&#x27ad;</a></h3>
537 <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.
538 </p>
539 <p class="header">Usage
540 </p>
541 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
542     <b>var</b> hsb<span class="s"> = </span><b>this</b>.paper.raphael.rgb2hsb(<b>this</b>.attr(<i>"fill"</i>));
543     hsb.h<span class="s"> = </span><span class="d">1</span>;
544     <b>this</b>.attr({fill: <b>this</b>.paper.raphael.hsb2rgb(hsb).hex});
545 }
546 </code></pre>
547 </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 900 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L900">&#x27ad;</a></h3>
548 <div class="dr-method"><p>Removes element form the paper.
549 </p>
550 </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 2574 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2574">&#x27ad;</a></h3>
551 <div class="dr-method"><p>Removes value associated with an element by given key.
552 If key is not provided, removes all the data of the element.
553 </p>
554 <p class="header">Parameters
555 </p>
556 <dl class="dr-parameters"><dt class="dr-param optional">key</dt>
557 <dd class="dr-optional">optional</dd>
558 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
559 <dd class="dr-description">key</dd>
560 </dl>
561 <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>
562 </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 4046 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4046">&#x27ad;</a></h3>
563 <div class="dr-method"><p>Resumes animation if it was paused with <a href="#Element.pause" class="dr-link">Element.pause</a> method.
564 </p>
565 <p class="header">Parameters
566 </p>
567 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
568 <dd class="dr-optional">optional</dd>
569 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
570 <dd class="dr-description">animation object</dd>
571 </dl>
572 <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>
573 </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 742 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L742">&#x27ad;</a></h3>
574 <div class="dr-method"><p>Adds rotation by given angle around given point to the list of
575 transformations of the element.
576 </p>
577 <p class="header">Parameters
578 </p>
579 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
580 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
581 <dd class="dr-description">angle in degrees</dd>
582 <dt class="dr-param optional">cx</dt>
583 <dd class="dr-optional">optional</dd>
584 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
585 <dd class="dr-description">x coordinate of the centre of rotation</dd>
586 <dt class="dr-param optional">cy</dt>
587 <dd class="dr-optional">optional</dd>
588 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
589 <dd class="dr-description">y coordinate of the centre of rotation</dd>
590 </dl>
591 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used as a point of rotation.
592 </p>
593 <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>
594 </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 775 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L775">&#x27ad;</a></h3>
595 <div class="dr-method"><p>Adds scale by given amount relative to given point to the list of
596 transformations of the element.
597 </p>
598 <p class="header">Parameters
599 </p>
600 <dl class="dr-parameters"><dt class="dr-param">sx</dt>
601 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
602 <dd class="dr-description">horisontal scale amount</dd>
603 <dt class="dr-param">sy</dt>
604 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
605 <dd class="dr-description">vertical scale amount</dd>
606 <dt class="dr-param optional">cx</dt>
607 <dd class="dr-optional">optional</dd>
608 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
609 <dd class="dr-description">x coordinate of the centre of scale</dd>
610 <dt class="dr-param optional">cy</dt>
611 <dd class="dr-optional">optional</dd>
612 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
613 <dd class="dr-description">y coordinate of the centre of scale</dd>
614 </dl>
615 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used instead.
616 </p>
617 <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>
618 </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 3959 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3959">&#x27ad;</a></h3>
619 <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.
620 </p>
621 <p class="header">Parameters
622 </p>
623 <dl class="dr-parameters"><dt class="dr-param">anim</dt>
624 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
625 <dd class="dr-description">animation object</dd>
626 <dt class="dr-param">value</dt>
627 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
628 <dd class="dr-description">number of milliseconds from the beginning of the animation</dd>
629 </dl>
630 <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>
631 <p>Note, that during animation following events are triggered:
632 </p>
633 <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>.
634 </p>
635 </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 890 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L890">&#x27ad;</a></h3>
636 <div class="dr-method"><p>Makes element visible. See <a href="#Element.hide" class="dr-link">Element.hide</a>.
637 </p>
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.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 3986 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3986">&#x27ad;</a></h3>
640 <div class="dr-method"><p>Gets or sets the status of animation of the element.
641 </p>
642 <p class="header">Parameters
643 </p>
644 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
645 <dd class="dr-optional">optional</dd>
646 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
647 <dd class="dr-description">animation object</dd>
648 <dt class="dr-param optional">value</dt>
649 <dd class="dr-optional">optional</dd>
650 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
651 <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>
652 </dl>
653 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">status</span></p>
654 <p>or
655 </p>
656 <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>
657 <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>
658 <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>
659 </ol></li><li>}</li></ol>
660 <p>or
661 </p>
662 <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>
663 </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 4068 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4068">&#x27ad;</a></h3>
664 <div class="dr-method"><p>Stops animation of the element.
665 </p>
666 <p class="header">Parameters
667 </p>
668 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
669 <dd class="dr-optional">optional</dd>
670 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
671 <dd class="dr-description">animation object</dd>
672 </dl>
673 <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>
674 </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 1089 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1089">&#x27ad;</a></h3>
675 <div class="dr-method"><p>Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
676 </p>
677 <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>
678 </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 1073 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1073">&#x27ad;</a></h3>
679 <div class="dr-method"><p>Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
680 </p>
681 <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>
682 </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 2493 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2493">&#x27ad;</a></h3>
683 <div class="dr-method"><p>Adds event handler for touchcancel for the element.
684 </p>
685 <p class="header">Parameters
686 </p>
687 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
688 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
689 <dd class="dr-description">handler for the event</dd>
690 </dl>
691 <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>
692 </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 2474 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2474">&#x27ad;</a></h3>
693 <div class="dr-method"><p>Adds event handler for touchend for the element.
694 </p>
695 <p class="header">Parameters
696 </p>
697 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
698 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
699 <dd class="dr-description">handler for the event</dd>
700 </dl>
701 <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>
702 </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 2455 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2455">&#x27ad;</a></h3>
703 <div class="dr-method"><p>Adds event handler for touchmove for the element.
704 </p>
705 <p class="header">Parameters
706 </p>
707 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
708 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
709 <dd class="dr-description">handler for the event</dd>
710 </dl>
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.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 2436 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2436">&#x27ad;</a></h3>
713 <div class="dr-method"><p>Adds event handler for touchstart for the element.
714 </p>
715 <p class="header">Parameters
716 </p>
717 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
718 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
719 <dd class="dr-description">handler for the event</dd>
720 </dl>
721 <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>
722 </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 854 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L854">&#x27ad;</a></h3>
723 <div class="dr-method"><p>Adds transformation to the element which is separate to other attributes,
724 i.e. translation doesn’t change <code>x</code> or <code>y</code> of the rectange. The format
725 of transformation string is similar to the path string syntax:
726 </p>
727 <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>
728 </code></pre>
729 <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
730 scale and <code>m</code> is for matrix.
731 </p>
732 <p>So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100;
733 rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin
734 coordinates as optional parameters, the default is the centre point of the element.
735 Matrix accepts six parameters.
736 </p>
737 <p class="header">Usage
738 </p>
739 <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>);
740 <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>
741 el.transform(<i>"t100,100r45t-<span class="d">100</span>,<span class="d">0</span>"</i>);
742 <span class="c">// <b>if</b> you want you can append or prepend transformations</span>
743 el.transform(<i>"...t50,<span class="d">50</span>"</i>);
744 el.transform(<i>"s2..."</i>);
745 <span class="c">// or even wrap</span>
746 el.transform(<i>"t50,<span class="d">50</span>...t-<span class="d">50</span>-<span class="d">50</span>"</i>);
747 <span class="c">// to reset transformation call method <b>with</b> empty string</span>
748 el.transform(<i>""</i>);
749 <span class="c">// to get current value call it without parameters</span>
750 console.log(el.transform());
751 </code></pre>
752 <p class="header">Parameters
753 </p>
754 <dl class="dr-parameters"><dt class="dr-param optional">tstr</dt>
755 <dd class="dr-optional">optional</dd>
756 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
757 <dd class="dr-description">transformation string</dd>
758 </dl>
759 <p>If tstr isn’t specified
760 </p>
761 <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>
762 <p>else
763 </p>
764 <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>
765 </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 806 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L806">&#x27ad;</a></h3>
766 <div class="dr-method"><p>Adds translation by given amount to the list of transformations of the element.
767 </p>
768 <p class="header">Parameters
769 </p>
770 <dl class="dr-parameters"><dt class="dr-param">dx</dt>
771 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
772 <dd class="dr-description">horisontal shift</dd>
773 <dt class="dr-param">dy</dt>
774 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
775 <dd class="dr-description">vertical shift</dd>
776 </dl>
777 <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>
778 </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 2312 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2312">&#x27ad;</a></h3>
779 <div class="dr-method"><p>Removes event handler for click for the element.
780 </p>
781 <p class="header">Parameters
782 </p>
783 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
784 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
785 <dd class="dr-description">handler for the event</dd>
786 </dl>
787 <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>
788 </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 2331 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2331">&#x27ad;</a></h3>
789 <div class="dr-method"><p>Removes event handler for double click for the element.
790 </p>
791 <p class="header">Parameters
792 </p>
793 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
794 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
795 <dd class="dr-description">handler for the event</dd>
796 </dl>
797 <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>
798 </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 2676 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2676">&#x27ad;</a></h3>
799 <div class="dr-method"><p>Removes all drag event handlers from given element.
800 </p>
801 </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 2607 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2607">&#x27ad;</a></h3>
802 <div class="dr-method"><p>Removes event handlers for hover for the element.
803 </p>
804 <p class="header">Parameters
805 </p>
806 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
807 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
808 <dd class="dr-description">handler for hover in</dd>
809 <dt class="dr-param">f_out</dt>
810 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
811 <dd class="dr-description">handler for hover out</dd>
812 </dl>
813 <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>
814 </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 2350 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2350">&#x27ad;</a></h3>
815 <div class="dr-method"><p>Removes event handler for mousedown for the element.
816 </p>
817 <p class="header">Parameters
818 </p>
819 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
820 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
821 <dd class="dr-description">handler for the event</dd>
822 </dl>
823 <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>
824 </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 2369 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2369">&#x27ad;</a></h3>
825 <div class="dr-method"><p>Removes event handler for mousemove for the element.
826 </p>
827 <p class="header">Parameters
828 </p>
829 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
830 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
831 <dd class="dr-description">handler for the event</dd>
832 </dl>
833 <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>
834 </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 2388 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2388">&#x27ad;</a></h3>
835 <div class="dr-method"><p>Removes event handler for mouseout for the element.
836 </p>
837 <p class="header">Parameters
838 </p>
839 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
840 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
841 <dd class="dr-description">handler for the event</dd>
842 </dl>
843 <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>
844 </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 2407 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2407">&#x27ad;</a></h3>
845 <div class="dr-method"><p>Removes event handler for mouseover for the element.
846 </p>
847 <p class="header">Parameters
848 </p>
849 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
850 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
851 <dd class="dr-description">handler for the event</dd>
852 </dl>
853 <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>
854 </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 2426 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2426">&#x27ad;</a></h3>
855 <div class="dr-method"><p>Removes event handler for mouseup for the element.
856 </p>
857 <p class="header">Parameters
858 </p>
859 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
860 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
861 <dd class="dr-description">handler for the event</dd>
862 </dl>
863 <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>
864 </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 2502 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2502">&#x27ad;</a></h3>
865 <div class="dr-method"><p>Removes event handler for touchcancel for the element.
866 </p>
867 <p class="header">Parameters
868 </p>
869 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
870 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
871 <dd class="dr-description">handler for the event</dd>
872 </dl>
873 <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>
874 </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 2483 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2483">&#x27ad;</a></h3>
875 <div class="dr-method"><p>Removes event handler for touchend for the element.
876 </p>
877 <p class="header">Parameters
878 </p>
879 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
880 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
881 <dd class="dr-description">handler for the event</dd>
882 </dl>
883 <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>
884 </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 2464 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2464">&#x27ad;</a></h3>
885 <div class="dr-method"><p>Removes event handler for touchmove for the element.
886 </p>
887 <p class="header">Parameters
888 </p>
889 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
890 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
891 <dd class="dr-description">handler for the event</dd>
892 </dl>
893 <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>
894 </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 2445 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2445">&#x27ad;</a></h3>
895 <div class="dr-method"><p>Removes event handler for touchstart for the element.
896 </p>
897 <p class="header">Parameters
898 </p>
899 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
900 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
901 <dd class="dr-description">handler for the event</dd>
902 </dl>
903 <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>
904 </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>
905 <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 1933 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1933">&#x27ad;</a></h3>
906 <div class="dr-method"><p>Adds given matrix to existing one.
907 </p>
908 <p class="header">Parameters
909 </p>
910 <dl class="dr-parameters"><dt class="dr-param">a</dt>
911 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
912 <dd class="dr-description">&#160;</dd>
913 <dt class="dr-param">b</dt>
914 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
915 <dd class="dr-description">&#160;</dd>
916 <dt class="dr-param">c</dt>
917 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
918 <dd class="dr-description">&#160;</dd>
919 <dt class="dr-param">d</dt>
920 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
921 <dd class="dr-description">&#160;</dd>
922 <dt class="dr-param">e</dt>
923 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
924 <dd class="dr-description">&#160;</dd>
925 <dt class="dr-param">f</dt>
926 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
927 <dd class="dr-description">&#160;</dd>
928 <dt class="dr-param">matrix</dt>
929 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
930 <dd class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></dd>
931 </dl>
932 </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 1978 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1978">&#x27ad;</a></h3>
933 <div class="dr-method"><p>Returns copy of the matrix
934 </p>
935 <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>
936 </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 1966 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1966">&#x27ad;</a></h3>
937 <div class="dr-method"><p>Returns inverted version of the matrix
938 </p>
939 <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>
940 </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 2020 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2020">&#x27ad;</a></h3>
941 <div class="dr-method"><p>Rotates the matrix
942 </p>
943 <p class="header">Parameters
944 </p>
945 <dl class="dr-parameters"><dt class="dr-param">a</dt>
946 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
947 <dd class="dr-description">&#160;</dd>
948 <dt class="dr-param">x</dt>
949 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
950 <dd class="dr-description">&#160;</dd>
951 <dt class="dr-param">y</dt>
952 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
953 <dd class="dr-description">&#160;</dd>
954 </dl>
955 </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 2004 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2004">&#x27ad;</a></h3>
956 <div class="dr-method"><p>Scales the matrix
957 </p>
958 <p class="header">Parameters
959 </p>
960 <dl class="dr-parameters"><dt class="dr-param">x</dt>
961 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
962 <dd class="dr-description">&#160;</dd>
963 <dt class="dr-param optional">y</dt>
964 <dd class="dr-optional">optional</dd>
965 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
966 <dd class="dr-description">&#160;</dd>
967 <dt class="dr-param optional">cx</dt>
968 <dd class="dr-optional">optional</dd>
969 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
970 <dd class="dr-description">&#160;</dd>
971 <dt class="dr-param optional">cy</dt>
972 <dd class="dr-optional">optional</dd>
973 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
974 <dd class="dr-description">&#160;</dd>
975 </dl>
976 </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 2093 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2093">&#x27ad;</a></h3>
977 <div class="dr-method"><p>Splits matrix into primitive transformations
978 </p>
979 <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>
980 <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>
981 <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>
982 <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>
983 <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>
984 <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>
985 <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>
986 <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>
987 </ol>
988 </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 2135 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2135">&#x27ad;</a></h3>
989 <div class="dr-method"><p>Return transform string that represents given matrix
990 </p>
991 <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>
992 </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 1990 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1990">&#x27ad;</a></h3>
993 <div class="dr-method"><p>Translate the matrix
994 </p>
995 <p class="header">Parameters
996 </p>
997 <dl class="dr-parameters"><dt class="dr-param">x</dt>
998 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
999 <dd class="dr-description">&#160;</dd>
1000 <dt class="dr-param">y</dt>
1001 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1002 <dd class="dr-description">&#160;</dd>
1003 </dl>
1004 </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 2039 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2039">&#x27ad;</a></h3>
1005 <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>
1006 </p>
1007 <p class="header">Parameters
1008 </p>
1009 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1010 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1011 <dd class="dr-description">&#160;</dd>
1012 <dt class="dr-param">y</dt>
1013 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1014 <dd class="dr-description">&#160;</dd>
1015 </dl>
1016 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">x</span></p>
1017 </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 2052 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2052">&#x27ad;</a></h3>
1018 <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>
1019 </p>
1020 <p class="header">Parameters
1021 </p>
1022 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1023 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1024 <dd class="dr-description">&#160;</dd>
1025 <dt class="dr-param">y</dt>
1026 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1027 <dd class="dr-description">&#160;</dd>
1028 </dl>
1029 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">y</span></p>
1030 </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>
1031 <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 2925 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2925">&#x27ad;</a></h3>
1032 <div class="dr-property"><p>Points to the bottom element on the paper
1033 </p>
1034 </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 2701 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2701">&#x27ad;</a></h3>
1035 <div class="dr-method"><p>Draws a circle.
1036 </p>
1037 <p class="header">Parameters
1038 </p>
1039 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1040 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1041 <dd class="dr-description">x coordinate of the centre</dd>
1042 <dt class="dr-param">y</dt>
1043 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1044 <dd class="dr-description">y coordinate of the centre</dd>
1045 <dt class="dr-param">r</dt>
1046 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1047 <dd class="dr-description">radius</dd>
1048 </dl>
1049 <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>
1050 <p class="header">Usage
1051 </p>
1052 <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>);
1053 </code></pre>
1054 </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 1333 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1333">&#x27ad;</a></h3>
1055 <div class="dr-method"><p>Clears the paper, i.e. removes all the elements.
1056 </p>
1057 </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 361 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L361">&#x27ad;</a></h3>
1058 <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
1059 as a function of some number you can do it easily with custom attributes:
1060 </p>
1061 <p class="header">Usage
1062 </p>
1063 <pre class="javascript code"><code>paper.customAttributes.hue<span class="s"> = </span><b>function</b> (num) {
1064     num<span class="s"> = </span>num<span class="s"> % </span><span class="d">1</span>;
1065     <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>};
1066 };
1067 <span class="c">// Custom attribute “hue” will change fill</span>
1068 <span class="c">// to be given hue <b>with</b> fixed saturation and brightness.</span>
1069 <span class="c">// Now you can use it like <b>this</b>:</span>
1070 <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>});
1071 <span class="c">// or even like <b>this</b>:</span>
1072 c.animate({hue: <span class="d">1</span>}, <span class="d">1e3</span>);
1073
1074 <span class="c">// You could also create custom attribute</span>
1075 <span class="c">// <b>with</b> multiple parameters:</span>
1076 paper.customAttributes.hsb<span class="s"> = </span><b>function</b> (h, s, b) {
1077     <b>return</b> {fill: <i>"hsb("</i><span class="s"> + </span>[h, s, b].join(<i>","</i>)<span class="s"> + </span><i>")"</i>};
1078 };
1079 c.attr({hsb: <i>"<span class="d">.5</span> <span class="d">.8</span> <span class="d">1</span>"</i>});
1080 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>);
1081 </code></pre>
1082 </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 2749 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2749">&#x27ad;</a></h3>
1083 <div class="dr-method"><p>Draws an ellipse.
1084 </p>
1085 <p class="header">Parameters
1086 </p>
1087 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1088 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1089 <dd class="dr-description">x coordinate of the centre</dd>
1090 <dt class="dr-param">y</dt>
1091 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1092 <dd class="dr-description">y coordinate of the centre</dd>
1093 <dt class="dr-param">rx</dt>
1094 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1095 <dd class="dr-description">horizontal radius</dd>
1096 <dt class="dr-param">ry</dt>
1097 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1098 <dd class="dr-description">vertical radius</dd>
1099 </dl>
1100 <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>
1101 <p class="header">Usage
1102 </p>
1103 <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>);
1104 </code></pre>
1105 </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 3020 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3020">&#x27ad;</a></h3>
1106 <div class="dr-method"><p>Executes given function for each element on the paper
1107 </p>
1108 <p>If callback function returns <code>false</code> it will stop loop running.
1109 </p>
1110 <p class="header">Parameters
1111 </p>
1112 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
1113 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1114 <dd class="dr-description">function to run</dd>
1115 <dt class="dr-param">thisArg</dt>
1116 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1117 <dd class="dr-description">context object for the callback</dd>
1118 </dl>
1119 <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>
1120 </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 2996 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2996">&#x27ad;</a></h3>
1121 <div class="dr-method"><p>Returns you element by its internal ID.
1122 </p>
1123 <p class="header">Parameters
1124 </p>
1125 <dl class="dr-parameters"><dt class="dr-param">id</dt>
1126 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1127 <dd class="dr-description">id</dd>
1128 </dl>
1129 <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>
1130 </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 2960 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2960">&#x27ad;</a></h3>
1131 <div class="dr-method"><p>Returns you topmost element under given point.
1132 </p>
1133 <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>
1134 <p class="header">Parameters
1135 </p>
1136 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1137 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1138 <dd class="dr-description">x coordinate from the top left corner of the window</dd>
1139 <dt class="dr-param">y</dt>
1140 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1141 <dd class="dr-description">y coordinate from the top left corner of the window</dd>
1142 </dl>
1143 <p class="header">Usage
1144 </p>
1145 <pre class="javascript code"><code>paper.getElementByPoint(mouseX, mouseY).attr({stroke: <i>"#f00"</i>});
1146 </code></pre>
1147 </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 4372 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4372">&#x27ad;</a></h3>
1148 <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”.
1149 </p>
1150 <p class="header">Parameters
1151 </p>
1152 <dl class="dr-parameters"><dt class="dr-param">family</dt>
1153 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1154 <dd class="dr-description">font family name or any word from it</dd>
1155 <dt class="dr-param optional">weight</dt>
1156 <dd class="dr-optional">optional</dd>
1157 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1158 <dd class="dr-description">font weight</dd>
1159 <dt class="dr-param optional">style</dt>
1160 <dd class="dr-optional">optional</dd>
1161 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1162 <dd class="dr-description">font style</dd>
1163 <dt class="dr-param optional">stretch</dt>
1164 <dd class="dr-optional">optional</dd>
1165 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1166 <dd class="dr-description">font stretch</dd>
1167 </dl>
1168 <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>
1169 <p class="header">Usage
1170 </p>
1171 <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>);
1172 </code></pre>
1173 </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 2795 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2795">&#x27ad;</a></h3>
1174 <div class="dr-method"><p>Embeds an image into the surface.
1175 </p>
1176 <p class="header">Parameters
1177 </p>
1178 <dl class="dr-parameters"><dt class="dr-param">src</dt>
1179 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1180 <dd class="dr-description">URI of the source image</dd>
1181 <dt class="dr-param">x</dt>
1182 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1183 <dd class="dr-description">x coordinate position</dd>
1184 <dt class="dr-param">y</dt>
1185 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1186 <dd class="dr-description">y coordinate position</dd>
1187 <dt class="dr-param">width</dt>
1188 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1189 <dd class="dr-description">width of the image</dd>
1190 <dt class="dr-param">height</dt>
1191 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1192 <dd class="dr-description">height of the image</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">Raphaël element object with type “image”</span></p>
1195 <p class="header">Usage
1196 </p>
1197 <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>);
1198 </code></pre>
1199 </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 2771 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2771">&#x27ad;</a></h3>
1200 <div class="dr-method"><p>Creates a path element by given path data string.
1201 </p>
1202 <p class="header">Parameters
1203 </p>
1204 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1205 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1206 <dd class="dr-description">path data in SVG path string format.</dd>
1207 </dl>
1208 <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>
1209 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>.
1210 <p class="header">Usage
1211 </p>
1212 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.path(<i>"M10 10L90 <span class="d">90</span>"</i>);
1213 <span class="c">// draw a diagonal line:</span>
1214 <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>
1215 </code></pre>
1216 </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 4422 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4422">&#x27ad;</a></h3>
1217 <div class="dr-method"><p>Creates set of shapes to represent given font at given position with given size.
1218 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.
1219 </p>
1220 <p class="header">Parameters
1221 </p>
1222 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1223 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1224 <dd class="dr-description">x position of the text</dd>
1225 <dt class="dr-param">y</dt>
1226 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1227 <dd class="dr-description">y position of the text</dd>
1228 <dt class="dr-param">text</dt>
1229 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1230 <dd class="dr-description">text to print</dd>
1231 <dt class="dr-param">font</dt>
1232 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1233 <dd class="dr-description">font object, see <a href="#Paper.getFont" class="dr-link">Paper.getFont</a></dd>
1234 <dt class="dr-param optional">size</dt>
1235 <dd class="dr-optional">optional</dd>
1236 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1237 <dd class="dr-description">size of the font, default is <code>16</code></dd>
1238 <dt class="dr-param optional">origin</dt>
1239 <dd class="dr-optional">optional</dd>
1240 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1241 <dd class="dr-description">could be <code>"baseline"</code> or <code>"middle"</code>, default is <code>"middle"</code></dd>
1242 <dt class="dr-param optional">letter_spacing</dt>
1243 <dd class="dr-optional">optional</dd>
1244 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1245 <dd class="dr-description">number in range <code>-1..1</code>, default is <code>0</code></dd>
1246 </dl>
1247 <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>
1248 <p class="header">Usage
1249 </p>
1250 <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>});
1251 <span class="c">// following line will paint first letter <b>in</b> red</span>
1252 txt[<span class="d">0</span>].attr({fill: <i>"#f00"</i>});
1253 </code></pre>
1254 </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 2932 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2932">&#x27ad;</a></h3>
1255 <div class="dr-property"><p>Points to the <a href="#Raphael" class="dr-link">Raphael</a> object/function
1256 </p>
1257 </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 2727 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2727">&#x27ad;</a></h3>
1258 <div class="dr-method"><p></p>
1259 <p>Draws a rectangle.
1260 </p>
1261 <p class="header">Parameters
1262 </p>
1263 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1264 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1265 <dd class="dr-description">x coordinate of the top left corner</dd>
1266 <dt class="dr-param">y</dt>
1267 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1268 <dd class="dr-description">y coordinate of the top left corner</dd>
1269 <dt class="dr-param">width</dt>
1270 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1271 <dd class="dr-description">width</dd>
1272 <dt class="dr-param">height</dt>
1273 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1274 <dd class="dr-description">height</dd>
1275 <dt class="dr-param optional">r</dt>
1276 <dd class="dr-optional">optional</dd>
1277 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1278 <dd class="dr-description">radius for rounded corners, default is 0</dd>
1279 </dl>
1280 <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>
1281 <p class="header">Usage
1282 </p>
1283 <pre class="javascript code"><code><span class="c">// regular rectangle</span>
1284 <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>);
1285 <span class="c">// rectangle <b>with</b> rounded corners</span>
1286 <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>);
1287 </code></pre>
1288 </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 1350 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1350">&#x27ad;</a></h3>
1289 <div class="dr-method"><p>Removes the paper from the DOM.
1290 </p>
1291 </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 1310 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.svg.js#L1310">&#x27ad;</a></h3>
1292 <div class="dr-method"><p>Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependant
1293 on other elements after reflow it could shift half pixel which cause for lines to lost their crispness.
1294 This method fixes the issue.
1295 </p>
1296 </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 2157 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2157">&#x27ad;</a></h3>
1297 <div class="dr-method"><p>There is an inconvenient rendering bug in Safari (WebKit):
1298 sometimes the rendering should be forced.
1299 This method should help with dealing with this bug.
1300 </p>
1301 </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 2838 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2838">&#x27ad;</a></h3>
1302 <div class="dr-method"><p>Creates array-like object to keep and operate several elements at once.
1303 Warning: it doesn’t create any elements for itself in the page, it just groups existing elements.
1304 Sets act as pseudo elements — all methods available to an element can be used on a set.
1305 </p>
1306 <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>
1307 <p class="header">Usage
1308 </p>
1309 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1310 st.push(
1311     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1312     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1313 );
1314 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1315 </code></pre>
1316 </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 2869 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2869">&#x27ad;</a></h3>
1317 <div class="dr-method"><p>See <a href="#Paper.setStart" class="dr-link">Paper.setStart</a>. This method finishes catching and returns resulting set.
1318 </p>
1319 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">set</span></p>
1320 </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 2892 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2892">&#x27ad;</a></h3>
1321 <div class="dr-method"><p>If you need to change dimensions of the canvas call this method
1322 </p>
1323 <p class="header">Parameters
1324 </p>
1325 <dl class="dr-parameters"><dt class="dr-param">width</dt>
1326 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1327 <dd class="dr-description">new width of the canvas</dd>
1328 <dt class="dr-param">height</dt>
1329 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1330 <dd class="dr-description">new height of the canvas</dd>
1331 </dl>
1332 <p class="header">Usage
1333 </p>
1334 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1335 st.push(
1336     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1337     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1338 );
1339 st.attr({fill: <i>"red"</i>});
1340 </code></pre>
1341 </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 2858 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2858">&#x27ad;</a></h3>
1342 <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
1343 <a href="#Paper.setFinish" class="dr-link">Paper.setFinish</a> will be added to the set.
1344 </p>
1345 <p class="header">Usage
1346 </p>
1347 <pre class="javascript code"><code>paper.setStart();
1348 paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1349 paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1350 <b>var</b> st<span class="s"> = </span>paper.setFinish();
1351 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1352 </code></pre>
1353 </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 2910 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2910">&#x27ad;</a></h3>
1354 <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 
1355 specifying new boundaries.
1356 </p>
1357 <p class="header">Parameters
1358 </p>
1359 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1360 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1361 <dd class="dr-description">new x position, default is <code>0</code></dd>
1362 <dt class="dr-param">y</dt>
1363 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1364 <dd class="dr-description">new y position, default is <code>0</code></dd>
1365 <dt class="dr-param">w</dt>
1366 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1367 <dd class="dr-description">new width of the canvas</dd>
1368 <dt class="dr-param">h</dt>
1369 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1370 <dd class="dr-description">new height of the canvas</dd>
1371 <dt class="dr-param">fit</dt>
1372 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
1373 <dd class="dr-description"><code>true</code> if you want graphics to fit into new boundary box</dd>
1374 </dl>
1375 </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 2816 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2816">&#x27ad;</a></h3>
1376 <div class="dr-method"><p>Draws a text string. If you need line breaks, put “\n” in the string.
1377 </p>
1378 <p class="header">Parameters
1379 </p>
1380 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1381 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1382 <dd class="dr-description">x coordinate position</dd>
1383 <dt class="dr-param">y</dt>
1384 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1385 <dd class="dr-description">y coordinate position</dd>
1386 <dt class="dr-param">text</dt>
1387 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1388 <dd class="dr-description">The text string to draw</dd>
1389 </dl>
1390 <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>
1391 <p class="header">Usage
1392 </p>
1393 <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>);
1394 </code></pre>
1395 </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 2919 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2919">&#x27ad;</a></h3>
1396 <div class="dr-property"><p>Points to the topmost element on the paper
1397 </p>
1398 </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>
1399 <div class="dr-method"><p>Creates a canvas object on which to draw.
1400 You must do this first, as all future calls to drawing methods
1401 from this instance will be bound to this canvas.
1402 </p>
1403 <p class="header">Parameters
1404 </p>
1405 <dl class="dr-parameters"><dt class="dr-param">container</dt>
1406 <dd class="dr-type"><em class="dr-type-HTMLElement">HTMLElement</em> <em class="dr-type-string">string</em></dd>
1407 <dd class="dr-description">DOM element or its ID which is going to be a parent for drawing surface</dd>
1408 <dt class="dr-param">width</dt>
1409 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1410 <dd class="dr-description">&#160;</dd>
1411 <dt class="dr-param">height</dt>
1412 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1413 <dd class="dr-description">&#160;</dd>
1414 <dt class="dr-param optional">callback</dt>
1415 <dd class="dr-optional">optional</dd>
1416 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1417 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1418 </dl>
1419 <p>or
1420 </p>
1421 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1422 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1423 <dd class="dr-description">&#160;</dd>
1424 <dt class="dr-param">y</dt>
1425 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1426 <dd class="dr-description">&#160;</dd>
1427 <dt class="dr-param">width</dt>
1428 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1429 <dd class="dr-description">&#160;</dd>
1430 <dt class="dr-param">height</dt>
1431 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1432 <dd class="dr-description">&#160;</dd>
1433 <dt class="dr-param optional">callback</dt>
1434 <dd class="dr-optional">optional</dd>
1435 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1436 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1437 </dl>
1438 <p>or
1439 </p>
1440 <dl class="dr-parameters"><dt class="dr-param">all</dt>
1441 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
1442 <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>
1443 <dt class="dr-param optional">callback</dt>
1444 <dd class="dr-optional">optional</dd>
1445 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1446 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1447 </dl>
1448 <p>or
1449 </p>
1450 <dl class="dr-parameters"><dt class="dr-param">onReadyCallback</dt>
1451 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1452 <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>
1453 </dl>
1454 <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>
1455 <p class="header">Usage
1456 </p>
1457 <pre class="javascript code"><code><span class="c">// Each of the following examples create a canvas</span>
1458 <span class="c">// that is 320px wide by 200px high.</span>
1459 <span class="c">// Canvas is created at the viewport’s <span class="d">10</span>,<span class="d">50</span> coordinate.</span>
1460 <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>);
1461 <span class="c">// Canvas is created at the top left corner of the #notepad element</span>
1462 <span class="c">// (or its top right corner <b>in</b> dir=<i>"rtl"</i> elements)</span>
1463 <b>var</b> paper<span class="s"> = </span>Raphael(document.getElementById(<i>"notepad"</i>), <span class="d">320</span>, <span class="d">200</span>);
1464 <span class="c">// Same as above</span>
1465 <b>var</b> paper<span class="s"> = </span>Raphael(<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>);
1466 <span class="c">// Image dump</span>
1467 <b>var</b> set<span class="s"> = </span>Raphael([<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>, {
1468     type: <i>"rect"</i>,
1469     x: <span class="d">10</span>,
1470     y: <span class="d">10</span>,
1471     width: <span class="d">25</span>,
1472     height: <span class="d">25</span>,
1473     stroke: <i>"#f00"</i>
1474 }, {
1475     type: <i>"text"</i>,
1476     x: <span class="d">30</span>,
1477     y: <span class="d">40</span>,
1478     text: <i>"Dump"</i>
1479 }]);
1480 </code></pre>
1481 </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 402 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L402">&#x27ad;</a></h3>
1482 <div class="dr-method"><p>Returns angle between two or three points
1483 </p>
1484 <p class="header">Parameters
1485 </p>
1486 <dl class="dr-parameters"><dt class="dr-param">x1</dt>
1487 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1488 <dd class="dr-description">x coord of first point</dd>
1489 <dt class="dr-param">y1</dt>
1490 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1491 <dd class="dr-description">y coord of first point</dd>
1492 <dt class="dr-param">x2</dt>
1493 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1494 <dd class="dr-description">x coord of second point</dd>
1495 <dt class="dr-param">y2</dt>
1496 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1497 <dd class="dr-description">y coord of second point</dd>
1498 <dt class="dr-param optional">x3</dt>
1499 <dd class="dr-optional">optional</dd>
1500 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1501 <dd class="dr-description">x coord of third point</dd>
1502 <dt class="dr-param optional">y3</dt>
1503 <dd class="dr-optional">optional</dd>
1504 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1505 <dd class="dr-description">y coord of third point</dd>
1506 </dl>
1507 <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>
1508 </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 3891 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3891">&#x27ad;</a></h3>
1509 <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.
1510 See also <a href="#Animation.delay" class="dr-link">Animation.delay</a> and <a href="#Animation.repeat" class="dr-link">Animation.repeat</a> methods.
1511 </p>
1512 <p class="header">Parameters
1513 </p>
1514 <dl class="dr-parameters"><dt class="dr-param">params</dt>
1515 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1516 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
1517 <dt class="dr-param">ms</dt>
1518 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1519 <dd class="dr-description">number of milliseconds for animation to run</dd>
1520 <dt class="dr-param optional">easing</dt>
1521 <dd class="dr-optional">optional</dd>
1522 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1523 <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>
1524 <dt class="dr-param optional">callback</dt>
1525 <dd class="dr-optional">optional</dd>
1526 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1527 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
1528 </dl>
1529 <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>
1530 </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 595 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L595">&#x27ad;</a></h3>
1531 <div class="dr-method"><p>Parses the color string and returns object with all values for the given color.
1532 </p>
1533 <p class="header">Parameters
1534 </p>
1535 <dl class="dr-parameters"><dt class="dr-param">clr</dt>
1536 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1537 <dd class="dr-description">color string in one of the supported formats (see <a href="#Raphael.getRGB" class="dr-link">Raphael.getRGB</a>)</dd>
1538 </dl>
1539 <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>
1540 <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>
1541 <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>
1542 <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>
1543 <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>
1544 <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>
1545 <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>
1546 <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>
1547 <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>
1548 <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>
1549 </ol></li><li>}</li></ol>
1550 </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 435 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L435">&#x27ad;</a></h3>
1551 <div class="dr-method"><p>Transform angle to degrees
1552 </p>
1553 <p class="header">Parameters
1554 </p>
1555 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1556 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1557 <dd class="dr-description">angle in radians</dd>
1558 </dl>
1559 <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>
1560 </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 3341 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3341">&#x27ad;</a></h3>
1561 <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:
1562 </p>
1563 <ul>
1564     <li>“linear”</li>
1565     <li>“&lt;” or “easeIn” or “ease-in”</li>
1566     <li>“>” or “easeOut” or “ease-out”</li>
1567     <li>“&lt;>” or “easeInOut” or “ease-in-out”</li>
1568     <li>“backIn” or “back-in”</li>
1569     <li>“backOut” or “back-out”</li>
1570     <li>“elastic”</li>
1571     <li>“bounce”</li>
1572 </ul>
1573 <p>See also <a href="http://raphaeljs.com/easing.html">Easing demo</a>.</p>
1574 </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 2293 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L2293">&#x27ad;</a></h3>
1575 <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
1576 want to wrap some common transformation or attributes in one method. In difference to canvas methods,
1577 you can redefine element method at any time. Expending element methods wouldn’t affect set.
1578 </p>
1579 <p class="header">Usage
1580 </p>
1581 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
1582     <b>this</b>.attr({fill: <i>"#f00"</i>});
1583 };
1584 <span class="c">// then use it</span>
1585 paper.circle(<span class="d">100</span>, <span class="d">100</span>, <span class="d">20</span>).red();
1586 </code></pre>
1587 </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 1136 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1136">&#x27ad;</a></h3>
1588 <div class="dr-method"><p>Utility method
1589 Find dot coordinates on the given cubic bezier curve at the given t.
1590 </p>
1591 <p class="header">Parameters
1592 </p>
1593 <dl class="dr-parameters"><dt class="dr-param">p1x</dt>
1594 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1595 <dd class="dr-description">x of the first point of the curve</dd>
1596 <dt class="dr-param">p1y</dt>
1597 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1598 <dd class="dr-description">y of the first point of the curve</dd>
1599 <dt class="dr-param">c1x</dt>
1600 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1601 <dd class="dr-description">x of the first anchor of the curve</dd>
1602 <dt class="dr-param">c1y</dt>
1603 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1604 <dd class="dr-description">y of the first anchor of the curve</dd>
1605 <dt class="dr-param">c2x</dt>
1606 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1607 <dd class="dr-description">x of the second anchor of the curve</dd>
1608 <dt class="dr-param">c2y</dt>
1609 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1610 <dd class="dr-description">y of the second anchor of the curve</dd>
1611 <dt class="dr-param">p2x</dt>
1612 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1613 <dd class="dr-description">x of the second point of the curve</dd>
1614 <dt class="dr-param">p2y</dt>
1615 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1616 <dd class="dr-description">y of the second point of the curve</dd>
1617 <dt class="dr-param">t</dt>
1618 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1619 <dd class="dr-description">position on the curve (0..1)</dd>
1620 </dl>
1621 <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>
1622 <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>
1623 <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>
1624 <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>
1625 <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>
1626 </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>
1627 <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>
1628 </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>
1629 <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>
1630 </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>
1631 <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>
1632 </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>
1633 </ol></li><li>}</li></ol>
1634 </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 334 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L334">&#x27ad;</a></h3>
1635 <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,
1636 you can create your own pie chart function and ship it as a Raphaël plugin. To do this
1637 you need to extend the <code>Raphael.fn</code> object. Please note that you can create your own namespaces
1638 inside the <code>fn</code> object — methods will be run in the context of canvas anyway. You should alter
1639 the <code>fn</code> object before a Raphaël instance is created, otherwise it will take no effect.
1640 </p>
1641 <p class="header">Usage
1642 </p>
1643 <pre class="javascript code"><code>Raphael.fn.arrow<span class="s"> = </span><b>function</b> (x1, y1, x2, y2, size) {
1644     <b>return</b> <b>this</b>.path( ... );
1645 };
1646 <span class="c">// or create namespace</span>
1647 Raphael.fn.mystuff<span class="s"> = </span>{
1648     arrow: <b>function</b> () {…},
1649     star: <b>function</b> () {…},
1650     <span class="c">// etc…</span>
1651 };
1652 <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>);
1653 <span class="c">// then use it</span>
1654 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>});
1655 paper.mystuff.arrow();
1656 paper.mystuff.star();
1657 </code></pre>
1658 </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 4470 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4470">&#x27ad;</a></h3>
1659 <div class="dr-method"><p>Simple format function. Replaces construction of type “<code>{&lt;number>}</code>” to the corresponding argument.
1660 </p>
1661 <p class="header">Parameters
1662 </p>
1663 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1664 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1665 <dd class="dr-description">string to format</dd>
1666 <dt class="dr-param">…</dt>
1667 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1668 <dd class="dr-description">rest of arguments will be treated as parameters for replacement</dd>
1669 </dl>
1670 <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>
1671 <p class="header">Usage
1672 </p>
1673 <pre class="javascript code"><code><b>var</b> x<span class="s"> = </span><span class="d">10</span>,
1674     y<span class="s"> = </span><span class="d">20</span>,
1675     width<span class="s"> = </span><span class="d">40</span>,
1676     height<span class="s"> = </span><span class="d">50</span>;
1677 <span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1678 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));
1679 </code></pre>
1680 </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 4500 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4500">&#x27ad;</a></h3>
1681 <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.
1682 </p>
1683 <p class="header">Parameters
1684 </p>
1685 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1686 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1687 <dd class="dr-description">string to format</dd>
1688 <dt class="dr-param">json</dt>
1689 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1690 <dd class="dr-description">object which properties will be used as a replacement</dd>
1691 </dl>
1692 <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>
1693 <p class="header">Usage
1694 </p>
1695 <pre class="javascript code"><code><span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1696 paper.path(Raphael.format(<i>"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z"</i>, {
1697     x: <span class="d">10</span>,
1698     y: <span class="d">20</span>,
1699     dim: {
1700         width: <span class="d">40</span>,
1701         height: <span class="d">50</span>,
1702         <i>"negative width"</i>: -<span class="d">40</span>
1703     }
1704 }));
1705 </code></pre>
1706 </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 971 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L971">&#x27ad;</a></h3>
1707 <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>
1708 </p>
1709 <p class="header">Parameters
1710 </p>
1711 <dl class="dr-parameters"><dt class="dr-param optional">value</dt>
1712 <dd class="dr-optional">optional</dd>
1713 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1714 <dd class="dr-description">brightness, default is <code>0.75</code></dd>
1715 </dl>
1716 <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>
1717 </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 988 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L988">&#x27ad;</a></h4>
1718 <div class="dr-method"><p>Resets spectrum position for <a href="#Raphael.getColor" class="dr-link">Raphael.getColor</a> back to red.
1719 </p>
1720 </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 3250 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3250">&#x27ad;</a></h3>
1721 <div class="dr-method"><p>Return coordinates of the point located at the given length on the given path.
1722 </p>
1723 <p class="header">Parameters
1724 </p>
1725 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1726 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1727 <dd class="dr-description">SVG path string</dd>
1728 <dt class="dr-param">length</dt>
1729 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1730 <dd class="dr-description">&#160;</dd>
1731 </dl>
1732 <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>
1733 <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>
1734 <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>
1735 <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>
1736 </ol></li><li>}</li></ol>
1737 </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 849 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L849">&#x27ad;</a></h3>
1738 <div class="dr-method"><p>Parses colour string as RGB object
1739 </p>
1740 <p class="header">Parameters
1741 </p>
1742 <dl class="dr-parameters"><dt class="dr-param">colour</dt>
1743 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1744 <dd class="dr-description">colour string in one of formats:</dd>
1745 </dl>
1746 <ul>
1747     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
1748     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
1749     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
1750     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
1751     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
1752     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
1753     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
1754     <li>hsl(•••, •••, •••) — same as hsb</li>
1755     <li>hsl(•••%, •••%, •••%) — same as hsb</li>
1756 </ul>
1757 <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>
1758 <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>
1759 <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>
1760 <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>
1761 <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>
1762 <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>
1763 </ol></li><li>}</li></ol>
1764 </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 3265 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3265">&#x27ad;</a></h3>
1765 <div class="dr-method"><p>Return subpath of a given path from given length to given length.
1766 </p>
1767 <p class="header">Parameters
1768 </p>
1769 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1770 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1771 <dd class="dr-description">SVG path string</dd>
1772 <dt class="dr-param">from</dt>
1773 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1774 <dd class="dr-description">position of the start of the segment</dd>
1775 <dt class="dr-param">to</dt>
1776 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1777 <dd class="dr-description">position of the end of the segment</dd>
1778 </dl>
1779 <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>
1780 </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 3231 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L3231">&#x27ad;</a></h3>
1781 <div class="dr-method"><p>Returns length of the given path in pixels.
1782 </p>
1783 <p class="header">Parameters
1784 </p>
1785 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1786 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1787 <dd class="dr-description">SVG path string.</dd>
1788 </dl>
1789 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
1790 </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 931 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L931">&#x27ad;</a></h3>
1791 <div class="dr-method"><p>Converts HSB values to hex representation of the colour.
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">b</dt>
1802 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1803 <dd class="dr-description">value or brightness</dd>
1804 </dl>
1805 <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>
1806 </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 645 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L645">&#x27ad;</a></h3>
1807 <div class="dr-method"><p>Converts HSB values to RGB object.
1808 </p>
1809 <p class="header">Parameters
1810 </p>
1811 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1812 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1813 <dd class="dr-description">hue</dd>
1814 <dt class="dr-param">s</dt>
1815 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1816 <dd class="dr-description">saturation</dd>
1817 <dt class="dr-param">v</dt>
1818 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1819 <dd class="dr-description">value or brightness</dd>
1820 </dl>
1821 <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>
1822 <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>
1823 <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>
1824 <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>
1825 <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>
1826 </ol></li><li>}</li></ol>
1827 </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 945 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L945">&#x27ad;</a></h3>
1828 <div class="dr-method"><p>Converts HSL values to hex representation of the colour.
1829 </p>
1830 <p class="header">Parameters
1831 </p>
1832 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1833 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1834 <dd class="dr-description">hue</dd>
1835 <dt class="dr-param">s</dt>
1836 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1837 <dd class="dr-description">saturation</dd>
1838 <dt class="dr-param">l</dt>
1839 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1840 <dd class="dr-description">luminosity</dd>
1841 </dl>
1842 <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>
1843 </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 682 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L682">&#x27ad;</a></h3>
1844 <div class="dr-method"><p>Converts HSL values to RGB object.
1845 </p>
1846 <p class="header">Parameters
1847 </p>
1848 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1849 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1850 <dd class="dr-description">hue</dd>
1851 <dt class="dr-param">s</dt>
1852 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1853 <dd class="dr-description">saturation</dd>
1854 <dt class="dr-param">l</dt>
1855 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1856 <dd class="dr-description">luminosity</dd>
1857 </dl>
1858 <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>
1859 <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>
1860 <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>
1861 <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>
1862 <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>
1863 </ol></li><li>}</li></ol>
1864 </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 374 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L374">&#x27ad;</a></h3>
1865 <div class="dr-method"><p>Handfull replacement for <code>typeof</code> operator.
1866 </p>
1867 <p class="header">Parameters
1868 </p>
1869 <dl class="dr-parameters"><dt class="dr-param">o</dt>
1870 <dd class="dr-type"><em class="dr-type-…">…</em></dd>
1871 <dd class="dr-description">any object or primitive</dd>
1872 <dt class="dr-param">type</dt>
1873 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1874 <dd class="dr-description">name of the type, i.e. “string”, “function”, “number”, etc.</dd>
1875 </dl>
1876 <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>
1877 </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 1897 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1897">&#x27ad;</a></h3>
1878 <div class="dr-method"><p>Utility method
1879 Returns matrix based on given parameters.
1880 </p>
1881 <p class="header">Parameters
1882 </p>
1883 <dl class="dr-parameters"><dt class="dr-param">a</dt>
1884 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1885 <dd class="dr-description">&#160;</dd>
1886 <dt class="dr-param">b</dt>
1887 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1888 <dd class="dr-description">&#160;</dd>
1889 <dt class="dr-param">c</dt>
1890 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1891 <dd class="dr-description">&#160;</dd>
1892 <dt class="dr-param">d</dt>
1893 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1894 <dd class="dr-description">&#160;</dd>
1895 <dt class="dr-param">e</dt>
1896 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1897 <dd class="dr-description">&#160;</dd>
1898 <dt class="dr-param">f</dt>
1899 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1900 <dd class="dr-description">&#160;</dd>
1901 </dl>
1902 <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>
1903 </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 4537 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4537">&#x27ad;</a></h3>
1904 <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.
1905 Beware, that in this case plugins could stop working, because they are depending on global variable existance.
1906 </p>
1907 <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>
1908 <p class="header">Usage
1909 </p>
1910 <pre class="javascript code"><code>(<b>function</b> (local_raphael) {
1911     <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>);
1912     …
1913 })(Raphael.ninja());
1914 </code></pre>
1915 </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 1029 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1029">&#x27ad;</a></h3>
1916 <div class="dr-method"><p>Utility method
1917 Parses given path string into an array of arrays of path segments.
1918 </p>
1919 <p class="header">Parameters
1920 </p>
1921 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1922 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1923 <dd class="dr-description">path string or array of segments (in the last case it will be returned straight away)</dd>
1924 </dl>
1925 <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>
1926 </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 1074 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1074">&#x27ad;</a></h3>
1927 <div class="dr-method"><p>Utility method
1928 Parses given path string into an array of transformations.
1929 </p>
1930 <p class="header">Parameters
1931 </p>
1932 <dl class="dr-parameters"><dt class="dr-param">TString</dt>
1933 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1934 <dd class="dr-description">transform string or array of transformations (in the last case it will be returned straight away)</dd>
1935 </dl>
1936 <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>
1937 </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 1880 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1880">&#x27ad;</a></h3>
1938 <div class="dr-method"><p>Utility method
1939 Converts path to a new path where all segments are cubic bezier curves.
1940 </p>
1941 <p class="header">Parameters
1942 </p>
1943 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1944 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1945 <dd class="dr-description">path string or array of segments</dd>
1946 </dl>
1947 <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>
1948 </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 1867 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L1867">&#x27ad;</a></h3>
1949 <div class="dr-method"><p>Utility method
1950 Converts path to relative form
1951 </p>
1952 <p class="header">Parameters
1953 </p>
1954 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1955 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1956 <dd class="dr-description">path string or array of segments</dd>
1957 </dl>
1958 <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>
1959 </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 423 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L423">&#x27ad;</a></h3>
1960 <div class="dr-method"><p>Transform angle to radians
1961 </p>
1962 <p class="header">Parameters
1963 </p>
1964 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1965 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1966 <dd class="dr-description">angle in degrees</dd>
1967 </dl>
1968 <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>
1969 </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 4317 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4317">&#x27ad;</a></h3>
1970 <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.
1971 Returns original parameter, so it could be used with chaining.
1972 </p>
1973 <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>
1974 <p class="header">Parameters
1975 </p>
1976 <dl class="dr-parameters"><dt class="dr-param">font</dt>
1977 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1978 <dd class="dr-description">the font to register</dd>
1979 </dl>
1980 <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>
1981 <p class="header">Usage
1982 </p>
1983 <pre class="javascript code"><code>Cufon.registerFont(Raphael.registerFont({…}));
1984 </code></pre>
1985 </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 959 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L959">&#x27ad;</a></h3>
1986 <div class="dr-method"><p>Converts RGB values to hex representation of the colour.
1987 </p>
1988 <p class="header">Parameters
1989 </p>
1990 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1991 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1992 <dd class="dr-description">red</dd>
1993 <dt class="dr-param">g</dt>
1994 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1995 <dd class="dr-description">green</dd>
1996 <dt class="dr-param">b</dt>
1997 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1998 <dd class="dr-description">blue</dd>
1999 </dl>
2000 <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>
2001 </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 722 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L722">&#x27ad;</a></h3>
2002 <div class="dr-method"><p>Converts RGB values to HSB object.
2003 </p>
2004 <p class="header">Parameters
2005 </p>
2006 <dl class="dr-parameters"><dt class="dr-param">r</dt>
2007 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2008 <dd class="dr-description">red</dd>
2009 <dt class="dr-param">g</dt>
2010 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2011 <dd class="dr-description">green</dd>
2012 <dt class="dr-param">b</dt>
2013 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2014 <dd class="dr-description">blue</dd>
2015 </dl>
2016 <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>
2017 <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>
2018 <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>
2019 <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>
2020 </ol></li><li>}</li></ol>
2021 </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 756 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L756">&#x27ad;</a></h3>
2022 <div class="dr-method"><p>Converts RGB values to HSL object.
2023 </p>
2024 <p class="header">Parameters
2025 </p>
2026 <dl class="dr-parameters"><dt class="dr-param">r</dt>
2027 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2028 <dd class="dr-description">red</dd>
2029 <dt class="dr-param">g</dt>
2030 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2031 <dd class="dr-description">green</dd>
2032 <dt class="dr-param">b</dt>
2033 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2034 <dd class="dr-description">blue</dd>
2035 </dl>
2036 <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>
2037 <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>
2038 <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>
2039 <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>
2040 </ol></li><li>}</li></ol>
2041 </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 487 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L487">&#x27ad;</a></h3>
2042 <div class="dr-method"><p>Used when you need to draw in <code>&lt;iframe></code>. Switched window to the iframe one.
2043 </p>
2044 <p class="header">Parameters
2045 </p>
2046 <dl class="dr-parameters"><dt class="dr-param">newwin</dt>
2047 <dd class="dr-type"><em class="dr-type-window">window</em></dd>
2048 <dd class="dr-description">new window object</dd>
2049 </dl>
2050 </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 449 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L449">&#x27ad;</a></h3>
2051 <div class="dr-method"><p>Snaps given value to given grid.
2052 </p>
2053 <p class="header">Parameters
2054 </p>
2055 <dl class="dr-parameters"><dt class="dr-param">values</dt>
2056 <dd class="dr-type"><em class="dr-type-array">array</em> <em class="dr-type-number">number</em></dd>
2057 <dd class="dr-description">given array of values or step of the grid</dd>
2058 <dt class="dr-param">value</dt>
2059 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2060 <dd class="dr-description">value to adjust</dd>
2061 <dt class="dr-param optional">tolerance</dt>
2062 <dd class="dr-optional">optional</dd>
2063 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2064 <dd class="dr-description">tolerance for snapping. Default is <code>10</code>.</dd>
2065 </dl>
2066 <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>
2067 </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 4561 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4561">&#x27ad;</a></h3>
2068 <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
2069 you added, so you will be able to call the same method on sets too.
2070 See also <a href="#Raphael.el" class="dr-link">Raphael.el</a>.
2071 </p>
2072 <p class="header">Usage
2073 </p>
2074 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
2075     <b>this</b>.attr({fill: <i>"#f00"</i>});
2076 };
2077 Raphael.st.red<span class="s"> = </span><b>function</b> () {
2078     <b>this</b>.forEach(<b>function</b> () {
2079         <b>this</b>.red();
2080     });
2081 };
2082 <span class="c">// then use it</span>
2083 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();
2084 </code></pre>
2085 </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 301 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L301">&#x27ad;</a></h3>
2086 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports SVG.
2087 </p>
2088 </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 283 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L283">&#x27ad;</a></h3>
2089 <div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Can be “SVG”, “VML” or empty, depending on browser support.
2090 </p>
2091 </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 307 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L307">&#x27ad;</a></h3>
2092 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports VML.
2093 </p>
2094 </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>
2095 <div class="extra"></div></div><div class="Set.clear-section"><h3 id="Set.clear" class="dr-method"><i class="dr-trixie">&#160;</i>Set.clear()<a href="#Set.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4176 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4176">&#x27ad;</a></h3>
2096 <div class="dr-method"><p>Removeds all elements from the set
2097 </p>
2098 </div><div class="extra"></div></div><div class="Set.exclude-section"><h3 id="Set.exclude" class="dr-method"><i class="dr-trixie">&#160;</i>Set.exclude(element)<a href="#Set.exclude" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4231 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4231">&#x27ad;</a></h3>
2099 <div class="dr-method"><p>Removes given element from the set
2100 </p>
2101 <p class="header">Parameters
2102 </p>
2103 <dl class="dr-parameters"><dt class="dr-param">element</dt>
2104 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2105 <dd class="dr-description">element to remove</dd>
2106 </dl>
2107 <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 object was found <em class="amp">&amp;</em> removed from the set</span></p>
2108 </div><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 4140 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4140">&#x27ad;</a></h3>
2109 <div class="dr-method"><p>Executes given function for each element in the set.
2110 </p>
2111 <p>If function returns <code>false</code> it will stop loop running.
2112 </p>
2113 <p class="header">Parameters
2114 </p>
2115 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
2116 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2117 <dd class="dr-description">function to run</dd>
2118 <dt class="dr-param">thisArg</dt>
2119 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2120 <dd class="dr-description">context object for the callback</dd>
2121 </dl>
2122 <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>
2123 </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 4122 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4122">&#x27ad;</a></h3>
2124 <div class="dr-method"><p>Removes last element and returns it.
2125 </p>
2126 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">element</span></p>
2127 </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 4102 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4102">&#x27ad;</a></h3>
2128 <div class="dr-method"><p>Adds each argument to the current set.
2129 </p>
2130 <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>
2131 </div><div class="extra"></div></div><div class="Set.splice-section"><h3 id="Set.splice" class="dr-method"><i class="dr-trixie">&#160;</i>Set.splice(index, count, [insertion…])<a href="#Set.splice" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4194 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/2.0/raphael.core.js#L4194">&#x27ad;</a></h3>
2132 <div class="dr-method"><p>Removes given element from the set
2133 </p>
2134 <p class="header">Parameters
2135 </p>
2136 <dl class="dr-parameters"><dt class="dr-param">index</dt>
2137 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2138 <dd class="dr-description">position of the deletion</dd>
2139 <dt class="dr-param">count</dt>
2140 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2141 <dd class="dr-description">number of element to remove</dd>
2142 <dt class="dr-param optional">insertion…</dt>
2143 <dd class="dr-optional">optional</dd>
2144 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2145 <dd class="dr-description">elements to insert</dd>
2146 </dl>
2147 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">set elements that were deleted</span></p>
2148 </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>
2149 <div class="dr-method"><p>Fires event with given <code>name</code>, given scope and other parameters.
2150 </p>
2151 <p class="header">Arguments
2152 </p>
2153 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2154 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2155 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2156 <dt class="dr-param">scope</dt>
2157 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2158 <dd class="dr-description">context for the event handlers</dd>
2159 <dt class="dr-param">varargs</dt>
2160 <dd class="dr-type"><em class="dr-type-...">...</em></dd>
2161 <dd class="dr-description">the rest of arguments will be sent to event handlers</dd>
2162 </dl>
2163 <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>
2164 </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>
2165 <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>.
2166 </p>
2167 <p class="header">Arguments
2168 </p>
2169 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2170 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2171 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2172 </dl>
2173 <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>
2174 </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>
2175 <div class="dr-method"><p>Could be used inside event handler to figure out actual name of the event.
2176 </p>
2177 <p class="header">Arguments
2178 </p>
2179 <dl class="dr-parameters"><dt class="dr-param optional">subname</dt>
2180 <dd class="dr-optional">optional</dd>
2181 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2182 <dd class="dr-description">subname of the event</dd>
2183 </dl>
2184 <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>
2185 <p>or
2186 </p>
2187 <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>
2188 </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>
2189 <div class="dr-method"><p>Binds given event handler with a given name. You can use wildcards “<code>*</code>” for the names:
2190 </p>
2191 <pre class="javascript code"><code>eve.on(<i>"*.under.*"</i>, f);
2192 eve(<i>"mouse.under.floor"</i>); <span class="c">// triggers f</span>
2193 </code></pre>
2194 <p>Use <a href="#eve" class="dr-link">eve</a> to trigger the listener.
2195 </p>
2196 <p class="header">Arguments
2197 </p>
2198 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2199 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2200 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2201 <dt class="dr-param">f</dt>
2202 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2203 <dd class="dr-description">event handler function</dd>
2204 </dl>
2205 <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>
2206 <p class="header">Example:
2207 </p>
2208 <pre class="javascript code"><code>eve.on(<i>"mouse"</i>, eat)(<span class="d">2</span>);
2209 eve.on(<i>"mouse"</i>, scream);
2210 eve.on(<i>"mouse"</i>, <b>catch</b>)(<span class="d">1</span>);
2211 </code></pre>
2212 <p>This will ensure that <code>catch</code> function will be called before <code>eat</code>.
2213 If you want to put you hadler before not indexed handlers specify negative value.
2214 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”.
2215 </p>
2216 </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>
2217 <div class="dr-method"><p>Is used inside event handler to stop event
2218 </p>
2219 </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>
2220 <div class="dr-method"><p>Removes given function from the list of event listeners assigned to given name.
2221 </p>
2222 <p class="header">Arguments
2223 </p>
2224 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2225 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2226 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2227 <dt class="dr-param">f</dt>
2228 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2229 <dd class="dr-description">event handler function</dd>
2230 </dl>
2231 </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>
2232 <div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Current version of the library.
2233 </p>
2234 </div><div class="extra"></div></div></div></div></body></html>