Fix #5648 - New design for post release report
[raphael] / reference.html
1 <!DOCTYPE html>
2 <!-- Generated with Dr.js -->
3 <html lang="en"><head><meta charset="utf-8"><title>Raphaël Reference</title><link rel="stylesheet" href="dr.css" media="screen"><link rel="stylesheet" href="dr-print.css" media="print"></head><body id="dr-js"><div id="dr"><ol class="dr-toc" id="dr-toc"><li class="dr-lvl0"><a href="#Animation" class="{clas}"><span>Animation</span></a></li><li class="dr-lvl1"><a href="#Animation.delay" class="dr-method"><span>Animation.delay()</span></a></li><li class="dr-lvl1"><a href="#Animation.repeat" class="dr-method"><span>Animation.repeat()</span></a></li><li class="dr-lvl0"><a href="#Element" class="{clas}"><span>Element</span></a></li><li class="dr-lvl1"><a href="#Element.animate" class="dr-method"><span>Element.animate()</span></a></li><li class="dr-lvl1"><a href="#Element.animateWith" class="dr-method"><span>Element.animateWith()</span></a></li><li class="dr-lvl1"><a href="#Element.attr" class="dr-method"><span>Element.attr()</span></a></li><li class="dr-lvl1"><a href="#Element.click" class="dr-method"><span>Element.click()</span></a></li><li class="dr-lvl1"><a href="#Element.clone" class="dr-method"><span>Element.clone()</span></a></li><li class="dr-lvl1"><a href="#Element.data" class="dr-method"><span>Element.data()</span></a></li><li class="dr-lvl1"><a href="#Element.dblclick" class="dr-method"><span>Element.dblclick()</span></a></li><li class="dr-lvl1"><a href="#Element.drag" class="dr-method"><span>Element.drag()</span></a></li><li class="dr-lvl1"><a href="#Element.getBBox" class="dr-method"><span>Element.getBBox()</span></a></li><li class="dr-lvl1"><a href="#Element.getPointAtLength" class="dr-method"><span>Element.getPointAtLength()</span></a></li><li class="dr-lvl1"><a href="#Element.getSubpath" class="dr-method"><span>Element.getSubpath()</span></a></li><li class="dr-lvl1"><a href="#Element.getTotalLength" class="dr-method"><span>Element.getTotalLength()</span></a></li><li class="dr-lvl1"><a href="#Element.glow" class="dr-method"><span>Element.glow()</span></a></li><li class="dr-lvl1"><a href="#Element.hide" class="dr-method"><span>Element.hide()</span></a></li><li class="dr-lvl1"><a href="#Element.hover" class="dr-method"><span>Element.hover()</span></a></li><li class="dr-lvl1"><a href="#Element.id" class="dr-property"><span>Element.id</span></a></li><li class="dr-lvl1"><a href="#Element.insertAfter" class="dr-method"><span>Element.insertAfter()</span></a></li><li class="dr-lvl1"><a href="#Element.insertBefore" class="dr-method"><span>Element.insertBefore()</span></a></li><li class="dr-lvl1"><a href="#Element.mousedown" class="dr-method"><span>Element.mousedown()</span></a></li><li class="dr-lvl1"><a href="#Element.mousemove" class="dr-method"><span>Element.mousemove()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseout" class="dr-method"><span>Element.mouseout()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseover" class="dr-method"><span>Element.mouseover()</span></a></li><li class="dr-lvl1"><a href="#Element.mouseup" class="dr-method"><span>Element.mouseup()</span></a></li><li class="dr-lvl1"><a href="#Element.next" class="dr-property"><span>Element.next</span></a></li><li class="dr-lvl1"><a href="#Element.node" class="dr-property"><span>Element.node</span></a></li><li class="dr-lvl1"><a href="#Element.onDragOver" class="dr-method"><span>Element.onDragOver()</span></a></li><li class="dr-lvl1"><a href="#Element.paper" class="dr-property"><span>Element.paper</span></a></li><li class="dr-lvl1"><a href="#Element.pause" class="dr-method"><span>Element.pause()</span></a></li><li class="dr-lvl1"><a href="#Element.prev" class="dr-property"><span>Element.prev</span></a></li><li class="dr-lvl1"><a href="#Element.raphael" class="dr-property"><span>Element.raphael</span></a></li><li class="dr-lvl1"><a href="#Element.remove" class="dr-method"><span>Element.remove()</span></a></li><li class="dr-lvl1"><a href="#Element.removeData" class="dr-method"><span>Element.removeData()</span></a></li><li class="dr-lvl1"><a href="#Element.resume" class="dr-method"><span>Element.resume()</span></a></li><li class="dr-lvl1"><a href="#Element.rotate" class="dr-method"><span>Element.rotate()</span></a></li><li class="dr-lvl1"><a href="#Element.scale" class="dr-method"><span>Element.scale()</span></a></li><li class="dr-lvl1"><a href="#Element.setTime" class="dr-method"><span>Element.setTime()</span></a></li><li class="dr-lvl1"><a href="#Element.show" class="dr-method"><span>Element.show()</span></a></li><li class="dr-lvl1"><a href="#Element.status" class="dr-method"><span>Element.status()</span></a></li><li class="dr-lvl1"><a href="#Element.stop" class="dr-method"><span>Element.stop()</span></a></li><li class="dr-lvl1"><a href="#Element.toBack" class="dr-method"><span>Element.toBack()</span></a></li><li class="dr-lvl1"><a href="#Element.toFront" class="dr-method"><span>Element.toFront()</span></a></li><li class="dr-lvl1"><a href="#Element.touchcancel" class="dr-method"><span>Element.touchcancel()</span></a></li><li class="dr-lvl1"><a href="#Element.touchend" class="dr-method"><span>Element.touchend()</span></a></li><li class="dr-lvl1"><a href="#Element.touchmove" class="dr-method"><span>Element.touchmove()</span></a></li><li class="dr-lvl1"><a href="#Element.touchstart" class="dr-method"><span>Element.touchstart()</span></a></li><li class="dr-lvl1"><a href="#Element.transform" class="dr-method"><span>Element.transform()</span></a></li><li class="dr-lvl1"><a href="#Element.translate" class="dr-method"><span>Element.translate()</span></a></li><li class="dr-lvl1"><a href="#Element.unclick" class="dr-method"><span>Element.unclick()</span></a></li><li class="dr-lvl1"><a href="#Element.undblclick" class="dr-method"><span>Element.undblclick()</span></a></li><li class="dr-lvl1"><a href="#Element.undrag" class="dr-method"><span>Element.undrag()</span></a></li><li class="dr-lvl1"><a href="#Element.unhover" class="dr-method"><span>Element.unhover()</span></a></li><li class="dr-lvl1"><a href="#Element.unmousedown" class="dr-method"><span>Element.unmousedown()</span></a></li><li class="dr-lvl1"><a href="#Element.unmousemove" class="dr-method"><span>Element.unmousemove()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseout" class="dr-method"><span>Element.unmouseout()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseover" class="dr-method"><span>Element.unmouseover()</span></a></li><li class="dr-lvl1"><a href="#Element.unmouseup" class="dr-method"><span>Element.unmouseup()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchcancel" class="dr-method"><span>Element.untouchcancel()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchend" class="dr-method"><span>Element.untouchend()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchmove" class="dr-method"><span>Element.untouchmove()</span></a></li><li class="dr-lvl1"><a href="#Element.untouchstart" class="dr-method"><span>Element.untouchstart()</span></a></li><li class="dr-lvl0"><a href="#Matrix" class="{clas}"><span>Matrix</span></a></li><li class="dr-lvl1"><a href="#Matrix.add" class="dr-method"><span>Matrix.add()</span></a></li><li class="dr-lvl1"><a href="#Matrix.clone" class="dr-method"><span>Matrix.clone()</span></a></li><li class="dr-lvl1"><a href="#Matrix.invert" class="dr-method"><span>Matrix.invert()</span></a></li><li class="dr-lvl1"><a href="#Matrix.rotate" class="dr-method"><span>Matrix.rotate()</span></a></li><li class="dr-lvl1"><a href="#Matrix.scale" class="dr-method"><span>Matrix.scale()</span></a></li><li class="dr-lvl1"><a href="#Matrix.split" class="dr-method"><span>Matrix.split()</span></a></li><li class="dr-lvl1"><a href="#Matrix.toTransformString" class="dr-method"><span>Matrix.toTransformString()</span></a></li><li class="dr-lvl1"><a href="#Matrix.translate" class="dr-method"><span>Matrix.translate()</span></a></li><li class="dr-lvl1"><a href="#Matrix.x" class="dr-method"><span>Matrix.x()</span></a></li><li class="dr-lvl1"><a href="#Matrix.y" class="dr-method"><span>Matrix.y()</span></a></li><li class="dr-lvl0"><a href="#Paper" class="{clas}"><span>Paper</span></a></li><li class="dr-lvl1"><a href="#Paper.add" class="dr-method"><span>Paper.add()</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.ca" class="dr-property"><span>Paper.ca</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.createUUID" class="dr-method"><span>Raphael.createUUID()</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.once" class="dr-method"><span>eve.once()</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 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" id="Animation-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 3708 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3708">&#x27ad;</a></h3>
5 <div class="extra" id="Animation.delay-extra"></div></div><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 <pre class="javascript code"><code><b>var</b> anim<span class="s"> = </span>Raphael.animation({cx: <span class="d">10</span>, cy: <span class="d">20</span>}, <span class="d">2e3</span>);
15 circle1.animate(anim); <span class="c">// run the given animation immediately</span>
16 circle2.animate(anim.delay(<span class="d">500</span>)); <span class="c">// run the given animation after <span class="d">500</span> ms</span>
17 </code></pre>
18 </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 3726 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3726">&#x27ad;</a></h3>
19 <div class="extra" id="Animation.repeat-extra"></div></div><div class="dr-method"><p>Creates a copy of existing animation object with given repetition.
20 </p>
21 <p class="header">Parameters
22 </p>
23 <dl class="dr-parameters"><dt class="dr-param">repeat</dt>
24 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
25 <dd class="dr-description">number iterations of animation. For infinite animation pass <code>Infinity</code></dd>
26 </dl>
27 <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>
28 </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>
29 <div class="extra" id="Element-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 3996 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3996">&#x27ad;</a></h3>
30 <div class="extra" id="Element.animate-extra"></div></div><div class="dr-method"><p>Creates and starts animation for given element.
31 </p>
32 <p class="header">Parameters
33 </p>
34 <dl class="dr-parameters"><dt class="dr-param">params</dt>
35 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
36 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
37 <dt class="dr-param">ms</dt>
38 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
39 <dd class="dr-description">number of milliseconds for animation to run</dd>
40 <dt class="dr-param optional">easing</dt>
41 <dd class="dr-optional">optional</dd>
42 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
43 <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>
44 <dt class="dr-param optional">callback</dt>
45 <dd class="dr-optional">optional</dd>
46 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
47 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
48 </dl>
49 <p>or
50 </p>
51 <dl class="dr-parameters"><dt class="dr-param">animation</dt>
52 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
53 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
54 </dl>
55 <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>
56 </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 3616 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3616">&#x27ad;</a></h3>
57 <div class="extra" id="Element.animateWith-extra"></div></div><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.
58 </p>
59 <p class="header">Parameters
60 </p>
61 <dl class="dr-parameters"><dt class="dr-param">element</dt>
62 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
63 <dd class="dr-description">element to sync with</dd>
64 <dt class="dr-param">anim</dt>
65 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
66 <dd class="dr-description">animation to sync with</dd>
67 <dt class="dr-param optional">params</dt>
68 <dd class="dr-optional">optional</dd>
69 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
70 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
71 <dt class="dr-param optional">ms</dt>
72 <dd class="dr-optional">optional</dd>
73 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
74 <dd class="dr-description">number of milliseconds for animation to run</dd>
75 <dt class="dr-param optional">easing</dt>
76 <dd class="dr-optional">optional</dd>
77 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
78 <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>
79 <dt class="dr-param optional">callback</dt>
80 <dd class="dr-optional">optional</dd>
81 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
82 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
83 </dl>
84 <p>or
85 </p>
86 <dl class="dr-parameters"><dt class="dr-param">element</dt>
87 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
88 <dd class="dr-description">element to sync with</dd>
89 <dt class="dr-param">anim</dt>
90 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
91 <dd class="dr-description">animation to sync with</dd>
92 <dt class="dr-param optional">animation</dt>
93 <dd class="dr-optional">optional</dd>
94 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
95 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
96 </dl>
97 <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>
98 </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 982 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L982">&#x27ad;</a></h3>
99 <div class="extra" id="Element.attr-extra"></div></div><div class="dr-method"><p>Sets the attributes of the element.
100 </p>
101 <p class="header">Parameters
102 </p>
103 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
104 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
105 <dd class="dr-description">attribute’s name</dd>
106 <dt class="dr-param">value</dt>
107 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
108 <dd class="dr-description">value</dd>
109 </dl>
110 <p>or
111 </p>
112 <dl class="dr-parameters"><dt class="dr-param">params</dt>
113 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
114 <dd class="dr-description">object of name/value pairs</dd>
115 </dl>
116 <p>or
117 </p>
118 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
119 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
120 <dd class="dr-description">attribute’s name</dd>
121 </dl>
122 <p>or
123 </p>
124 <dl class="dr-parameters"><dt class="dr-param">attrNames</dt>
125 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
126 <dd class="dr-description">in this case method returns array of current values for given attribute names</dd>
127 </dl>
128 <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>
129 <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>
130 <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>
131 <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>
132 <p class="header">Possible parameters
133 </p>
134 <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>
135 <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>
136 <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>
137 <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>
138 <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">the x-axis coordinate of the center of the circle, or ellipse</span>
139 <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">the y-axis coordinate of the center of the circle, or ellipse</span>
140 <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>
141 <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>
142 <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>
143 <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>
144 <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>
145 <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>
146 <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>
147 <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>
148 <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>
149 <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>
150 <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">radius of the circle, ellipse or rounded corner on the rect</span>
151 <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">horisontal radius of the ellipse</span>
152 <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">vertical radius of the ellipse</span>
153 <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>
154 <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>
155 <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>
156 <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>
157 <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>
158 <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>
159 <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>
160 <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>
161 <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>
162 <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>
163 <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>
164 <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>
165 <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>
166 <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>
167 <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>
168 <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>
169 </ol>
170 <p class="header">Gradients
171 <p>Linear gradient format: “<code>‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>90-#fff-#000</code>” – 90°
172 gradient from white to black or “<code>0-#fff-#f00:20-#000</code>” – 0° gradient from white via red (at 20%) to black.
173 </p>
174 <p>radial gradient: “<code>r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>r#fff-#000</code>” –
175 gradient from white to black or “<code>r(0.25, 0.75)#fff-#000</code>” – gradient from white to black with focus point
176 at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
177 </p>
178 <p class="header">Path String
179 </p>
180 <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>
181 <p class="header">Colour Parsing
182 </p>
183 <ul>
184     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
185     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
186     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
187     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
188     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
189     <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200,&nbsp;100,&nbsp;0, .5)</code>”)</li>
190     <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%,&nbsp;175%,&nbsp;0%, 50%)</code>”)</li>
191     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
192     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
193     <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
194     <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>
195     <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
196     <li>hsla(•••, •••, •••, •••) — same as above, but with opacity</li>
197     <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>
198 </ul>
199 </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 2340 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2340">&#x27ad;</a></h3>
200 <div class="extra" id="Element.click-extra"></div></div><div class="dr-method"><p>Adds event handler for click for the element.
201 </p>
202 <p class="header">Parameters
203 </p>
204 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
205 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
206 <dd class="dr-description">handler for the event</dd>
207 </dl>
208 <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>
209 </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 3137 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3137">&#x27ad;</a></h3>
210 <div class="extra" id="Element.clone-extra"></div></div><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>
211 </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 2585 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2585">&#x27ad;</a></h3>
212 <div class="extra" id="Element.data-extra"></div></div><div class="dr-method"><p>Adds or retrieves given value asociated with given key.
213 See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
214 </p>
215 <p class="header">Parameters
216 </p>
217 <dl class="dr-parameters"><dt class="dr-param">key</dt>
218 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
219 <dd class="dr-description">key to store data</dd>
220 <dt class="dr-param optional">value</dt>
221 <dd class="dr-optional">optional</dd>
222 <dd class="dr-type"><em class="dr-type-any">any</em></dd>
223 <dd class="dr-description">value to store</dd>
224 </dl>
225 <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>
226 <p>or, if value is not specified:
227 </p>
228 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-any">any</em> <span class="dr-description">value</span></p>
229 <p class="header">Usage
230 </p>
231 <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++) {
232     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>)
233          .attr({fill: <i>"#<span class="d">000</span>"</i>})
234          .data(<i>"i"</i>, i)
235          .click(<b>function</b> () {
236             alert(<b>this</b>.data(<i>"i"</i>));
237          });
238 }
239 </code></pre>
240 </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 2359 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2359">&#x27ad;</a></h3>
241 <div class="extra" id="Element.dblclick-extra"></div></div><div class="dr-method"><p>Adds event handler for double click for the element.
242 </p>
243 <p class="header">Parameters
244 </p>
245 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
246 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
247 <dd class="dr-description">handler for the event</dd>
248 </dl>
249 <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>
250 </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 2678 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2678">&#x27ad;</a></h3>
251 <div class="extra" id="Element.drag-extra"></div></div><div class="dr-method"><p>Adds event handlers for drag of the element.
252 </p>
253 <p class="header">Parameters
254 </p>
255 <dl class="dr-parameters"><dt class="dr-param">onmove</dt>
256 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
257 <dd class="dr-description">handler for moving</dd>
258 <dt class="dr-param">onstart</dt>
259 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
260 <dd class="dr-description">handler for drag start</dd>
261 <dt class="dr-param">onend</dt>
262 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
263 <dd class="dr-description">handler for drag end</dd>
264 <dt class="dr-param optional">mcontext</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 moving handler</dd>
268 <dt class="dr-param optional">scontext</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 start handler</dd>
272 <dt class="dr-param optional">econtext</dt>
273 <dd class="dr-optional">optional</dd>
274 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
275 <dd class="dr-description">context for drag end handler</dd>
276 </dl>
277 <p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start, 
278 <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 
279 <code>drag.over.&lt;id></code> will be fired as well.
280 </p>
281 <p>Start event and start handler will be called in specified context or in context of the element with following parameters:
282 </p>
283 <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>
284 <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>
285 <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>
286 </ol>
287 <p>Move event and move handler will be called in specified context or in context of the element with following parameters:
288 </p>
289 <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>
290 <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>
291 <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>
292 <li><span class="dr-json-key">y</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">y position of the mouse</span>
293 <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>End event and end handler will be called in specified context or in context of the element with following parameters:
296 </p>
297 <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>
298 </ol>
299 <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>
300 </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 3105 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3105">&#x27ad;</a></h3>
301 <div class="extra" id="Element.getBBox-extra"></div></div><div class="dr-method"><p>Return bounding box for a given element
302 </p>
303 <p class="header">Parameters
304 </p>
305 <dl class="dr-parameters"><dt class="dr-param">isWithoutTransform</dt>
306 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
307 <dd class="dr-description">flag, <code>true</code> if you want to have bounding box before transformations. Default is <code>false</code>.</dd>
308 </dl>
309 <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>
310 <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>
311 <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>
312 <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>
313 <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>
314 </ol></li><li>}</li></ol>
315 </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 3357 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3357">&#x27ad;</a></h3>
316 <div class="extra" id="Element.getPointAtLength-extra"></div></div><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.
317 </p>
318 <p class="header">Parameters
319 </p>
320 <dl class="dr-parameters"><dt class="dr-param">length</dt>
321 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
322 <dd class="dr-description">&#160;</dd>
323 </dl>
324 <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>
325 <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>
326 <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>
327 <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>
328 </ol></li><li>}</li></ol>
329 </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 3374 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3374">&#x27ad;</a></h3>
330 <div class="extra" id="Element.getSubpath-extra"></div></div><div class="dr-method"><p>Return subpath of a given element from given length to given length. Only works for element of “path” type.
331 </p>
332 <p class="header">Parameters
333 </p>
334 <dl class="dr-parameters"><dt class="dr-param">from</dt>
335 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
336 <dd class="dr-description">position of the start of the segment</dd>
337 <dt class="dr-param">to</dt>
338 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
339 <dd class="dr-description">position of the end of the segment</dd>
340 </dl>
341 <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>
342 </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 3333 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3333">&#x27ad;</a></h3>
343 <div class="extra" id="Element.getTotalLength-extra"></div></div><div class="dr-method"><p>Returns length of the path in pixels. Only works for element of “path” type.
344 </p>
345 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
346 </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 3166 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3166">&#x27ad;</a></h3>
347 <div class="extra" id="Element.glow-extra"></div></div><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>.
348 </p>
349 <p>Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself.
350 </p>
351 <p class="header">Parameters
352 </p>
353 <dl class="dr-parameters"><dt class="dr-param optional">glow</dt>
354 <dd class="dr-optional">optional</dd>
355 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
356 <dd class="dr-description">parameters object with all properties optional:</dd>
357 </dl>
358 <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>
359 <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>
360 <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>
361 <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>
362 <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>
363 <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>
364 </ol></li><li>}</li></ol>
365 <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>
366 </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 847 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L847">&#x27ad;</a></h3>
367 <div class="extra" id="Element.hide-extra"></div></div><div class="dr-method"><p>Makes element invisible. See <a href="#Element.show" class="dr-link">Element.show</a>.
368 </p>
369 <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>
370 </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 2631 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2631">&#x27ad;</a></h3>
371 <div class="extra" id="Element.hover-extra"></div></div><div class="dr-method"><p>Adds event handlers for hover for the element.
372 </p>
373 <p class="header">Parameters
374 </p>
375 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
376 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
377 <dd class="dr-description">handler for hover in</dd>
378 <dt class="dr-param">f_out</dt>
379 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
380 <dd class="dr-description">handler for hover out</dd>
381 <dt class="dr-param optional">icontext</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 in handler</dd>
385 <dt class="dr-param optional">ocontext</dt>
386 <dd class="dr-optional">optional</dd>
387 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
388 <dd class="dr-description">context for hover out handler</dd>
389 </dl>
390 <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>
391 </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 633 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L633">&#x27ad;</a></h3>
392 <div class="extra" id="Element.id-extra"></div></div><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, 
393 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.
394 </p>
395 </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 1090 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1090">&#x27ad;</a></h3>
396 <div class="extra" id="Element.insertAfter-extra"></div></div><div class="dr-method"><p>Inserts current object after 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="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 1110 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1110">&#x27ad;</a></h3>
400 <div class="extra" id="Element.insertBefore-extra"></div></div><div class="dr-method"><p>Inserts current object before the given one.
401 </p>
402 <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>
403 </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 2378 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2378">&#x27ad;</a></h3>
404 <div class="extra" id="Element.mousedown-extra"></div></div><div class="dr-method"><p>Adds event handler for mousedown for the element.
405 </p>
406 <p class="header">Parameters
407 </p>
408 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
409 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
410 <dd class="dr-description">handler for the event</dd>
411 </dl>
412 <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>
413 </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 2397 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2397">&#x27ad;</a></h3>
414 <div class="extra" id="Element.mousemove-extra"></div></div><div class="dr-method"><p>Adds event handler for mousemove for the element.
415 </p>
416 <p class="header">Parameters
417 </p>
418 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
419 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
420 <dd class="dr-description">handler for the event</dd>
421 </dl>
422 <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>
423 </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 2416 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2416">&#x27ad;</a></h3>
424 <div class="extra" id="Element.mouseout-extra"></div></div><div class="dr-method"><p>Adds event handler for mouseout for the element.
425 </p>
426 <p class="header">Parameters
427 </p>
428 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
429 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
430 <dd class="dr-description">handler for the event</dd>
431 </dl>
432 <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>
433 </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 2435 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2435">&#x27ad;</a></h3>
434 <div class="extra" id="Element.mouseover-extra"></div></div><div class="dr-method"><p>Adds event handler for mouseover for the element.
435 </p>
436 <p class="header">Parameters
437 </p>
438 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
439 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
440 <dd class="dr-description">handler for the event</dd>
441 </dl>
442 <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>
443 </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 2454 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2454">&#x27ad;</a></h3>
444 <div class="extra" id="Element.mouseup-extra"></div></div><div class="dr-method"><p>Adds event handler for mouseup for the element.
445 </p>
446 <p class="header">Parameters
447 </p>
448 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
449 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
450 <dd class="dr-description">handler for the event</dd>
451 </dl>
452 <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>
453 </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 676 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L676">&#x27ad;</a></h3>
454 <div class="extra" id="Element.next-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the next element in the hierarchy.
455 </p>
456 </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 612 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L612">&#x27ad;</a></h3>
457 <div class="extra" id="Element.node-extra"></div></div><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.
458 Note: Don’t mess with it.
459 </p>
460 <p class="header">Usage
461 </p>
462 <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>
463 <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>);
464 c.node.onclick<span class="s"> = </span><b>function</b> () {
465     c.attr(<i>"fill"</i>, <i>"red"</i>);
466 };
467 </code></pre>
468 </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 2706 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2706">&#x27ad;</a></h3>
469 <div class="extra" id="Element.onDragOver-extra"></div></div><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>).
470 </p>
471 <p class="header">Parameters
472 </p>
473 <dl class="dr-parameters"><dt class="dr-param">f</dt>
474 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
475 <dd class="dr-description">handler for event, first argument would be the element you are dragging over</dd>
476 </dl>
477 </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 649 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L649">&#x27ad;</a></h3>
478 <div class="extra" id="Element.paper-extra"></div></div><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.
479 </p>
480 <p class="header">Usage
481 </p>
482 <pre class="javascript code"><code>Raphael.el.cross<span class="s"> = </span><b>function</b> () {
483     <b>this</b>.attr({fill: <i>"red"</i>});
484     <b>this</b>.paper.path(<i>"M10,10L50,50M50,10L10,<span class="d">50</span>"</i>)
485         .attr({stroke: <i>"red"</i>});
486 }
487 </code></pre>
488 </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 4089 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4089">&#x27ad;</a></h3>
489 <div class="extra" id="Element.pause-extra"></div></div><div class="dr-method"><p>Stops animation of the element with ability to resume it later on.
490 </p>
491 <p class="header">Parameters
492 </p>
493 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
494 <dd class="dr-optional">optional</dd>
495 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
496 <dd class="dr-description">animation object</dd>
497 </dl>
498 <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>
499 </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 667 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L667">&#x27ad;</a></h3>
500 <div class="extra" id="Element.prev-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the previous element in the hierarchy.
501 </p>
502 </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 625 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L625">&#x27ad;</a></h3>
503 <div class="extra" id="Element.raphael-extra"></div></div><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.
504 </p>
505 <p class="header">Usage
506 </p>
507 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
508     <b>var</b> hsb<span class="s"> = </span><b>this</b>.paper.raphael.rgb2hsb(<b>this</b>.attr(<i>"fill"</i>));
509     hsb.h<span class="s"> = </span><span class="d">1</span>;
510     <b>this</b>.attr({fill: <b>this</b>.paper.raphael.hsb2rgb(hsb).hex});
511 }
512 </code></pre>
513 </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 868 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L868">&#x27ad;</a></h3>
514 <div class="extra" id="Element.remove-extra"></div></div><div class="dr-method"><p>Removes element form the paper.
515 </p>
516 </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 2611 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2611">&#x27ad;</a></h3>
517 <div class="extra" id="Element.removeData-extra"></div></div><div class="dr-method"><p>Removes value associated with an element by given key.
518 If key is not provided, removes all the data of the element.
519 </p>
520 <p class="header">Parameters
521 </p>
522 <dl class="dr-parameters"><dt class="dr-param optional">key</dt>
523 <dd class="dr-optional">optional</dd>
524 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
525 <dd class="dr-description">key</dd>
526 </dl>
527 <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>
528 </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 4109 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4109">&#x27ad;</a></h3>
529 <div class="extra" id="Element.resume-extra"></div></div><div class="dr-method"><p>Resumes animation if it was paused with <a href="#Element.pause" class="dr-link">Element.pause</a> method.
530 </p>
531 <p class="header">Parameters
532 </p>
533 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
534 <dd class="dr-optional">optional</dd>
535 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
536 <dd class="dr-description">animation object</dd>
537 </dl>
538 <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>
539 </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 708 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L708">&#x27ad;</a></h3>
540 <div class="extra" id="Element.rotate-extra"></div></div><div class="dr-method"><p>Adds rotation by given angle around given point to the list of
541 transformations of the element.
542 </p>
543 <p class="header">Parameters
544 </p>
545 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
546 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
547 <dd class="dr-description">angle in degrees</dd>
548 <dt class="dr-param optional">cx</dt>
549 <dd class="dr-optional">optional</dd>
550 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
551 <dd class="dr-description">x coordinate of the centre of rotation</dd>
552 <dt class="dr-param optional">cy</dt>
553 <dd class="dr-optional">optional</dd>
554 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
555 <dd class="dr-description">y coordinate of the centre of rotation</dd>
556 </dl>
557 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used as a point of rotation.
558 </p>
559 <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>
560 </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 741 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L741">&#x27ad;</a></h3>
561 <div class="extra" id="Element.scale-extra"></div></div><div class="dr-method"><p>Adds scale by given amount relative to given point to the list of
562 transformations of the element.
563 </p>
564 <p class="header">Parameters
565 </p>
566 <dl class="dr-parameters"><dt class="dr-param">sx</dt>
567 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
568 <dd class="dr-description">horisontal scale amount</dd>
569 <dt class="dr-param">sy</dt>
570 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
571 <dd class="dr-description">vertical scale amount</dd>
572 <dt class="dr-param optional">cx</dt>
573 <dd class="dr-optional">optional</dd>
574 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
575 <dd class="dr-description">x coordinate of the centre of scale</dd>
576 <dt class="dr-param optional">cy</dt>
577 <dd class="dr-optional">optional</dd>
578 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
579 <dd class="dr-description">y coordinate of the centre of scale</dd>
580 </dl>
581 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used instead.
582 </p>
583 <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>
584 </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 4022 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4022">&#x27ad;</a></h3>
585 <div class="extra" id="Element.setTime-extra"></div></div><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.
586 </p>
587 <p class="header">Parameters
588 </p>
589 <dl class="dr-parameters"><dt class="dr-param">anim</dt>
590 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
591 <dd class="dr-description">animation object</dd>
592 <dt class="dr-param">value</dt>
593 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
594 <dd class="dr-description">number of milliseconds from the beginning of the animation</dd>
595 </dl>
596 <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>
597 <p>Note, that during animation following events are triggered:
598 </p>
599 <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>.
600 </p>
601 </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 858 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L858">&#x27ad;</a></h3>
602 <div class="extra" id="Element.show-extra"></div></div><div class="dr-method"><p>Makes element visible. See <a href="#Element.hide" class="dr-link">Element.hide</a>.
603 </p>
604 <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>
605 </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 4049 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4049">&#x27ad;</a></h3>
606 <div class="extra" id="Element.status-extra"></div></div><div class="dr-method"><p>Gets or sets the status of animation of the element.
607 </p>
608 <p class="header">Parameters
609 </p>
610 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
611 <dd class="dr-optional">optional</dd>
612 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
613 <dd class="dr-description">animation object</dd>
614 <dt class="dr-param optional">value</dt>
615 <dd class="dr-optional">optional</dd>
616 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
617 <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>
618 </dl>
619 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">status</span></p>
620 <p>or
621 </p>
622 <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>
623 <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>
624 <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>
625 </ol></li><li>}</li></ol>
626 <p>or
627 </p>
628 <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>
629 </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 4131 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4131">&#x27ad;</a></h3>
630 <div class="extra" id="Element.stop-extra"></div></div><div class="dr-method"><p>Stops animation of the element.
631 </p>
632 <p class="header">Parameters
633 </p>
634 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
635 <dd class="dr-optional">optional</dd>
636 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
637 <dd class="dr-description">animation object</dd>
638 </dl>
639 <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>
640 </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 1069 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1069">&#x27ad;</a></h3>
641 <div class="extra" id="Element.toBack-extra"></div></div><div class="dr-method"><p>Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
642 </p>
643 <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>
644 </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 1049 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1049">&#x27ad;</a></h3>
645 <div class="extra" id="Element.toFront-extra"></div></div><div class="dr-method"><p>Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
646 </p>
647 <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>
648 </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 2530 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2530">&#x27ad;</a></h3>
649 <div class="extra" id="Element.touchcancel-extra"></div></div><div class="dr-method"><p>Adds event handler for touchcancel for the element.
650 </p>
651 <p class="header">Parameters
652 </p>
653 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
654 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
655 <dd class="dr-description">handler for the event</dd>
656 </dl>
657 <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>
658 </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 2511 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2511">&#x27ad;</a></h3>
659 <div class="extra" id="Element.touchend-extra"></div></div><div class="dr-method"><p>Adds event handler for touchend for the element.
660 </p>
661 <p class="header">Parameters
662 </p>
663 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
664 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
665 <dd class="dr-description">handler for the event</dd>
666 </dl>
667 <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>
668 </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 2492 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2492">&#x27ad;</a></h3>
669 <div class="extra" id="Element.touchmove-extra"></div></div><div class="dr-method"><p>Adds event handler for touchmove for the element.
670 </p>
671 <p class="header">Parameters
672 </p>
673 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
674 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
675 <dd class="dr-description">handler for the event</dd>
676 </dl>
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="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 2473 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2473">&#x27ad;</a></h3>
679 <div class="extra" id="Element.touchstart-extra"></div></div><div class="dr-method"><p>Adds event handler for touchstart for the element.
680 </p>
681 <p class="header">Parameters
682 </p>
683 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
684 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
685 <dd class="dr-description">handler for the event</dd>
686 </dl>
687 <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>
688 </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 822 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L822">&#x27ad;</a></h3>
689 <div class="extra" id="Element.transform-extra"></div></div><div class="dr-method"><p>Adds transformation to the element which is separate to other attributes,
690 i.e. translation doesn’t change <code>x</code> or <code>y</code> of the rectange. The format
691 of transformation string is similar to the path string syntax:
692 </p>
693 <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>
694 </code></pre>
695 <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
696 scale and <code>m</code> is for matrix.
697 </p>
698 <p>There are also alternative “absolute” translation, rotation and scale: <code>T</code>, <code>R</code> and <code>S</code>. They will not take previous transformation into account. For example, <code>...T100,0</code> will always move element 100 px horisontally, while <code>...t100,0</code> could move it vertically if there is <code>r90</code> before. Just compare results of <code>r90t100,0</code> and <code>r90T100,0</code>.
699 </p>
700 <p>So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100;
701 rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin
702 coordinates as optional parameters, the default is the centre point of the element.
703 Matrix accepts six parameters.
704 </p>
705 <p class="header">Usage
706 </p>
707 <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>);
708 <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>
709 el.transform(<i>"t100,100r45t-<span class="d">100</span>,<span class="d">0</span>"</i>);
710 <span class="c">// <b>if</b> you want you can append or prepend transformations</span>
711 el.transform(<i>"...t50,<span class="d">50</span>"</i>);
712 el.transform(<i>"s2..."</i>);
713 <span class="c">// or even wrap</span>
714 el.transform(<i>"t50,<span class="d">50</span>...t-<span class="d">50</span>-<span class="d">50</span>"</i>);
715 <span class="c">// to reset transformation call method <b>with</b> empty string</span>
716 el.transform(<i>""</i>);
717 <span class="c">// to get current value call it without parameters</span>
718 console.log(el.transform());
719 </code></pre>
720 <p class="header">Parameters
721 </p>
722 <dl class="dr-parameters"><dt class="dr-param optional">tstr</dt>
723 <dd class="dr-optional">optional</dd>
724 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
725 <dd class="dr-description">transformation string</dd>
726 </dl>
727 <p>If tstr isn’t specified
728 </p>
729 <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>
730 <p>else
731 </p>
732 <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>
733 </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 772 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L772">&#x27ad;</a></h3>
734 <div class="extra" id="Element.translate-extra"></div></div><div class="dr-method"><p>Adds translation by given amount to the list of transformations of the element.
735 </p>
736 <p class="header">Parameters
737 </p>
738 <dl class="dr-parameters"><dt class="dr-param">dx</dt>
739 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
740 <dd class="dr-description">horisontal shift</dd>
741 <dt class="dr-param">dy</dt>
742 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
743 <dd class="dr-description">vertical shift</dd>
744 </dl>
745 <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>
746 </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 2349 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2349">&#x27ad;</a></h3>
747 <div class="extra" id="Element.unclick-extra"></div></div><div class="dr-method"><p>Removes event handler for click for the element.
748 </p>
749 <p class="header">Parameters
750 </p>
751 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
752 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
753 <dd class="dr-description">handler for the event</dd>
754 </dl>
755 <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>
756 </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 2368 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2368">&#x27ad;</a></h3>
757 <div class="extra" id="Element.undblclick-extra"></div></div><div class="dr-method"><p>Removes event handler for double click for the element.
758 </p>
759 <p class="header">Parameters
760 </p>
761 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
762 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
763 <dd class="dr-description">handler for the event</dd>
764 </dl>
765 <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>
766 </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 2715 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2715">&#x27ad;</a></h3>
767 <div class="extra" id="Element.undrag-extra"></div></div><div class="dr-method"><p>Removes all drag event handlers from given element.
768 </p>
769 </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 2644 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2644">&#x27ad;</a></h3>
770 <div class="extra" id="Element.unhover-extra"></div></div><div class="dr-method"><p>Removes event handlers for hover for the element.
771 </p>
772 <p class="header">Parameters
773 </p>
774 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
775 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
776 <dd class="dr-description">handler for hover in</dd>
777 <dt class="dr-param">f_out</dt>
778 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
779 <dd class="dr-description">handler for hover out</dd>
780 </dl>
781 <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>
782 </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 2387 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2387">&#x27ad;</a></h3>
783 <div class="extra" id="Element.unmousedown-extra"></div></div><div class="dr-method"><p>Removes event handler for mousedown for the element.
784 </p>
785 <p class="header">Parameters
786 </p>
787 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
788 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
789 <dd class="dr-description">handler for the event</dd>
790 </dl>
791 <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>
792 </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 2406 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2406">&#x27ad;</a></h3>
793 <div class="extra" id="Element.unmousemove-extra"></div></div><div class="dr-method"><p>Removes event handler for mousemove for the element.
794 </p>
795 <p class="header">Parameters
796 </p>
797 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
798 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
799 <dd class="dr-description">handler for the event</dd>
800 </dl>
801 <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>
802 </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 2425 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2425">&#x27ad;</a></h3>
803 <div class="extra" id="Element.unmouseout-extra"></div></div><div class="dr-method"><p>Removes event handler for mouseout for the element.
804 </p>
805 <p class="header">Parameters
806 </p>
807 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
808 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
809 <dd class="dr-description">handler for the event</dd>
810 </dl>
811 <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>
812 </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 2444 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2444">&#x27ad;</a></h3>
813 <div class="extra" id="Element.unmouseover-extra"></div></div><div class="dr-method"><p>Removes event handler for mouseover for the element.
814 </p>
815 <p class="header">Parameters
816 </p>
817 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
818 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
819 <dd class="dr-description">handler for the event</dd>
820 </dl>
821 <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>
822 </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 2463 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2463">&#x27ad;</a></h3>
823 <div class="extra" id="Element.unmouseup-extra"></div></div><div class="dr-method"><p>Removes event handler for mouseup for the element.
824 </p>
825 <p class="header">Parameters
826 </p>
827 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
828 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
829 <dd class="dr-description">handler for the event</dd>
830 </dl>
831 <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>
832 </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 2539 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2539">&#x27ad;</a></h3>
833 <div class="extra" id="Element.untouchcancel-extra"></div></div><div class="dr-method"><p>Removes event handler for touchcancel for the element.
834 </p>
835 <p class="header">Parameters
836 </p>
837 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
838 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
839 <dd class="dr-description">handler for the event</dd>
840 </dl>
841 <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>
842 </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 2520 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2520">&#x27ad;</a></h3>
843 <div class="extra" id="Element.untouchend-extra"></div></div><div class="dr-method"><p>Removes event handler for touchend for the element.
844 </p>
845 <p class="header">Parameters
846 </p>
847 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
848 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
849 <dd class="dr-description">handler for the event</dd>
850 </dl>
851 <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>
852 </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 2501 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2501">&#x27ad;</a></h3>
853 <div class="extra" id="Element.untouchmove-extra"></div></div><div class="dr-method"><p>Removes event handler for touchmove for the element.
854 </p>
855 <p class="header">Parameters
856 </p>
857 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
858 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
859 <dd class="dr-description">handler for the event</dd>
860 </dl>
861 <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>
862 </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 2482 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2482">&#x27ad;</a></h3>
863 <div class="extra" id="Element.untouchstart-extra"></div></div><div class="dr-method"><p>Removes event handler for touchstart for the element.
864 </p>
865 <p class="header">Parameters
866 </p>
867 <dl class="dr-parameters"><dt class="dr-param">handler</dt>
868 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
869 <dd class="dr-description">handler for the event</dd>
870 </dl>
871 <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>
872 </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>
873 <div class="extra" id="Matrix-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 1965 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1965">&#x27ad;</a></h3>
874 <div class="extra" id="Matrix.add-extra"></div></div><div class="dr-method"><p>Adds given matrix to existing one.
875 </p>
876 <p class="header">Parameters
877 </p>
878 <dl class="dr-parameters"><dt class="dr-param">a</dt>
879 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
880 <dd class="dr-description">&#160;</dd>
881 <dt class="dr-param">b</dt>
882 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
883 <dd class="dr-description">&#160;</dd>
884 <dt class="dr-param">c</dt>
885 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
886 <dd class="dr-description">&#160;</dd>
887 <dt class="dr-param">d</dt>
888 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
889 <dd class="dr-description">&#160;</dd>
890 <dt class="dr-param">e</dt>
891 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
892 <dd class="dr-description">&#160;</dd>
893 <dt class="dr-param">f</dt>
894 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
895 <dd class="dr-description">&#160;</dd>
896 <dt class="dr-param">matrix</dt>
897 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
898 <dd class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></dd>
899 </dl>
900 </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 2010 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2010">&#x27ad;</a></h3>
901 <div class="extra" id="Matrix.clone-extra"></div></div><div class="dr-method"><p>Returns copy of the matrix
902 </p>
903 <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>
904 </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 1998 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1998">&#x27ad;</a></h3>
905 <div class="extra" id="Matrix.invert-extra"></div></div><div class="dr-method"><p>Returns inverted version of the matrix
906 </p>
907 <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>
908 </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 2052 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2052">&#x27ad;</a></h3>
909 <div class="extra" id="Matrix.rotate-extra"></div></div><div class="dr-method"><p>Rotates the matrix
910 </p>
911 <p class="header">Parameters
912 </p>
913 <dl class="dr-parameters"><dt class="dr-param">a</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">x</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">y</dt>
920 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
921 <dd class="dr-description">&#160;</dd>
922 </dl>
923 </div><div class="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 2036 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2036">&#x27ad;</a></h3>
924 <div class="extra" id="Matrix.scale-extra"></div></div><div class="dr-method"><p>Scales the matrix
925 </p>
926 <p class="header">Parameters
927 </p>
928 <dl class="dr-parameters"><dt class="dr-param">x</dt>
929 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
930 <dd class="dr-description">&#160;</dd>
931 <dt class="dr-param optional">y</dt>
932 <dd class="dr-optional">optional</dd>
933 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
934 <dd class="dr-description">&#160;</dd>
935 <dt class="dr-param optional">cx</dt>
936 <dd class="dr-optional">optional</dd>
937 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
938 <dd class="dr-description">&#160;</dd>
939 <dt class="dr-param optional">cy</dt>
940 <dd class="dr-optional">optional</dd>
941 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
942 <dd class="dr-description">&#160;</dd>
943 </dl>
944 </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 2125 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2125">&#x27ad;</a></h3>
945 <div class="extra" id="Matrix.split-extra"></div></div><div class="dr-method"><p>Splits matrix into primitive transformations
946 </p>
947 <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>
948 <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>
949 <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>
950 <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>
951 <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>
952 <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>
953 <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>
954 <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>
955 </ol>
956 </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 2167 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2167">&#x27ad;</a></h3>
957 <div class="extra" id="Matrix.toTransformString-extra"></div></div><div class="dr-method"><p>Return transform string that represents given matrix
958 </p>
959 <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>
960 </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 2022 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2022">&#x27ad;</a></h3>
961 <div class="extra" id="Matrix.translate-extra"></div></div><div class="dr-method"><p>Translate the matrix
962 </p>
963 <p class="header">Parameters
964 </p>
965 <dl class="dr-parameters"><dt class="dr-param">x</dt>
966 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
967 <dd class="dr-description">&#160;</dd>
968 <dt class="dr-param">y</dt>
969 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
970 <dd class="dr-description">&#160;</dd>
971 </dl>
972 </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 2071 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2071">&#x27ad;</a></h3>
973 <div class="extra" id="Matrix.x-extra"></div></div><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>
974 </p>
975 <p class="header">Parameters
976 </p>
977 <dl class="dr-parameters"><dt class="dr-param">x</dt>
978 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
979 <dd class="dr-description">&#160;</dd>
980 <dt class="dr-param">y</dt>
981 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
982 <dd class="dr-description">&#160;</dd>
983 </dl>
984 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">x</span></p>
985 </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 2084 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2084">&#x27ad;</a></h3>
986 <div class="extra" id="Matrix.y-extra"></div></div><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>
987 </p>
988 <p class="header">Parameters
989 </p>
990 <dl class="dr-parameters"><dt class="dr-param">x</dt>
991 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
992 <dd class="dr-description">&#160;</dd>
993 <dt class="dr-param">y</dt>
994 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
995 <dd class="dr-description">&#160;</dd>
996 </dl>
997 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">y</span></p>
998 </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>
999 <div class="extra" id="Paper-extra"></div></div><div class="Paper-add-section"><h3 id="Paper.add" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.add(json)<a href="#Paper.add" 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/master/raphael.core.js#L4537">&#x27ad;</a></h3>
1000 <div class="extra" id="Paper.add-extra"></div></div><div class="dr-method"><p>Imports elements in JSON array in format <code>{type: type, &lt;attributes>}</code>
1001 </p>
1002 <p class="header">Parameters
1003 </p>
1004 <dl class="dr-parameters"><dt class="dr-param">json</dt>
1005 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
1006 <dd class="dr-description">&#160;</dd>
1007 </dl>
1008 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">resulting set of imported elements</span></p>
1009 <p class="header">Usage
1010 </p>
1011 <pre class="javascript code"><code>paper.<b>import</b>([
1012     {
1013         type: <i>"circle"</i>,
1014         cx: <span class="d">10</span>,
1015         cy: <span class="d">10</span>,
1016         r: <span class="d">5</span>
1017     },
1018     {
1019         type: <i>"rect"</i>,
1020         x: <span class="d">10</span>,
1021         y: <span class="d">10</span>,
1022         width: <span class="d">10</span>,
1023         height: <span class="d">10</span>,
1024         fill: <i>"#fc0"</i>
1025     }
1026 ]);
1027 </code></pre>
1028 </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 2977 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2977">&#x27ad;</a></h3>
1029 <div class="extra" id="Paper.bottom-extra"></div></div><div class="dr-property"><p>Points to the bottom element on the paper
1030 </p>
1031 </div><div class="Paper-ca-section"><h3 id="Paper.ca" class="dr-property"><i class="dr-trixie">&#160;</i>Paper.ca<a href="#Paper.ca" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 99 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L99">&#x27ad;</a></h3>
1032 <div class="extra" id="Paper.ca-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Shortcut for <a href="#Paper.customAttributes" class="dr-link">Paper.customAttributes</a>
1033 </p>
1034 </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 2740 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2740">&#x27ad;</a></h3>
1035 <div class="extra" id="Paper.circle-extra"></div></div><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="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 1316 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1316">&#x27ad;</a></h3>
1055 <div class="extra" id="Paper.clear-extra"></div></div><div class="dr-method"><p>Clears the paper, i.e. removes all the elements.
1056 </p>
1057 </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 125 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L125">&#x27ad;</a></h3>
1058 <div class="extra" id="Paper.customAttributes-extra"></div></div><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">0.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">0.5</span> <span class="d">.8</span> <span class="d">1</span>"</i>});
1080 c.animate({hsb: [<span class="d">1</span>, <span class="d">0</span>, <span class="d">0.5</span>]}, <span class="d">1e3</span>);
1081 </code></pre>
1082 </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 2788 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2788">&#x27ad;</a></h3>
1083 <div class="extra" id="Paper.ellipse-extra"></div></div><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="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 3072 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3072">&#x27ad;</a></h3>
1106 <div class="extra" id="Paper.forEach-extra"></div></div><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="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 3048 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3048">&#x27ad;</a></h3>
1121 <div class="extra" id="Paper.getById-extra"></div></div><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="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 3012 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3012">&#x27ad;</a></h3>
1131 <div class="extra" id="Paper.getElementByPoint-extra"></div></div><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="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 4430 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4430">&#x27ad;</a></h3>
1148 <div class="extra" id="Paper.getFont-extra"></div></div><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="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 2847 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2847">&#x27ad;</a></h3>
1174 <div class="extra" id="Paper.image-extra"></div></div><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="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 2823 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2823">&#x27ad;</a></h3>
1200 <div class="extra" id="Paper.path-extra"></div></div><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 optional">pathString</dt>
1205 <dd class="dr-optional">optional</dd>
1206 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1207 <dd class="dr-description">path string in SVG format.</dd>
1208 </dl>
1209 <p>Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example:
1210 </p>
1211 <pre class="javascript code"><code><i>"M10,20L30,<span class="d">40</span>"</i>
1212 </code></pre>
1213 <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.
1214 </p>
1215 <p></p>
1216 <p>Here is short list of commands available, for more details see <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 path string format</a>.</p>
1217 <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
1218 <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
1219 <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
1220 <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
1221 <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
1222 <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
1223 <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
1224 <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
1225 <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
1226 <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
1227 <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
1228 <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>
1229 <p>* “Catmull-Rom curveto” is a not standard SVG command and added in 2.0 to make life easier.
1230 </p>
1231 <p class="header">Usage
1232 </p>
1233 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.path(<i>"M10 10L90 <span class="d">90</span>"</i>);
1234 <span class="c">// draw a diagonal line:</span>
1235 <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>
1236 </code></pre>
1237 </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 4480 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4480">&#x27ad;</a></h3>
1238 <div class="extra" id="Paper.print-extra"></div></div><div class="dr-method"><p>Creates set of shapes to represent given font at given position with given size.
1239 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.
1240 </p>
1241 <p class="header">Parameters
1242 </p>
1243 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1244 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1245 <dd class="dr-description">x position of the text</dd>
1246 <dt class="dr-param">y</dt>
1247 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1248 <dd class="dr-description">y position of the text</dd>
1249 <dt class="dr-param">text</dt>
1250 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1251 <dd class="dr-description">text to print</dd>
1252 <dt class="dr-param">font</dt>
1253 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1254 <dd class="dr-description">font object, see <a href="#Paper.getFont" class="dr-link">Paper.getFont</a></dd>
1255 <dt class="dr-param optional">size</dt>
1256 <dd class="dr-optional">optional</dd>
1257 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1258 <dd class="dr-description">size of the font, default is <code>16</code></dd>
1259 <dt class="dr-param optional">origin</dt>
1260 <dd class="dr-optional">optional</dd>
1261 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1262 <dd class="dr-description">could be <code>"baseline"</code> or <code>"middle"</code>, default is <code>"middle"</code></dd>
1263 <dt class="dr-param optional">letter_spacing</dt>
1264 <dd class="dr-optional">optional</dd>
1265 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1266 <dd class="dr-description">number in range <code>-1..1</code>, default is <code>0</code></dd>
1267 </dl>
1268 <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>
1269 <p class="header">Usage
1270 </p>
1271 <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>});
1272 <span class="c">// following line will paint first letter <b>in</b> red</span>
1273 txt[<span class="d">0</span>].attr({fill: <i>"#f00"</i>});
1274 </code></pre>
1275 </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 2984 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2984">&#x27ad;</a></h3>
1276 <div class="extra" id="Paper.raphael-extra"></div></div><div class="dr-property"><p>Points to the <a href="#Raphael" class="dr-link">Raphael</a> object/function
1277 </p>
1278 </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 2766 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2766">&#x27ad;</a></h3>
1279 <div class="extra" id="Paper.rect-extra"></div></div><div class="dr-method"><p></p>
1280 <p>Draws a rectangle.
1281 </p>
1282 <p class="header">Parameters
1283 </p>
1284 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1285 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1286 <dd class="dr-description">x coordinate of the top left corner</dd>
1287 <dt class="dr-param">y</dt>
1288 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1289 <dd class="dr-description">y coordinate of the top left corner</dd>
1290 <dt class="dr-param">width</dt>
1291 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1292 <dd class="dr-description">width</dd>
1293 <dt class="dr-param">height</dt>
1294 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1295 <dd class="dr-description">height</dd>
1296 <dt class="dr-param optional">r</dt>
1297 <dd class="dr-optional">optional</dd>
1298 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1299 <dd class="dr-description">radius for rounded corners, default is 0</dd>
1300 </dl>
1301 <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>
1302 <p class="header">Usage
1303 </p>
1304 <pre class="javascript code"><code><span class="c">// regular rectangle</span>
1305 <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>);
1306 <span class="c">// rectangle <b>with</b> rounded corners</span>
1307 <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>);
1308 </code></pre>
1309 </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 1333 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1333">&#x27ad;</a></h3>
1310 <div class="extra" id="Paper.remove-extra"></div></div><div class="dr-method"><p>Removes the paper from the DOM.
1311 </p>
1312 </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 1293 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1293">&#x27ad;</a></h3>
1313 <div class="extra" id="Paper.renderfix-extra"></div></div><div class="dr-method"><p>Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependant
1314 on other elements after reflow it could shift half pixel which cause for lines to lost their crispness.
1315 This method fixes the issue.
1316 </p>
1317 </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 2194 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2194">&#x27ad;</a></h3>
1318 <div class="extra" id="Paper.safari-extra"></div></div><div class="dr-method"><p>There is an inconvenient rendering bug in Safari (WebKit):
1319 sometimes the rendering should be forced.
1320 This method should help with dealing with this bug.
1321 </p>
1322 </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 2890 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2890">&#x27ad;</a></h3>
1323 <div class="extra" id="Paper.set-extra"></div></div><div class="dr-method"><p>Creates array-like object to keep and operate several elements at once.
1324 Warning: it doesn’t create any elements for itself in the page, it just groups existing elements.
1325 Sets act as pseudo elements — all methods available to an element can be used on a set.
1326 </p>
1327 <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>
1328 <p class="header">Usage
1329 </p>
1330 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1331 st.push(
1332     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1333     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1334 );
1335 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1336 </code></pre>
1337 </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 2921 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2921">&#x27ad;</a></h3>
1338 <div class="extra" id="Paper.setFinish-extra"></div></div><div class="dr-method"><p>See <a href="#Paper.setStart" class="dr-link">Paper.setStart</a>. This method finishes catching and returns resulting set.
1339 </p>
1340 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">set</span></p>
1341 </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 2944 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2944">&#x27ad;</a></h3>
1342 <div class="extra" id="Paper.setSize-extra"></div></div><div class="dr-method"><p>If you need to change dimensions of the canvas call this method
1343 </p>
1344 <p class="header">Parameters
1345 </p>
1346 <dl class="dr-parameters"><dt class="dr-param">width</dt>
1347 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1348 <dd class="dr-description">new width of the canvas</dd>
1349 <dt class="dr-param">height</dt>
1350 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1351 <dd class="dr-description">new height of the canvas</dd>
1352 </dl>
1353 <p class="header">Usage
1354 </p>
1355 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
1356 st.push(
1357     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1358     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1359 );
1360 st.attr({fill: <i>"red"</i>});
1361 </code></pre>
1362 </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 2910 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2910">&#x27ad;</a></h3>
1363 <div class="extra" id="Paper.setStart-extra"></div></div><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
1364 <a href="#Paper.setFinish" class="dr-link">Paper.setFinish</a> will be added to the set.
1365 </p>
1366 <p class="header">Usage
1367 </p>
1368 <pre class="javascript code"><code>paper.setStart();
1369 paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
1370 paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
1371 <b>var</b> st<span class="s"> = </span>paper.setFinish();
1372 st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
1373 </code></pre>
1374 </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 2962 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2962">&#x27ad;</a></h3>
1375 <div class="extra" id="Paper.setViewBox-extra"></div></div><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 
1376 specifying new boundaries.
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">new x position, default is <code>0</code></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">new y position, default is <code>0</code></dd>
1386 <dt class="dr-param">w</dt>
1387 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1388 <dd class="dr-description">new width of the canvas</dd>
1389 <dt class="dr-param">h</dt>
1390 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1391 <dd class="dr-description">new height of the canvas</dd>
1392 <dt class="dr-param">fit</dt>
1393 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
1394 <dd class="dr-description"><code>true</code> if you want graphics to fit into new boundary box</dd>
1395 </dl>
1396 </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 2868 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2868">&#x27ad;</a></h3>
1397 <div class="extra" id="Paper.text-extra"></div></div><div class="dr-method"><p>Draws a text string. If you need line breaks, put “\n” in the string.
1398 </p>
1399 <p class="header">Parameters
1400 </p>
1401 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1402 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1403 <dd class="dr-description">x coordinate position</dd>
1404 <dt class="dr-param">y</dt>
1405 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1406 <dd class="dr-description">y coordinate position</dd>
1407 <dt class="dr-param">text</dt>
1408 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1409 <dd class="dr-description">The text string to draw</dd>
1410 </dl>
1411 <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>
1412 <p class="header">Usage
1413 </p>
1414 <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>);
1415 </code></pre>
1416 </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 2971 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2971">&#x27ad;</a></h3>
1417 <div class="extra" id="Paper.top-extra"></div></div><div class="dr-property"><p>Points to the topmost element on the paper
1418 </p>
1419 </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/master/raphael.core.js#L59">&#x27ad;</a></h2>
1420 <div class="extra" id="Raphael-extra"></div></div><div class="dr-method"><p>Creates a canvas object on which to draw.
1421 You must do this first, as all future calls to drawing methods
1422 from this instance will be bound to this canvas.
1423 </p>
1424 <p class="header">Parameters
1425 </p>
1426 <dl class="dr-parameters"><dt class="dr-param">container</dt>
1427 <dd class="dr-type"><em class="dr-type-HTMLElement">HTMLElement</em> <em class="dr-type-string">string</em></dd>
1428 <dd class="dr-description">DOM element or its ID which is going to be a parent for drawing surface</dd>
1429 <dt class="dr-param">width</dt>
1430 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1431 <dd class="dr-description">&#160;</dd>
1432 <dt class="dr-param">height</dt>
1433 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1434 <dd class="dr-description">&#160;</dd>
1435 <dt class="dr-param optional">callback</dt>
1436 <dd class="dr-optional">optional</dd>
1437 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1438 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1439 </dl>
1440 <p>or
1441 </p>
1442 <dl class="dr-parameters"><dt class="dr-param">x</dt>
1443 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1444 <dd class="dr-description">&#160;</dd>
1445 <dt class="dr-param">y</dt>
1446 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1447 <dd class="dr-description">&#160;</dd>
1448 <dt class="dr-param">width</dt>
1449 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1450 <dd class="dr-description">&#160;</dd>
1451 <dt class="dr-param">height</dt>
1452 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1453 <dd class="dr-description">&#160;</dd>
1454 <dt class="dr-param optional">callback</dt>
1455 <dd class="dr-optional">optional</dd>
1456 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1457 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1458 </dl>
1459 <p>or
1460 </p>
1461 <dl class="dr-parameters"><dt class="dr-param">all</dt>
1462 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
1463 <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>}). See <a href="#Paper.add" class="dr-link">Paper.add</a>.</dd>
1464 <dt class="dr-param optional">callback</dt>
1465 <dd class="dr-optional">optional</dd>
1466 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1467 <dd class="dr-description">callback function which is going to be executed in the context of newly created paper</dd>
1468 </dl>
1469 <p>or
1470 </p>
1471 <dl class="dr-parameters"><dt class="dr-param">onReadyCallback</dt>
1472 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1473 <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>
1474 </dl>
1475 <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>
1476 <p class="header">Usage
1477 </p>
1478 <pre class="javascript code"><code><span class="c">// Each of the following examples create a canvas</span>
1479 <span class="c">// that is 320px wide by 200px high.</span>
1480 <span class="c">// Canvas is created at the viewport’s <span class="d">10</span>,<span class="d">50</span> coordinate.</span>
1481 <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>);
1482 <span class="c">// Canvas is created at the top left corner of the #notepad element</span>
1483 <span class="c">// (or its top right corner <b>in</b> dir=<i>"rtl"</i> elements)</span>
1484 <b>var</b> paper<span class="s"> = </span>Raphael(document.getElementById(<i>"notepad"</i>), <span class="d">320</span>, <span class="d">200</span>);
1485 <span class="c">// Same as above</span>
1486 <b>var</b> paper<span class="s"> = </span>Raphael(<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>);
1487 <span class="c">// Image dump</span>
1488 <b>var</b> set<span class="s"> = </span>Raphael([<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>, {
1489     type: <i>"rect"</i>,
1490     x: <span class="d">10</span>,
1491     y: <span class="d">10</span>,
1492     width: <span class="d">25</span>,
1493     height: <span class="d">25</span>,
1494     stroke: <i>"#f00"</i>
1495 }, {
1496     type: <i>"text"</i>,
1497     x: <span class="d">30</span>,
1498     y: <span class="d">40</span>,
1499     text: <i>"Dump"</i>
1500 }]);
1501 </code></pre>
1502 </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 401 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L401">&#x27ad;</a></h3>
1503 <div class="extra" id="Raphael.angle-extra"></div></div><div class="dr-method"><p>Returns angle between two or three points
1504 </p>
1505 <p class="header">Parameters
1506 </p>
1507 <dl class="dr-parameters"><dt class="dr-param">x1</dt>
1508 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1509 <dd class="dr-description">x coord of first point</dd>
1510 <dt class="dr-param">y1</dt>
1511 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1512 <dd class="dr-description">y coord of first point</dd>
1513 <dt class="dr-param">x2</dt>
1514 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1515 <dd class="dr-description">x coord of second point</dd>
1516 <dt class="dr-param">y2</dt>
1517 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1518 <dd class="dr-description">y coord of second point</dd>
1519 <dt class="dr-param optional">x3</dt>
1520 <dd class="dr-optional">optional</dd>
1521 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1522 <dd class="dr-description">x coord of third point</dd>
1523 <dt class="dr-param optional">y3</dt>
1524 <dd class="dr-optional">optional</dd>
1525 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1526 <dd class="dr-description">y coord of third point</dd>
1527 </dl>
1528 <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>
1529 </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 3954 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3954">&#x27ad;</a></h3>
1530 <div class="extra" id="Raphael.animation-extra"></div></div><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.
1531 See also <a href="#Animation.delay" class="dr-link">Animation.delay</a> and <a href="#Animation.repeat" class="dr-link">Animation.repeat</a> methods.
1532 </p>
1533 <p class="header">Parameters
1534 </p>
1535 <dl class="dr-parameters"><dt class="dr-param">params</dt>
1536 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1537 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
1538 <dt class="dr-param">ms</dt>
1539 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1540 <dd class="dr-description">number of milliseconds for animation to run</dd>
1541 <dt class="dr-param optional">easing</dt>
1542 <dd class="dr-optional">optional</dd>
1543 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1544 <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>
1545 <dt class="dr-param optional">callback</dt>
1546 <dd class="dr-optional">optional</dd>
1547 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1548 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
1549 </dl>
1550 <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>
1551 </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 600 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L600">&#x27ad;</a></h3>
1552 <div class="extra" id="Raphael.color-extra"></div></div><div class="dr-method"><p>Parses the color string and returns object with all values for the given color.
1553 </p>
1554 <p class="header">Parameters
1555 </p>
1556 <dl class="dr-parameters"><dt class="dr-param">clr</dt>
1557 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1558 <dd class="dr-description">color string in one of the supported formats (see <a href="#Raphael.getRGB" class="dr-link">Raphael.getRGB</a>)</dd>
1559 </dl>
1560 <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>
1561 <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>
1562 <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>
1563 <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>
1564 <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>
1565 <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>
1566 <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>
1567 <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>
1568 <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>
1569 <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>
1570 </ol></li><li>}</li></ol>
1571 </div><div class="Raphael-createUUID-section"><h3 id="Raphael.createUUID" class="dr-method"><i class="dr-trixie">&#160;</i>Raphael.createUUID()<a href="#Raphael.createUUID" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 474 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L474">&#x27ad;</a></h3>
1572 <div class="extra" id="Raphael.createUUID-extra"></div></div><div class="dr-method"><p>Returns RFC4122, version 4 ID
1573 </p>
1574 </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 434 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L434">&#x27ad;</a></h3>
1575 <div class="extra" id="Raphael.deg-extra"></div></div><div class="dr-method"><p>Transform angle to degrees
1576 </p>
1577 <p class="header">Parameters
1578 </p>
1579 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1580 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1581 <dd class="dr-description">angle in radians</dd>
1582 </dl>
1583 <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>
1584 </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 3395 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3395">&#x27ad;</a></h3>
1585 <div class="extra" id="Raphael.easing_formulas-extra"></div></div><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:
1586 </p>
1587 <ul>
1588     <li>“linear”</li>
1589     <li>“&lt;” or “easeIn” or “ease-in”</li>
1590     <li>“>” or “easeOut” or “ease-out”</li>
1591     <li>“&lt;>” or “easeInOut” or “ease-in-out”</li>
1592     <li>“backIn” or “back-in”</li>
1593     <li>“backOut” or “back-out”</li>
1594     <li>“elastic”</li>
1595     <li>“bounce”</li>
1596 </ul>
1597 <p>See also <a href="http://raphaeljs.com/easing.html">Easing demo</a>.</p>
1598 </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 2330 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L2330">&#x27ad;</a></h3>
1599 <div class="extra" id="Raphael.el-extra"></div></div><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
1600 want to wrap some common transformation or attributes in one method. In difference to canvas methods,
1601 you can redefine element method at any time. Expending element methods wouldn’t affect set.
1602 </p>
1603 <p class="header">Usage
1604 </p>
1605 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
1606     <b>this</b>.attr({fill: <i>"#f00"</i>});
1607 };
1608 <span class="c">// then use it</span>
1609 paper.circle(<span class="d">100</span>, <span class="d">100</span>, <span class="d">20</span>).red();
1610 </code></pre>
1611 </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 1141 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1141">&#x27ad;</a></h3>
1612 <div class="extra" id="Raphael.findDotsAtSegment-extra"></div></div><div class="dr-method"><p>Utility method
1613 Find dot coordinates on the given cubic bezier curve at the given t.
1614 </p>
1615 <p class="header">Parameters
1616 </p>
1617 <dl class="dr-parameters"><dt class="dr-param">p1x</dt>
1618 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1619 <dd class="dr-description">x of the first point of the curve</dd>
1620 <dt class="dr-param">p1y</dt>
1621 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1622 <dd class="dr-description">y of the first point of the curve</dd>
1623 <dt class="dr-param">c1x</dt>
1624 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1625 <dd class="dr-description">x of the first anchor of the curve</dd>
1626 <dt class="dr-param">c1y</dt>
1627 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1628 <dd class="dr-description">y of the first anchor of the curve</dd>
1629 <dt class="dr-param">c2x</dt>
1630 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1631 <dd class="dr-description">x of the second anchor of the curve</dd>
1632 <dt class="dr-param">c2y</dt>
1633 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1634 <dd class="dr-description">y of the second anchor of the curve</dd>
1635 <dt class="dr-param">p2x</dt>
1636 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1637 <dd class="dr-description">x of the second point of the curve</dd>
1638 <dt class="dr-param">p2y</dt>
1639 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1640 <dd class="dr-description">y of the second point of the curve</dd>
1641 <dt class="dr-param">t</dt>
1642 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1643 <dd class="dr-description">position on the curve (0..1)</dd>
1644 </dl>
1645 <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>
1646 <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>
1647 <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>
1648 <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>
1649 <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>
1650 </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>
1651 <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>
1652 </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>
1653 <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>
1654 </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>
1655 <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>
1656 </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>
1657 </ol></li><li>}</li></ol>
1658 </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 360 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L360">&#x27ad;</a></h3>
1659 <div class="extra" id="Raphael.fn-extra"></div></div><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,
1660 you can create your own pie chart function and ship it as a Raphaël plugin. To do this
1661 you need to extend the <code>Raphael.fn</code> object. You should modify the <code>fn</code> object before a
1662 Raphaël instance is created, otherwise it will take no effect. Please note that the
1663 ability for namespaced plugins was removed in Raphael 2.0. It is up to the plugin to
1664 ensure any namespacing ensures proper context.
1665 </p>
1666 <p class="header">Usage
1667 </p>
1668 <pre class="javascript code"><code>Raphael.fn.arrow<span class="s"> = </span><b>function</b> (x1, y1, x2, y2, size) {
1669     <b>return</b> <b>this</b>.path( ... );
1670 };
1671 <span class="c">// or create namespace</span>
1672 Raphael.fn.mystuff<span class="s"> = </span>{
1673     arrow: <b>function</b> () {…},
1674     star: <b>function</b> () {…},
1675     <span class="c">// etc…</span>
1676 };
1677 <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>);
1678 <span class="c">// then use it</span>
1679 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>});
1680 paper.mystuff.arrow();
1681 paper.mystuff.star();
1682 </code></pre>
1683 </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 4570 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4570">&#x27ad;</a></h3>
1684 <div class="extra" id="Raphael.format-extra"></div></div><div class="dr-method"><p>Simple format function. Replaces construction of type “<code>{&lt;number>}</code>” to the corresponding argument.
1685 </p>
1686 <p class="header">Parameters
1687 </p>
1688 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1689 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1690 <dd class="dr-description">string to format</dd>
1691 <dt class="dr-param">…</dt>
1692 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1693 <dd class="dr-description">rest of arguments will be treated as parameters for replacement</dd>
1694 </dl>
1695 <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>
1696 <p class="header">Usage
1697 </p>
1698 <pre class="javascript code"><code><b>var</b> x<span class="s"> = </span><span class="d">10</span>,
1699     y<span class="s"> = </span><span class="d">20</span>,
1700     width<span class="s"> = </span><span class="d">40</span>,
1701     height<span class="s"> = </span><span class="d">50</span>;
1702 <span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1703 paper.path(Raphael.format(<i>"M{<span class="d">0</span>},{<span class="d">1</span>}h{<span class="d">2</span>}v{<span class="d">3</span>}h{<span class="d">4</span>}z"</i>, x, y, width, height, -width));
1704 </code></pre>
1705 </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 4600 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4600">&#x27ad;</a></h3>
1706 <div class="extra" id="Raphael.fullfill-extra"></div></div><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.
1707 </p>
1708 <p class="header">Parameters
1709 </p>
1710 <dl class="dr-parameters"><dt class="dr-param">token</dt>
1711 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1712 <dd class="dr-description">string to format</dd>
1713 <dt class="dr-param">json</dt>
1714 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1715 <dd class="dr-description">object which properties will be used as a replacement</dd>
1716 </dl>
1717 <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>
1718 <p class="header">Usage
1719 </p>
1720 <pre class="javascript code"><code><span class="c">// <b>this</b> will draw a rectangular shape equivalent to <i>"M10,20h40v50h-40z"</i></span>
1721 paper.path(Raphael.format(<i>"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z"</i>, {
1722     x: <span class="d">10</span>,
1723     y: <span class="d">20</span>,
1724     dim: {
1725         width: <span class="d">40</span>,
1726         height: <span class="d">50</span>,
1727         <i>"negative width"</i>: -<span class="d">40</span>
1728     }
1729 }));
1730 </code></pre>
1731 </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 976 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L976">&#x27ad;</a></h3>
1732 <div class="extra" id="Raphael.getColor-extra"></div></div><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>
1733 </p>
1734 <p class="header">Parameters
1735 </p>
1736 <dl class="dr-parameters"><dt class="dr-param optional">value</dt>
1737 <dd class="dr-optional">optional</dd>
1738 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1739 <dd class="dr-description">brightness, default is <code>0.75</code></dd>
1740 </dl>
1741 <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>
1742 </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 993 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L993">&#x27ad;</a></h4>
1743 <div class="extra" id="Raphael.getColor.reset-extra"></div></div><div class="dr-method"><p>Resets spectrum position for <a href="#Raphael.getColor" class="dr-link">Raphael.getColor</a> back to red.
1744 </p>
1745 </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 3304 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3304">&#x27ad;</a></h3>
1746 <div class="extra" id="Raphael.getPointAtLength-extra"></div></div><div class="dr-method"><p>Return coordinates of the point located at the given length on the given path.
1747 </p>
1748 <p class="header">Parameters
1749 </p>
1750 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1751 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1752 <dd class="dr-description">SVG path string</dd>
1753 <dt class="dr-param">length</dt>
1754 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1755 <dd class="dr-description">&#160;</dd>
1756 </dl>
1757 <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>
1758 <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>
1759 <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>
1760 <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>
1761 </ol></li><li>}</li></ol>
1762 </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 854 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L854">&#x27ad;</a></h3>
1763 <div class="extra" id="Raphael.getRGB-extra"></div></div><div class="dr-method"><p>Parses colour string as RGB object
1764 </p>
1765 <p class="header">Parameters
1766 </p>
1767 <dl class="dr-parameters"><dt class="dr-param">colour</dt>
1768 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1769 <dd class="dr-description">colour string in one of formats:</dd>
1770 </dl>
1771 <ul>
1772     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
1773     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
1774     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
1775     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
1776     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
1777     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
1778     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
1779     <li>hsl(•••, •••, •••) — same as hsb</li>
1780     <li>hsl(•••%, •••%, •••%) — same as hsb</li>
1781 </ul>
1782 <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>
1783 <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>
1784 <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>
1785 <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>
1786 <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>
1787 <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>
1788 </ol></li><li>}</li></ol>
1789 </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 3319 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3319">&#x27ad;</a></h3>
1790 <div class="extra" id="Raphael.getSubpath-extra"></div></div><div class="dr-method"><p>Return subpath of a given path from given length to given length.
1791 </p>
1792 <p class="header">Parameters
1793 </p>
1794 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1795 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1796 <dd class="dr-description">SVG path string</dd>
1797 <dt class="dr-param">from</dt>
1798 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1799 <dd class="dr-description">position of the start of the segment</dd>
1800 <dt class="dr-param">to</dt>
1801 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1802 <dd class="dr-description">position of the end of the segment</dd>
1803 </dl>
1804 <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>
1805 </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 3285 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3285">&#x27ad;</a></h3>
1806 <div class="extra" id="Raphael.getTotalLength-extra"></div></div><div class="dr-method"><p>Returns length of the given path in pixels.
1807 </p>
1808 <p class="header">Parameters
1809 </p>
1810 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1811 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1812 <dd class="dr-description">SVG path string.</dd>
1813 </dl>
1814 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
1815 </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 936 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L936">&#x27ad;</a></h3>
1816 <div class="extra" id="Raphael.hsb-extra"></div></div><div class="dr-method"><p>Converts HSB values to hex representation of the colour.
1817 </p>
1818 <p class="header">Parameters
1819 </p>
1820 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1821 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1822 <dd class="dr-description">hue</dd>
1823 <dt class="dr-param">s</dt>
1824 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1825 <dd class="dr-description">saturation</dd>
1826 <dt class="dr-param">b</dt>
1827 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1828 <dd class="dr-description">value or brightness</dd>
1829 </dl>
1830 <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>
1831 </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 650 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L650">&#x27ad;</a></h3>
1832 <div class="extra" id="Raphael.hsb2rgb-extra"></div></div><div class="dr-method"><p>Converts HSB values to RGB object.
1833 </p>
1834 <p class="header">Parameters
1835 </p>
1836 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1837 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1838 <dd class="dr-description">hue</dd>
1839 <dt class="dr-param">s</dt>
1840 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1841 <dd class="dr-description">saturation</dd>
1842 <dt class="dr-param">v</dt>
1843 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1844 <dd class="dr-description">value or brightness</dd>
1845 </dl>
1846 <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>
1847 <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>
1848 <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>
1849 <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>
1850 <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>
1851 </ol></li><li>}</li></ol>
1852 </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 950 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L950">&#x27ad;</a></h3>
1853 <div class="extra" id="Raphael.hsl-extra"></div></div><div class="dr-method"><p>Converts HSL values to hex representation of the colour.
1854 </p>
1855 <p class="header">Parameters
1856 </p>
1857 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1858 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1859 <dd class="dr-description">hue</dd>
1860 <dt class="dr-param">s</dt>
1861 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1862 <dd class="dr-description">saturation</dd>
1863 <dt class="dr-param">l</dt>
1864 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1865 <dd class="dr-description">luminosity</dd>
1866 </dl>
1867 <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>
1868 </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 687 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L687">&#x27ad;</a></h3>
1869 <div class="extra" id="Raphael.hsl2rgb-extra"></div></div><div class="dr-method"><p>Converts HSL values to RGB object.
1870 </p>
1871 <p class="header">Parameters
1872 </p>
1873 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1874 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1875 <dd class="dr-description">hue</dd>
1876 <dt class="dr-param">s</dt>
1877 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1878 <dd class="dr-description">saturation</dd>
1879 <dt class="dr-param">l</dt>
1880 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1881 <dd class="dr-description">luminosity</dd>
1882 </dl>
1883 <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>
1884 <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>
1885 <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>
1886 <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>
1887 <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>
1888 </ol></li><li>}</li></ol>
1889 </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 373 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L373">&#x27ad;</a></h3>
1890 <div class="extra" id="Raphael.is-extra"></div></div><div class="dr-method"><p>Handfull replacement for <code>typeof</code> operator.
1891 </p>
1892 <p class="header">Parameters
1893 </p>
1894 <dl class="dr-parameters"><dt class="dr-param">o</dt>
1895 <dd class="dr-type"><em class="dr-type-…">…</em></dd>
1896 <dd class="dr-description">any object or primitive</dd>
1897 <dt class="dr-param">type</dt>
1898 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1899 <dd class="dr-description">name of the type, i.e. “string”, “function”, “number”, etc.</dd>
1900 </dl>
1901 <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>
1902 </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 1929 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1929">&#x27ad;</a></h3>
1903 <div class="extra" id="Raphael.matrix-extra"></div></div><div class="dr-method"><p>Utility method
1904 Returns matrix based on given parameters.
1905 </p>
1906 <p class="header">Parameters
1907 </p>
1908 <dl class="dr-parameters"><dt class="dr-param">a</dt>
1909 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1910 <dd class="dr-description">&#160;</dd>
1911 <dt class="dr-param">b</dt>
1912 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1913 <dd class="dr-description">&#160;</dd>
1914 <dt class="dr-param">c</dt>
1915 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1916 <dd class="dr-description">&#160;</dd>
1917 <dt class="dr-param">d</dt>
1918 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1919 <dd class="dr-description">&#160;</dd>
1920 <dt class="dr-param">e</dt>
1921 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1922 <dd class="dr-description">&#160;</dd>
1923 <dt class="dr-param">f</dt>
1924 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1925 <dd class="dr-description">&#160;</dd>
1926 </dl>
1927 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span></p>
1928 </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 4637 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4637">&#x27ad;</a></h3>
1929 <div class="extra" id="Raphael.ninja-extra"></div></div><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.
1930 Beware, that in this case plugins could stop working, because they are depending on global variable existance.
1931 </p>
1932 <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>
1933 <p class="header">Usage
1934 </p>
1935 <pre class="javascript code"><code>(<b>function</b> (local_raphael) {
1936     <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>);
1937     …
1938 })(Raphael.ninja());
1939 </code></pre>
1940 </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 1034 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1034">&#x27ad;</a></h3>
1941 <div class="extra" id="Raphael.parsePathString-extra"></div></div><div class="dr-method"><p>Utility method
1942 Parses given path string into an array of arrays of path segments.
1943 </p>
1944 <p class="header">Parameters
1945 </p>
1946 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1947 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1948 <dd class="dr-description">path string or array of segments (in the last case it will be returned straight away)</dd>
1949 </dl>
1950 <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>
1951 </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 1079 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1079">&#x27ad;</a></h3>
1952 <div class="extra" id="Raphael.parseTransformString-extra"></div></div><div class="dr-method"><p>Utility method
1953 Parses given path string into an array of transformations.
1954 </p>
1955 <p class="header">Parameters
1956 </p>
1957 <dl class="dr-parameters"><dt class="dr-param">TString</dt>
1958 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1959 <dd class="dr-description">transform string or array of transformations (in the last case it will be returned straight away)</dd>
1960 </dl>
1961 <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>
1962 </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 1912 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1912">&#x27ad;</a></h3>
1963 <div class="extra" id="Raphael.path2curve-extra"></div></div><div class="dr-method"><p>Utility method
1964 Converts path to a new path where all segments are cubic bezier curves.
1965 </p>
1966 <p class="header">Parameters
1967 </p>
1968 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1969 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1970 <dd class="dr-description">path string or array of segments</dd>
1971 </dl>
1972 <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>
1973 </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 1899 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L1899">&#x27ad;</a></h3>
1974 <div class="extra" id="Raphael.pathToRelative-extra"></div></div><div class="dr-method"><p>Utility method
1975 Converts path to relative form
1976 </p>
1977 <p class="header">Parameters
1978 </p>
1979 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1980 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1981 <dd class="dr-description">path string or array of segments</dd>
1982 </dl>
1983 <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>
1984 </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 422 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L422">&#x27ad;</a></h3>
1985 <div class="extra" id="Raphael.rad-extra"></div></div><div class="dr-method"><p>Transform angle to radians
1986 </p>
1987 <p class="header">Parameters
1988 </p>
1989 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1990 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1991 <dd class="dr-description">angle in degrees</dd>
1992 </dl>
1993 <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>
1994 </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 4375 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4375">&#x27ad;</a></h3>
1995 <div class="extra" id="Raphael.registerFont-extra"></div></div><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.
1996 Returns original parameter, so it could be used with chaining.
1997 </p>
1998 <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>
1999 <p class="header">Parameters
2000 </p>
2001 <dl class="dr-parameters"><dt class="dr-param">font</dt>
2002 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2003 <dd class="dr-description">the font to register</dd>
2004 </dl>
2005 <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>
2006 <p class="header">Usage
2007 </p>
2008 <pre class="javascript code"><code>Cufon.registerFont(Raphael.registerFont({…}));
2009 </code></pre>
2010 </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 964 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L964">&#x27ad;</a></h3>
2011 <div class="extra" id="Raphael.rgb-extra"></div></div><div class="dr-method"><p>Converts RGB values to hex representation of the colour.
2012 </p>
2013 <p class="header">Parameters
2014 </p>
2015 <dl class="dr-parameters"><dt class="dr-param">r</dt>
2016 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2017 <dd class="dr-description">red</dd>
2018 <dt class="dr-param">g</dt>
2019 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2020 <dd class="dr-description">green</dd>
2021 <dt class="dr-param">b</dt>
2022 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2023 <dd class="dr-description">blue</dd>
2024 </dl>
2025 <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>
2026 </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 727 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L727">&#x27ad;</a></h3>
2027 <div class="extra" id="Raphael.rgb2hsb-extra"></div></div><div class="dr-method"><p>Converts RGB values to HSB object.
2028 </p>
2029 <p class="header">Parameters
2030 </p>
2031 <dl class="dr-parameters"><dt class="dr-param">r</dt>
2032 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2033 <dd class="dr-description">red</dd>
2034 <dt class="dr-param">g</dt>
2035 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2036 <dd class="dr-description">green</dd>
2037 <dt class="dr-param">b</dt>
2038 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2039 <dd class="dr-description">blue</dd>
2040 </dl>
2041 <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>
2042 <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>
2043 <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>
2044 <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>
2045 </ol></li><li>}</li></ol>
2046 </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 761 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L761">&#x27ad;</a></h3>
2047 <div class="extra" id="Raphael.rgb2hsl-extra"></div></div><div class="dr-method"><p>Converts RGB values to HSL object.
2048 </p>
2049 <p class="header">Parameters
2050 </p>
2051 <dl class="dr-parameters"><dt class="dr-param">r</dt>
2052 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2053 <dd class="dr-description">red</dd>
2054 <dt class="dr-param">g</dt>
2055 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2056 <dd class="dr-description">green</dd>
2057 <dt class="dr-param">b</dt>
2058 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2059 <dd class="dr-description">blue</dd>
2060 </dl>
2061 <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>
2062 <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>
2063 <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>
2064 <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>
2065 </ol></li><li>}</li></ol>
2066 </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 492 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L492">&#x27ad;</a></h3>
2067 <div class="extra" id="Raphael.setWindow-extra"></div></div><div class="dr-method"><p>Used when you need to draw in <code>&lt;iframe></code>. Switched window to the iframe one.
2068 </p>
2069 <p class="header">Parameters
2070 </p>
2071 <dl class="dr-parameters"><dt class="dr-param">newwin</dt>
2072 <dd class="dr-type"><em class="dr-type-window">window</em></dd>
2073 <dd class="dr-description">new window object</dd>
2074 </dl>
2075 </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 448 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L448">&#x27ad;</a></h3>
2076 <div class="extra" id="Raphael.snapTo-extra"></div></div><div class="dr-method"><p>Snaps given value to given grid.
2077 </p>
2078 <p class="header">Parameters
2079 </p>
2080 <dl class="dr-parameters"><dt class="dr-param">values</dt>
2081 <dd class="dr-type"><em class="dr-type-array">array</em> <em class="dr-type-number">number</em></dd>
2082 <dd class="dr-description">given array of values or step of the grid</dd>
2083 <dt class="dr-param">value</dt>
2084 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2085 <dd class="dr-description">value to adjust</dd>
2086 <dt class="dr-param optional">tolerance</dt>
2087 <dd class="dr-optional">optional</dd>
2088 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2089 <dd class="dr-description">tolerance for snapping. Default is <code>10</code>.</dd>
2090 </dl>
2091 <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>
2092 </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 4661 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4661">&#x27ad;</a></h3>
2093 <div class="extra" id="Raphael.st-extra"></div></div><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
2094 you added, so you will be able to call the same method on sets too.
2095 See also <a href="#Raphael.el" class="dr-link">Raphael.el</a>.
2096 </p>
2097 <p class="header">Usage
2098 </p>
2099 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
2100     <b>this</b>.attr({fill: <i>"#f00"</i>});
2101 };
2102 Raphael.st.red<span class="s"> = </span><b>function</b> () {
2103     <b>this</b>.forEach(<b>function</b> () {
2104         <b>this</b>.red();
2105     });
2106 };
2107 <span class="c">// then use it</span>
2108 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();
2109 </code></pre>
2110 </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 326 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L326">&#x27ad;</a></h3>
2111 <div class="extra" id="Raphael.svg-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports SVG.
2112 </p>
2113 </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 308 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L308">&#x27ad;</a></h3>
2114 <div class="extra" id="Raphael.type-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Can be “SVG”, “VML” or empty, depending on browser support.
2115 </p>
2116 </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 332 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L332">&#x27ad;</a></h3>
2117 <div class="extra" id="Raphael.vml-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports VML.
2118 </p>
2119 </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>
2120 <div class="extra" id="Set-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 4239 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4239">&#x27ad;</a></h3>
2121 <div class="extra" id="Set.clear-extra"></div></div><div class="dr-method"><p>Removeds all elements from the set
2122 </p>
2123 </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 4294 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4294">&#x27ad;</a></h3>
2124 <div class="extra" id="Set.exclude-extra"></div></div><div class="dr-method"><p>Removes given element from the set
2125 </p>
2126 <p class="header">Parameters
2127 </p>
2128 <dl class="dr-parameters"><dt class="dr-param">element</dt>
2129 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2130 <dd class="dr-description">element to remove</dd>
2131 </dl>
2132 <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>
2133 </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 4203 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4203">&#x27ad;</a></h3>
2134 <div class="extra" id="Set.forEach-extra"></div></div><div class="dr-method"><p>Executes given function for each element in the set.
2135 </p>
2136 <p>If function returns <code>false</code> it will stop loop running.
2137 </p>
2138 <p class="header">Parameters
2139 </p>
2140 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
2141 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2142 <dd class="dr-description">function to run</dd>
2143 <dt class="dr-param">thisArg</dt>
2144 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2145 <dd class="dr-description">context object for the callback</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 object</span></p>
2148 </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 4185 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4185">&#x27ad;</a></h3>
2149 <div class="extra" id="Set.pop-extra"></div></div><div class="dr-method"><p>Removes last element and returns it.
2150 </p>
2151 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">element</span></p>
2152 </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 4165 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4165">&#x27ad;</a></h3>
2153 <div class="extra" id="Set.push-extra"></div></div><div class="dr-method"><p>Adds each argument to the current set.
2154 </p>
2155 <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>
2156 </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 4257 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4257">&#x27ad;</a></h3>
2157 <div class="extra" id="Set.splice-extra"></div></div><div class="dr-method"><p>Removes given element from the set
2158 </p>
2159 <p class="header">Parameters
2160 </p>
2161 <dl class="dr-parameters"><dt class="dr-param">index</dt>
2162 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2163 <dd class="dr-description">position of the deletion</dd>
2164 <dt class="dr-param">count</dt>
2165 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
2166 <dd class="dr-description">number of element to remove</dd>
2167 <dt class="dr-param optional">insertion…</dt>
2168 <dd class="dr-optional">optional</dd>
2169 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2170 <dd class="dr-description">elements to insert</dd>
2171 </dl>
2172 <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>
2173 </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>
2174 <div class="extra" id="eve-extra"></div></div><div class="dr-method"><p>Fires event with given <code>name</code>, given scope and other parameters.
2175 </p>
2176 <p class="header">Arguments
2177 </p>
2178 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2179 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2180 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2181 <dt class="dr-param">scope</dt>
2182 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
2183 <dd class="dr-description">context for the event handlers</dd>
2184 <dt class="dr-param">varargs</dt>
2185 <dd class="dr-type"><em class="dr-type-...">...</em></dd>
2186 <dd class="dr-description">the rest of arguments will be sent to event handlers</dd>
2187 </dl>
2188 <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>
2189 </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 107 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L107">&#x27ad;</a></h3>
2190 <div class="extra" id="eve.listeners-extra"></div></div><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>.
2191 </p>
2192 <p class="header">Arguments
2193 </p>
2194 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2195 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2196 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated</dd>
2197 </dl>
2198 <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>
2199 </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 204 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L204">&#x27ad;</a></h3>
2200 <div class="extra" id="eve.nt-extra"></div></div><div class="dr-method"><p>Could be used inside event handler to figure out actual name of the event.
2201 </p>
2202 <p class="header">Arguments
2203 </p>
2204 <dl class="dr-parameters"><dt class="dr-param optional">subname</dt>
2205 <dd class="dr-optional">optional</dd>
2206 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2207 <dd class="dr-description">subname of the event</dd>
2208 </dl>
2209 <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>
2210 <p>or
2211 </p>
2212 <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>
2213 </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 162 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L162">&#x27ad;</a></h3>
2214 <div class="extra" id="eve.on-extra"></div></div><div class="dr-method"><p>Binds given event handler with a given name. You can use wildcards “<code>*</code>” for the names:
2215 </p>
2216 <pre class="javascript code"><code>eve.on(<i>"*.under.*"</i>, f);
2217 eve(<i>"mouse.under.floor"</i>); <span class="c">// triggers f</span>
2218 </code></pre>
2219 <p>Use <a href="#eve" class="dr-link">eve</a> to trigger the listener.
2220 </p>
2221 <p class="header">Arguments
2222 </p>
2223 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2224 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2225 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2226 <dt class="dr-param">f</dt>
2227 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2228 <dd class="dr-description">event handler function</dd>
2229 </dl>
2230 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-function">function</em> <span class="dr-description">returned function accepts a single numeric parameter that represents z-index of the handler. It is an 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>
2231 <p class="header">Example:
2232 </p>
2233 <pre class="javascript code"><code>eve.on(<i>"mouse"</i>, eat)(<span class="d">2</span>);
2234 eve.on(<i>"mouse"</i>, scream);
2235 eve.on(<i>"mouse"</i>, <b>catch</b>)(<span class="d">1</span>);
2236 </code></pre>
2237 <p>This will ensure that <code>catch</code> function will be called before <code>eat</code>.
2238 If you want to put your handler before non-indexed handlers, specify a negative value.
2239 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”.
2240 </p>
2241 </div><div class="eve-once-section"><h3 id="eve.once" class="dr-method"><i class="dr-trixie">&#160;</i>eve.once(name, f)<a href="#eve.once" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 290 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L290">&#x27ad;</a></h3>
2242 <div class="extra" id="eve.once-extra"></div></div><div class="dr-method"><p>Binds given event handler with a given name to only run once then unbind itself.
2243 </p>
2244 <pre class="javascript code"><code>eve.once(<i>"login"</i>, f);
2245 eve(<i>"login"</i>); <span class="c">// triggers f</span>
2246 eve(<i>"login"</i>); <span class="c">// no listeners</span>
2247 </code></pre>
2248 <p>Use <a href="#eve" class="dr-link">eve</a> to trigger the listener.
2249 </p>
2250 <p class="header">Arguments
2251 </p>
2252 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2253 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2254 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2255 <dt class="dr-param">f</dt>
2256 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2257 <dd class="dr-description">event handler function</dd>
2258 </dl>
2259 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-function">function</em> <span class="dr-description">same return function as <a href="#eve.on" class="dr-link">eve.on</a></span></p>
2260 </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 187 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L187">&#x27ad;</a></h3>
2261 <div class="extra" id="eve.stop-extra"></div></div><div class="dr-method"><p>Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
2262 </p>
2263 </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 221 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L221">&#x27ad;</a></h3>
2264 <div class="extra" id="eve.unbind-extra"></div></div><div class="dr-method"><p>Removes given function from the list of event listeners assigned to given name.
2265 </p>
2266 <p class="header">Arguments
2267 </p>
2268 <dl class="dr-parameters"><dt class="dr-param">name</dt>
2269 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
2270 <dd class="dr-description">name of the event, dot (<code>.</code>) or slash (<code>/</code>) separated, with optional wildcards</dd>
2271 <dt class="dr-param">f</dt>
2272 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
2273 <dd class="dr-description">event handler function</dd>
2274 </dl>
2275 </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 303 in the source" href="https://github.com/DmitryBaranovskiy/eve/blob/master/eve.js#L303">&#x27ad;</a></h3>
2276 <div class="extra" id="eve.version-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Current version of the library.
2277 </p>
2278 </div></div></div>
2279 <script src="raphael.js"></script>
2280 <script src="reference.js"></script>
2281 </body></html>