Small fix to glow and animation.
[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"></head><body id="dr-js"><div id="dr"><ol class="dr-toc"><li class="dr-lvl0"><a href="#Animation" class="undefined"><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="undefined"><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.clone" class="dr-method"><span>Element.clone()</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.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.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.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.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-lvl0"><a href="#Paper" class="undefined"><span>Paper</span></a></li><li class="dr-lvl1"><a href="#Paper.bottom" class="dr-property"><span>Paper.bottom</span></a></li><li class="dr-lvl1"><a href="#Paper.circle" class="dr-method"><span>Paper.circle()</span></a></li><li class="dr-lvl1"><a href="#Paper.clear" class="dr-method"><span>Paper.clear()</span></a></li><li class="dr-lvl1"><a href="#Paper.customAttributes" class="dr-property"><span>Paper.customAttributes</span></a></li><li class="dr-lvl1"><a href="#Paper.ellipse" class="dr-method"><span>Paper.ellipse()</span></a></li><li class="dr-lvl1"><a href="#Paper.forEach" class="dr-method"><span>Paper.forEach()</span></a></li><li class="dr-lvl1"><a href="#Paper.getById" class="dr-method"><span>Paper.getById()</span></a></li><li class="dr-lvl1"><a href="#Paper.getElementByPoint" class="dr-method"><span>Paper.getElementByPoint()</span></a></li><li class="dr-lvl1"><a href="#Paper.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.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.setSize" class="dr-method"><span>Paper.setSize()</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.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.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.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.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.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="undefined"><span>Set</span></a></li><li class="dr-lvl1"><a href="#Set.forEach" class="dr-method"><span>Set.forEach()</span></a></li><li class="dr-lvl1"><a href="#Set.pop" class="dr-method"><span>Set.pop()</span></a></li><li class="dr-lvl1"><a href="#Set.push" class="dr-method"><span>Set.push()</span></a></li></ol><div class="dr-doc"><h1>Raphaël Reference</h1><p class="dr-source">Check out the source: <a href="raphael-src.html">raphael.js</a></p><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 <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 source" href="raphael-src.html#L5146">&#x27ad;</a></h3>
5 <div class="dr-method"><p>Creates a copy of existing animation object with given delay.
6 </p>
7 <p class="header">Parameters
8 </p>
9 <dl class="dr-parameters"><dt class="dr-param">delay</dt>
10 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
11 <dd class="dr-description">number of ms to pass between animation start and actual animation</dd>
12 </dl>
13 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">new altered Animation object</span></p>
14 </div><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 source" href="raphael-src.html#L5164">&#x27ad;</a></h3>
15 <div class="dr-method"><p>Creates a copy of existing animation object with given repetition.
16 </p>
17 <p class="header">Parameters
18 </p>
19 <dl class="dr-parameters"><dt class="dr-param">repeat</dt>
20 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
21 <dd class="dr-description">number iterations of animation. For infinite animation pass <code>Infinity</code></dd>
22 </dl>
23 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">new altered Animation object</span></p>
24 </div><h2 id="Element" class="undefined"><i class="dr-trixie">&#160;</i>Element<a href="#Element" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
25 <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 source" href="raphael-src.html#L5423">&#x27ad;</a></h3>
26 <div class="dr-method"><p>Creates and starts animation for given element.
27 </p>
28 <p class="header">Parameters
29 </p>
30 <dl class="dr-parameters"><dt class="dr-param">params</dt>
31 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
32 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
33 <dt class="dr-param">ms</dt>
34 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
35 <dd class="dr-description">number of milliseconds for animation to run</dd>
36 <dt class="dr-param optional">easing</dt>
37 <dd class="dr-optional">optional</dd>
38 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
39 <dd class="dr-description">easing type. Accept one of <a href="#Raphael.easing_formulas" class="dr-link">Raphael.easing_formulas</a> or CSS format: <code>cubic&#x2010;bezier(XX,&#160;XX,&#160;XX,&#160;XX)</code></dd>
40 <dt class="dr-param optional">callback</dt>
41 <dd class="dr-optional">optional</dd>
42 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
43 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
44 </dl>
45 <p>or
46 </p>
47 <dl class="dr-parameters"><dt class="dr-param">animation</dt>
48 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
49 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
50 </dl>
51 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
52 </div><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 source" href="raphael-src.html#L5051">&#x27ad;</a></h3>
53 <div class="dr-method"><p>Acts similar to <a href="#Element.animate" class="dr-link">Element.animate</a>, but ensure that given animation runs in sync with another given element.
54 </p>
55 <p class="header">Parameters
56 </p>
57 <dl class="dr-parameters"><dt class="dr-param">params</dt>
58 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
59 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
60 <dt class="dr-param">ms</dt>
61 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
62 <dd class="dr-description">number of milliseconds for animation to run</dd>
63 <dt class="dr-param optional">easing</dt>
64 <dd class="dr-optional">optional</dd>
65 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
66 <dd class="dr-description">easing type. Accept on of <a href="#Raphael.easing_formulas" class="dr-link">Raphael.easing_formulas</a> or CSS format: <code>cubic&#x2010;bezier(XX,&#160;XX,&#160;XX,&#160;XX)</code></dd>
67 <dt class="dr-param optional">callback</dt>
68 <dd class="dr-optional">optional</dd>
69 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
70 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
71 </dl>
72 <p>or
73 </p>
74 <dl class="dr-parameters"><dt class="dr-param">animation</dt>
75 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
76 <dd class="dr-description">animation object, see <a href="#Raphael.animation" class="dr-link">Raphael.animation</a></dd>
77 </dl>
78 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
79 </div><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 source" href="raphael-src.html#L2714">&#x27ad;</a></h3>
80 <div class="dr-method"><p>Sets the attributes of the element.
81 </p>
82 <p class="header">Parameters
83 </p>
84 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
85 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
86 <dd class="dr-description">attribute’s name</dd>
87 <dt class="dr-param">value</dt>
88 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
89 <dd class="dr-description">value</dd>
90 </dl>
91 <p>or
92 </p>
93 <dl class="dr-parameters"><dt class="dr-param">params</dt>
94 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
95 <dd class="dr-description">object of name/value pairs</dd>
96 </dl>
97 <p>or
98 </p>
99 <dl class="dr-parameters"><dt class="dr-param">attrName</dt>
100 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
101 <dd class="dr-description">attribute’s name</dd>
102 </dl>
103 <p>or
104 </p>
105 <dl class="dr-parameters"><dt class="dr-param">attrNames</dt>
106 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
107 <dd class="dr-description">in this case method returns array of current values for given attribute names</dd>
108 </dl>
109 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a> if attrsName <em class="amp">&amp;</em> value or params are passed in.</span></p>
110 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-...">...</em> <span class="dr-description">value of the attribute if only attrsName is passed in.</span></p>
111 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-array">array</em> <span class="dr-description">array of values of the attribute if attrsNames is passed in.</span></p>
112 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">object of attributes if nothing is passed in.</span></p>
113 <p class="header">Possible parameters
114 </p>
115 <p>Please refer to the <a href="http://www.w3.org/TR/SVG/" title="The W3C Recommendation for the SVG language describes these properties in detail.">SVG specification</a> for an explanation of these parameters.</p>
116 <ol class="dr-json"><li><span class="dr-json-key">arrow-end</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">arrowhead on the end of the path. The format for string is <code>&lt;type>[-&lt;width>[-&lt;length>]]</code>. Possible types: <code>classic</code>, <code>block</code>, <code>open</code>, <code>oval</code>, <code>diamond</code>, <code>none</code>, width: <code>wide</code>, <code>narrow</code>, <code>midium</code>, length: <code>long</code>, <code>short</code>, <code>midium</code>.</span>
117 <li><span class="dr-json-key">clip-rect</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">comma or space separated values: x, y, width and height</span>
118 <li><span class="dr-json-key">cursor</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">CSS type of the cursor</span>
119 <li><span class="dr-json-key">cx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
120 <li><span class="dr-json-key">cy</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
121 <li><span class="dr-json-key">fill</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">colour, gradient or image</span>
122 <li><span class="dr-json-key">fill-opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
123 <li><span class="dr-json-key">font</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
124 <li><span class="dr-json-key">font-family</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
125 <li><span class="dr-json-key">font-size</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">font size in pixels</span>
126 <li><span class="dr-json-key">font-weight</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">&#160;</span>
127 <li><span class="dr-json-key">height</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
128 <li><span class="dr-json-key">href</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">URL, if specified element behaves as hyperlink</span>
129 <li><span class="dr-json-key">opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
130 <li><span class="dr-json-key">path</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">SVG path string format</span>
131 <li><span class="dr-json-key">r</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
132 <li><span class="dr-json-key">rx</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
133 <li><span class="dr-json-key">ry</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
134 <li><span class="dr-json-key">src</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">image URL, only works for <a href="#Element.image" class="dr-link">Element.image</a> element</span>
135 <li><span class="dr-json-key">stroke</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">stroke colour</span>
136 <li><span class="dr-json-key">stroke-dasharray</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“”, “<code>-</code>”, “<code>.</code>”, “<code>-.</code>”, “<code>-..</code>”, “<code>. </code>”, “<code>- </code>”, “<code>--</code>”, “<code>- .</code>”, “<code>--.</code>”, “<code>--..</code>”]</span>
137 <li><span class="dr-json-key">stroke-linecap</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>butt</code>”, “<code>square</code>”, “<code>round</code>”]</span>
138 <li><span class="dr-json-key">stroke-linejoin</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>bevel</code>”, “<code>round</code>”, “<code>miter</code>”]</span>
139 <li><span class="dr-json-key">stroke-miterlimit</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
140 <li><span class="dr-json-key">stroke-opacity</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
141 <li><span class="dr-json-key">stroke-width</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">stroke width in pixels, default is '1'</span>
142 <li><span class="dr-json-key">target</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">used with href</span>
143 <li><span class="dr-json-key">text</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">contents of the text element. Use <code>\n</code> for multiline text</span>
144 <li><span class="dr-json-key">text-anchor</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">[“<code>start</code>”, “<code>middle</code>”, “<code>end</code>”], default is “<code>middle</code>”</span>
145 <li><span class="dr-json-key">title</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">will create tooltip with a given text</span>
146 <li><span class="dr-json-key">transform</span><span class="dr-type"><em class="dr-type-string">string</em></span><span class="dr-json-description">see <a href="#Element.transform" class="dr-link">Element.transform</a></span>
147 <li><span class="dr-json-key">width</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
148 <li><span class="dr-json-key">x</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
149 <li><span class="dr-json-key">y</span><span class="dr-type"><em class="dr-type-number">number</em></span><span class="dr-json-description">&#160;</span>
150 </ol>
151 <p class="header">Gradients
152 <p>Linear gradient format: “<code>‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>90-#fff-#000</code>” – 90°
153 gradient from white to black or “<code>0-#fff-#f00:20-#000</code>” – 0° gradient from white via red (at 20%) to black.
154 </p>
155 <p>radial gradient: “<code>r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›</code>”, example: “<code>r#fff-#000</code>” –
156 gradient from white to black or “<code>r(0.25, 0.75)#fff-#000</code>” – gradient from white to black with focus point
157 at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
158 </p>
159 <p class="header">Path String
160 </p>
161 <p>Please refer to <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path’s data attribute’s format are described in the SVG specification.">SVG documentation regarding path string</a>. Raphaël fully supports it.</p>
162 <p class="header">Colour Parsing
163 </p>
164 <ul>
165     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
166     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
167     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
168     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
169     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
170     <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200,&nbsp;100,&nbsp;0, .5)</code>”)</li>
171     <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%,&nbsp;175%,&nbsp;0%, 50%)</code>”)</li>
172     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
173     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
174     <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
175     <li>hsl(•••, •••, •••) — almost the same as hsb, see <a href="http://en.wikipedia.org/wiki/HSL_and_HSV" title="HSL and HSV - Wikipedia, the free encyclopedia">Wikipedia page</a></li>
176     <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
177     <li>hsla(•••, •••, •••) — same as above, but with opacity</li>
178     <li>Optionally for hsb and hsl you could specify hue as a degree: “<code>hsl(240deg,&nbsp;1,&nbsp;.5)</code>” or, if you want to go fancy, “<code>hsl(240°,&nbsp;1,&nbsp;.5)</code>”</li>
179 </ul>
180 </div><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 source" href="raphael-src.html#L4579">&#x27ad;</a></h3>
181 <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>
182 </div><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 source" href="raphael-src.html#L4181">&#x27ad;</a></h3>
183 <div class="dr-method"><p>Adds event handlers for drag of the element.
184 </p>
185 <p class="header">Parameters
186 </p>
187 <dl class="dr-parameters"><dt class="dr-param">onmove</dt>
188 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
189 <dd class="dr-description">handler for moving</dd>
190 <dt class="dr-param">onstart</dt>
191 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
192 <dd class="dr-description">handler for drag start</dd>
193 <dt class="dr-param">onend</dt>
194 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
195 <dd class="dr-description">handler for drag end</dd>
196 <dt class="dr-param optional">mcontext</dt>
197 <dd class="dr-optional">optional</dd>
198 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
199 <dd class="dr-description">context for moving handler</dd>
200 <dt class="dr-param optional">scontext</dt>
201 <dd class="dr-optional">optional</dd>
202 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
203 <dd class="dr-description">context for drag start handler</dd>
204 <dt class="dr-param optional">econtext</dt>
205 <dd class="dr-optional">optional</dd>
206 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
207 <dd class="dr-description">context for drag end handler</dd>
208 </dl>
209 <p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start, 
210 <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 
211 <code>drag.over.&lt;id></code> will be fired as well.
212 </p>
213 <p>Start event and start handler will be called in specified context or in context of the element with following parameters:
214 </p>
215 <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>
216 <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>
217 <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>
218 </ol>
219 <p>Move event and move handler will be called in specified context or in context of the element with following parameters:
220 </p>
221 <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>
222 <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>
223 <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>
224 <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>
225 <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>
226 </ol>
227 <p>End event and end handler will be called in specified context or in context of the element with following parameters:
228 </p>
229 <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>
230 </ol>
231 <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>
232 </div><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 source" href="raphael-src.html#L4547">&#x27ad;</a></h3>
233 <div class="dr-method"><p>Return bounding box for a given element
234 </p>
235 <p class="header">Parameters
236 </p>
237 <dl class="dr-parameters"><dt class="dr-param">isWithoutTransform</dt>
238 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
239 <dd class="dr-description">flag, <code>true</code> if you want to have bounding box before transformations. Default is <code>false</code>.</dd>
240 </dl>
241 <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>
242 <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>
243 <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>
244 <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>
245 <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>
246 </ol></li><li>}</li></ol>
247 </div><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 source" href="raphael-src.html#L4800">&#x27ad;</a></h3>
248 <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.
249 </p>
250 <p class="header">Parameters
251 </p>
252 <dl class="dr-parameters"><dt class="dr-param">length</dt>
253 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
254 <dd class="dr-description">&#160;</dd>
255 </dl>
256 <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>
257 <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>
258 <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>
259 <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>
260 </ol></li><li>}</li></ol>
261 </div><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 source" href="raphael-src.html#L4817">&#x27ad;</a></h3>
262 <div class="dr-method"><p>Return subpath of a given element from given length to given length. Only works for element of “path” type.
263 </p>
264 <p class="header">Parameters
265 </p>
266 <dl class="dr-parameters"><dt class="dr-param">from</dt>
267 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
268 <dd class="dr-description">position of the start of the segment</dd>
269 <dt class="dr-param">to</dt>
270 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
271 <dd class="dr-description">position of the end of the segment</dd>
272 </dl>
273 <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>
274 </div><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 source" href="raphael-src.html#L4776">&#x27ad;</a></h3>
275 <div class="dr-method"><p>Returns length of the path in pixels. Only works for element of “path” type.
276 </p>
277 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
278 </div><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 source" href="raphael-src.html#L4609">&#x27ad;</a></h3>
279 <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>.
280 </p>
281 <p>Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself.
282 </p>
283 <p class="header">Parameters
284 </p>
285 <dl class="dr-parameters"><dt class="dr-param optional">glow</dt>
286 <dd class="dr-optional">optional</dd>
287 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
288 <dd class="dr-description">parameters object with all properties optional:</dd>
289 </dl>
290 <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>
291 <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>
292 <li>    opacity: opacity, default is `0.5`<li>    offsetx: horizontal offset, default is `0`<li>    offsety: vertical offset, default is `0`<li>    color: glow colour, default is `black`</ol></li><li>}</li></ol>
293 <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>
294 </div><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 source" href="raphael-src.html#L2584">&#x27ad;</a></h3>
295 <div class="dr-method"><p>Makes element invisible. See <a href="#Element.show" class="dr-link">Element.show</a>.
296 </p>
297 <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>
298 </div><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 source" href="raphael-src.html#L4135">&#x27ad;</a></h3>
299 <div class="dr-method"><p>Adds event handlers for hover for the element.
300 </p>
301 <p class="header">Parameters
302 </p>
303 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
304 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
305 <dd class="dr-description">handler for hover in</dd>
306 <dt class="dr-param">f_out</dt>
307 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
308 <dd class="dr-description">handler for hover out</dd>
309 <dt class="dr-param optional">icontext</dt>
310 <dd class="dr-optional">optional</dd>
311 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
312 <dd class="dr-description">context for hover in handler</dd>
313 <dt class="dr-param optional">ocontext</dt>
314 <dd class="dr-optional">optional</dd>
315 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
316 <dd class="dr-description">context for hover out handler</dd>
317 </dl>
318 <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>
319 </div><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 source" href="raphael-src.html#L2387">&#x27ad;</a></h3>
320 <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, 
321 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.
322 </p>
323 </div><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 source" href="raphael-src.html#L2806">&#x27ad;</a></h3>
324 <div class="dr-method"><p>Inserts current object after the given one.
325 </p>
326 <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>
327 </div><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 source" href="raphael-src.html#L2826">&#x27ad;</a></h3>
328 <div class="dr-method"><p>Inserts current object before the given one.
329 </p>
330 <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>
331 </div><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 source" href="raphael-src.html#L2430">&#x27ad;</a></h3>
332 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the next element in the hierarchy.
333 </p>
334 </div><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 source" href="raphael-src.html#L2366">&#x27ad;</a></h3>
335 <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.
336 </p>
337 <p class="header">Usage
338 </p>
339 <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>
340 <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>);
341 c.node.onclick<span class="s"> = </span><b>function</b> () {
342     c.attr(<i>"fill"</i>, <i>"red"</i>);
343 };
344 </code></pre>
345 </div><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 source" href="raphael-src.html#L4208">&#x27ad;</a></h3>
346 <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>).
347 </p>
348 <p class="header">Parameters
349 </p>
350 <dl class="dr-parameters"><dt class="dr-param">f</dt>
351 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
352 <dd class="dr-description">handler for event</dd>
353 </dl>
354 </div><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 source" href="raphael-src.html#L2403">&#x27ad;</a></h3>
355 <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.
356 </p>
357 <p class="header">Usage
358 </p>
359 <pre class="javascript code"><code>Raphael.el.cross<span class="s"> = </span><b>function</b> () {
360     <b>this</b>.attr({fill: <i>"red"</i>});
361     <b>this</b>.paper.path(<i>"M10,10L50,50M50,10L10,<span class="d">50</span>"</i>)
362         .attr({stroke: <i>"red"</i>});
363 }
364 </code></pre>
365 </div><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 source" href="raphael-src.html#L5513">&#x27ad;</a></h3>
366 <div class="dr-method"><p>Stops animation of the element with ability to resume it later on.
367 </p>
368 <p class="header">Parameters
369 </p>
370 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
371 <dd class="dr-optional">optional</dd>
372 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
373 <dd class="dr-description">animation object</dd>
374 </dl>
375 <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>
376 </div><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 source" href="raphael-src.html#L2421">&#x27ad;</a></h3>
377 <div class="dr-property"><em class="dr-type dr-type-object">object</em><p>Reference to the previous element in the hierarchy.
378 </p>
379 </div><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 source" href="raphael-src.html#L2379">&#x27ad;</a></h3>
380 <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.
381 </p>
382 <p class="header">Usage
383 </p>
384 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
385     <b>var</b> hsb<span class="s"> = </span><b>this</b>.paper.raphael.rgb2hsb(<b>this</b>.attr(<i>"fill"</i>));
386     hsb.h<span class="s"> = </span><span class="d">1</span>;
387     <b>this</b>.attr({fill: <b>this</b>.paper.raphael.hsb2rgb(hsb).hex});
388 }
389 </code></pre>
390 </div><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 source" href="raphael-src.html#L2605">&#x27ad;</a></h3>
391 <div class="dr-method"><p>Removes element form the paper.
392 </p>
393 </div><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 source" href="raphael-src.html#L5533">&#x27ad;</a></h3>
394 <div class="dr-method"><p>Resumes animation if it was paused with <a href="#Element.pause" class="dr-link">Element.pause</a> method.
395 </p>
396 <p class="header">Parameters
397 </p>
398 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
399 <dd class="dr-optional">optional</dd>
400 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
401 <dd class="dr-description">animation object</dd>
402 </dl>
403 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">original element</span></p>
404 </div><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 source" href="raphael-src.html#L2446">&#x27ad;</a></h3>
405 <div class="dr-method"><p>Adds rotation by given angle around given point to the list of
406 transformations of the element.
407 </p>
408 <p class="header">Parameters
409 </p>
410 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
411 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
412 <dd class="dr-description">angle in degrees</dd>
413 <dt class="dr-param optional">cx</dt>
414 <dd class="dr-optional">optional</dd>
415 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
416 <dd class="dr-description">x coordinate of the centre of rotation</dd>
417 <dt class="dr-param optional">cy</dt>
418 <dd class="dr-optional">optional</dd>
419 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
420 <dd class="dr-description">y coordinate of the centre of rotation</dd>
421 </dl>
422 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used as a point of rotation.
423 </p>
424 <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>
425 </div><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 source" href="raphael-src.html#L2479">&#x27ad;</a></h3>
426 <div class="dr-method"><p>Adds scale by given amount relative to given point to the list of
427 transformations of the element.
428 </p>
429 <p class="header">Parameters
430 </p>
431 <dl class="dr-parameters"><dt class="dr-param">sx</dt>
432 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
433 <dd class="dr-description">horisontal scale amount</dd>
434 <dt class="dr-param">sy</dt>
435 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
436 <dd class="dr-description">vertical scale amount</dd>
437 <dt class="dr-param optional">cx</dt>
438 <dd class="dr-optional">optional</dd>
439 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
440 <dd class="dr-description">x coordinate of the centre of scale</dd>
441 <dt class="dr-param optional">cy</dt>
442 <dd class="dr-optional">optional</dd>
443 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
444 <dd class="dr-description">y coordinate of the centre of scale</dd>
445 </dl>
446 <p>If cx <em class="amp">&amp;</em> cy aren’t specified centre of the shape is used instead.
447 </p>
448 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
449 </div><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 source" href="raphael-src.html#L5449">&#x27ad;</a></h3>
450 <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.
451 </p>
452 <p class="header">Parameters
453 </p>
454 <dl class="dr-parameters"><dt class="dr-param">anim</dt>
455 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
456 <dd class="dr-description">animation object</dd>
457 <dt class="dr-param">value</dt>
458 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
459 <dd class="dr-description">number of milliseconds from the beginning of the animation</dd>
460 </dl>
461 <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>
462 <p>Note, that during animation following events are triggered:
463 </p>
464 <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>.
465 </p>
466 </div><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 source" href="raphael-src.html#L2595">&#x27ad;</a></h3>
467 <div class="dr-method"><p>Makes element visible. See <a href="#Element.hide" class="dr-link">Element.hide</a>.
468 </p>
469 <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>
470 </div><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 source" href="raphael-src.html#L5476">&#x27ad;</a></h3>
471 <div class="dr-method"><p>Gets or sets the status of animation of the element.
472 </p>
473 <p class="header">Parameters
474 </p>
475 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
476 <dd class="dr-optional">optional</dd>
477 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
478 <dd class="dr-description">animation object</dd>
479 <dt class="dr-param optional">value</dt>
480 <dd class="dr-optional">optional</dd>
481 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
482 <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>
483 </dl>
484 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">status</span></p>
485 <p>or
486 </p>
487 <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>
488 <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>
489 <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>
490 </ol></li><li>}</li></ol>
491 <p>or
492 </p>
493 <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>
494 </div><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 source" href="raphael-src.html#L5555">&#x27ad;</a></h3>
495 <div class="dr-method"><p>Stops animation of the element.
496 </p>
497 <p class="header">Parameters
498 </p>
499 <dl class="dr-parameters"><dt class="dr-param optional">anim</dt>
500 <dd class="dr-optional">optional</dd>
501 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
502 <dd class="dr-description">animation object</dd>
503 </dl>
504 <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>
505 </div><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 source" href="raphael-src.html#L2788">&#x27ad;</a></h3>
506 <div class="dr-method"><p>Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
507 </p>
508 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
509 </div><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 source" href="raphael-src.html#L2772">&#x27ad;</a></h3>
510 <div class="dr-method"><p>Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
511 </p>
512 <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>
513 </div><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 source" href="raphael-src.html#L2558">&#x27ad;</a></h3>
514 <div class="dr-method"><p>Adds transformation to the element which is separate to other attributes,
515 i.e. translation doesn’t change <code>x</code> or <code>y</code> of the rectange. The format
516 of transformation string is similar to the path string syntax:
517 </p>
518 <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>
519 </code></pre>
520 <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
521 scale and <code>m</code> is for matrix.
522 </p>
523 <p>So, the example line above could be read like “translate by 100, 100; rotate 30° around 100, 100; scale twice around 100, 100;
524 rotate 45° around centre; scale 1.5 times relative to centre”. As you can see rotate and scale commands have origin
525 coordinates as optional parameters, the default is the centre point of the element.
526 Matrix accepts six parameters.
527 </p>
528 <p class="header">Usage
529 </p>
530 <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>);
531 <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>
532 el.transform(<i>"t100,100r45t-<span class="d">100</span>,<span class="d">0</span>"</i>);
533 <span class="c">// <b>if</b> you want you can append or prepend transformations</span>
534 el.transform(<i>"...t50,<span class="d">50</span>"</i>);
535 el.transform(<i>"s2..."</i>);
536 <span class="c">// or even wrap</span>
537 el.transform(<i>"t50,<span class="d">50</span>...t-<span class="d">50</span>-<span class="d">50</span>"</i>);
538 <span class="c">// to reset transformation call method <b>with</b> empty string</span>
539 el.transform(<i>""</i>);
540 <span class="c">// to get current value call it without parameters</span>
541 console.log(el.transform());
542 </code></pre>
543 <p class="header">Parameters
544 </p>
545 <dl class="dr-parameters"><dt class="dr-param optional">tstr</dt>
546 <dd class="dr-optional">optional</dd>
547 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
548 <dd class="dr-description">transformation string</dd>
549 </dl>
550 <p>If tstr isn’t specified
551 </p>
552 <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>
553 <p>else
554 </p>
555 <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>
556 </div><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 source" href="raphael-src.html#L2510">&#x27ad;</a></h3>
557 <div class="dr-method"><p>Adds translation by given amount to the list of transformations of the element.
558 </p>
559 <p class="header">Parameters
560 </p>
561 <dl class="dr-parameters"><dt class="dr-param">dx</dt>
562 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
563 <dd class="dr-description">horisontal shift</dd>
564 <dt class="dr-param">dy</dt>
565 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
566 <dd class="dr-description">vertical shift</dd>
567 </dl>
568 <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>
569 </div><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 source" href="raphael-src.html#L4217">&#x27ad;</a></h3>
570 <div class="dr-method"><p>Removes all drag event handlers from given element.
571 </p>
572 </div><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 source" href="raphael-src.html#L4148">&#x27ad;</a></h3>
573 <div class="dr-method"><p>Removes event handlers for hover for the element.
574 </p>
575 <p class="header">Parameters
576 </p>
577 <dl class="dr-parameters"><dt class="dr-param">f_in</dt>
578 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
579 <dd class="dr-description">handler for hover in</dd>
580 <dt class="dr-param">f_out</dt>
581 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
582 <dd class="dr-description">handler for hover out</dd>
583 </dl>
584 <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>
585 </div><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>
586 <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 source" href="raphael-src.html#L4419">&#x27ad;</a></h3>
587 <div class="dr-property"><p>Points to the bottom element on the paper
588 </p>
589 </div><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 source" href="raphael-src.html#L4242">&#x27ad;</a></h3>
590 <div class="dr-method"><p>Draws a circle.
591 </p>
592 <p class="header">Parameters
593 </p>
594 <dl class="dr-parameters"><dt class="dr-param">x</dt>
595 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
596 <dd class="dr-description">x coordinate of the centre</dd>
597 <dt class="dr-param">y</dt>
598 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
599 <dd class="dr-description">y coordinate of the centre</dd>
600 <dt class="dr-param">r</dt>
601 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
602 <dd class="dr-description">radius</dd>
603 </dl>
604 <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>
605 <p class="header">Usage
606 </p>
607 <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>);
608 </code></pre>
609 </div><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 source" href="raphael-src.html#L3024">&#x27ad;</a></h3>
610 <div class="dr-method"><p>Clears the paper, i.e. removes all the elements.
611 </p>
612 </div><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 source" href="raphael-src.html#L261">&#x27ad;</a></h3>
613 <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
614 as a function of some number you can do it easily with custom attributes:
615 </p>
616 <p class="header">Usage
617 </p>
618 <pre class="javascript code"><code>paper.customAttributes.hue<span class="s"> = </span><b>function</b> (num) {
619     num<span class="s"> = </span>num<span class="s"> % </span><span class="d">1</span>;
620     <b>return</b> {fill: <i>"hsb("</i><span class="s"> + </span>num<span class="s"> + </span><i>", <span class="d">.75</span>, <span class="d">1</span>)"</i>};
621 };
622 <span class="c">// Custom attribute “hue” will change fill</span>
623 <span class="c">// to be given hue <b>with</b> fixed saturation and brightness.</span>
624 <span class="c">// Now you can use it like <b>this</b>:</span>
625 <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>});
626 <span class="c">// or even like <b>this</b>:</span>
627 c.animate({hue: <span class="d">1</span>}, <span class="d">1e3</span>);
628
629 <span class="c">// You could also create custom attribute</span>
630 <span class="c">// <b>with</b> multiple parameters:</span>
631 paper.customAttributes.hsb<span class="s"> = </span><b>function</b> (h, s, b) {
632     <b>return</b> {fill: <i>"hsb("</i><span class="s"> + </span>[h, s, b].join(<i>","</i>)<span class="s"> + </span><i>")"</i>};
633 };
634 c.attr({hsb: <i>"<span class="d">.5</span> <span class="d">.8</span> <span class="d">1</span>"</i>});
635 c.animate({hsb: <i>"<span class="d">1</span> <span class="d">0</span> <span class="d">.5</span>"</i>}, <span class="d">1e3</span>);
636 </code></pre>
637 </div><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 source" href="raphael-src.html#L4286">&#x27ad;</a></h3>
638 <div class="dr-method"><p>Draws an ellipse.
639 </p>
640 <p class="header">Parameters
641 </p>
642 <dl class="dr-parameters"><dt class="dr-param">x</dt>
643 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
644 <dd class="dr-description">x coordinate of the centre</dd>
645 <dt class="dr-param">y</dt>
646 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
647 <dd class="dr-description">y coordinate of the centre</dd>
648 <dt class="dr-param">rx</dt>
649 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
650 <dd class="dr-description">horizontal radius</dd>
651 <dt class="dr-param">ry</dt>
652 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
653 <dd class="dr-description">vertical radius</dd>
654 </dl>
655 <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>
656 <p class="header">Usage
657 </p>
658 <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>);
659 </code></pre>
660 </div><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 source" href="raphael-src.html#L4514">&#x27ad;</a></h3>
661 <div class="dr-method"><p>Executes given function for each element on the paper
662 </p>
663 <p>If callback function returns <code>false</code> it will stop loop running.
664 </p>
665 <p class="header">Parameters
666 </p>
667 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
668 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
669 <dd class="dr-description">function to run</dd>
670 <dt class="dr-param">thisArg</dt>
671 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
672 <dd class="dr-description">context object for the callback</dd>
673 </dl>
674 <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>
675 </div><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 source" href="raphael-src.html#L4490">&#x27ad;</a></h3>
676 <div class="dr-method"><p>Returns you element by its internal ID.
677 </p>
678 <p class="header">Parameters
679 </p>
680 <dl class="dr-parameters"><dt class="dr-param">id</dt>
681 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
682 <dd class="dr-description">id</dd>
683 </dl>
684 <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>
685 </div><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 source" href="raphael-src.html#L4454">&#x27ad;</a></h3>
686 <div class="dr-method"><p>Returns you topmost element under given point.
687 </p>
688 <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>
689 <p class="header">Parameters
690 </p>
691 <dl class="dr-parameters"><dt class="dr-param">x</dt>
692 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
693 <dd class="dr-description">x coordinate from the top left corner of the window</dd>
694 <dt class="dr-param">y</dt>
695 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
696 <dd class="dr-description">y coordinate from the top left corner of the window</dd>
697 </dl>
698 <p class="header">Usage
699 </p>
700 <pre class="javascript code"><code>paper.getElementByPoint(mouseX, mouseY).attr({stroke: <i>"#f00"</i>});
701 </code></pre>
702 </div><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 source" href="raphael-src.html#L4328">&#x27ad;</a></h3>
703 <div class="dr-method"><p>Embeds an image into the surface.
704 </p>
705 <p class="header">Parameters
706 </p>
707 <dl class="dr-parameters"><dt class="dr-param">src</dt>
708 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
709 <dd class="dr-description">URI of the source image</dd>
710 <dt class="dr-param">x</dt>
711 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
712 <dd class="dr-description">x coordinate position</dd>
713 <dt class="dr-param">y</dt>
714 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
715 <dd class="dr-description">y coordinate position</dd>
716 <dt class="dr-param">width</dt>
717 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
718 <dd class="dr-description">width of the image</dd>
719 <dt class="dr-param">height</dt>
720 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
721 <dd class="dr-description">height of the image</dd>
722 </dl>
723 <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>
724 <p class="header">Usage
725 </p>
726 <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>);
727 </code></pre>
728 </div><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 source" href="raphael-src.html#L4306">&#x27ad;</a></h3>
729 <div class="dr-method"><p>Creates a path element by given path data string.
730 </p>
731 <p class="header">Parameters
732 </p>
733 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
734 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
735 <dd class="dr-description">path data in SVG path string format.</dd>
736 </dl>
737 <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>
738 Details of a path's data attribute's format are described in the <a href="http://www.w3.org/TR/SVG/paths.html#PathData">SVG specification</a>.
739 <p class="header">Usage
740 </p>
741 <pre class="javascript code"><code><b>var</b> c<span class="s"> = </span>paper.path(<i>"M10 10L90 <span class="d">90</span>"</i>);
742 <span class="c">// draw a diagonal line:</span>
743 <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>
744 </code></pre>
745 </div><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 source" href="raphael-src.html#L4426">&#x27ad;</a></h3>
746 <div class="dr-property"><p>Points to the <a href="#Raphael" class="dr-link">Raphael</a> object/function
747 </p>
748 </div><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 source" href="raphael-src.html#L4266">&#x27ad;</a></h3>
749 <div class="dr-method"><p></p>
750 <p>Draws a rectangle.
751 </p>
752 <p class="header">Parameters
753 </p>
754 <dl class="dr-parameters"><dt class="dr-param">x</dt>
755 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
756 <dd class="dr-description">x coordinate of the top left corner</dd>
757 <dt class="dr-param">y</dt>
758 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
759 <dd class="dr-description">y coordinate of the top left corner</dd>
760 <dt class="dr-param">width</dt>
761 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
762 <dd class="dr-description">width</dd>
763 <dt class="dr-param">height</dt>
764 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
765 <dd class="dr-description">height</dd>
766 <dt class="dr-param optional">r</dt>
767 <dd class="dr-optional">optional</dd>
768 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
769 <dd class="dr-description">radius for rounded corners, default is 0</dd>
770 </dl>
771 <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>
772 <p class="header">Usage
773 </p>
774 <pre class="javascript code"><code><span class="c">// regular rectangle</span>
775 <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>);
776 <span class="c">// rectangle <b>with</b> rounded corners</span>
777 <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>);
778 </code></pre>
779 </div><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 source" href="raphael-src.html#L3041">&#x27ad;</a></h3>
780 <div class="dr-method"><p>Removes the paper from the DOM.
781 </p>
782 </div><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 source" href="raphael-src.html#L3001">&#x27ad;</a></h3>
783 <div class="dr-method"><p>Fixes the issue of Firefox and IE9 regarding subpixel rendering. If paper is dependant
784 on other elements after reflow it could shift half pixel which cause for lines to lost their crispness.
785 This method fixes the issue.
786 </p>
787 </div><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 source" href="raphael-src.html#L3986">&#x27ad;</a></h3>
788 <div class="dr-method"><p>There is an inconvenient rendering bug in Safari (WebKit):
789 sometimes the rendering should be forced.
790 This method should help with dealing with this bug.
791 </p>
792 </div><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 source" href="raphael-src.html#L4367">&#x27ad;</a></h3>
793 <div class="dr-method"><p>Creates array-like object to keep and operate several elements at once.
794 Warning: it doesn’t create any elements for itself in the page, it just groups existing elements.
795 Sets act as pseudo elements — all methods available to an element can be used on a set.
796 </p>
797 <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>
798 <p class="header">Usage
799 </p>
800 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
801 st.push(
802     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
803     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
804 );
805 st.attr({fill: <i>"red"</i>});
806 </code></pre>
807 </div><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 source" href="raphael-src.html#L4389">&#x27ad;</a></h3>
808 <div class="dr-method"><p>If you need to change dimensions of the canvas call this method
809 </p>
810 <p class="header">Parameters
811 </p>
812 <dl class="dr-parameters"><dt class="dr-param">width</dt>
813 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
814 <dd class="dr-description">new width of the canvas</dd>
815 <dt class="dr-param">height</dt>
816 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
817 <dd class="dr-description">new height of the canvas</dd>
818 </dl>
819 <p class="header">Usage
820 </p>
821 <pre class="javascript code"><code><b>var</b> st<span class="s"> = </span>paper.set();
822 st.push(
823     paper.circle(<span class="d">10</span>, <span class="d">10</span>, <span class="d">5</span>),
824     paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="d">5</span>)
825 );
826 st.attr({fill: <i>"red"</i>});
827 </code></pre>
828 </div><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 source" href="raphael-src.html#L4406">&#x27ad;</a></h3>
829 <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 
830 specifying new boundaries.
831 </p>
832 <p class="header">Parameters
833 </p>
834 <dl class="dr-parameters"><dt class="dr-param">x</dt>
835 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
836 <dd class="dr-description">new x position, default is <code>0</code></dd>
837 <dt class="dr-param">y</dt>
838 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
839 <dd class="dr-description">new y position, default is <code>0</code></dd>
840 <dt class="dr-param">w</dt>
841 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
842 <dd class="dr-description">new width of the canvas</dd>
843 <dt class="dr-param">h</dt>
844 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
845 <dd class="dr-description">new height of the canvas</dd>
846 <dt class="dr-param">fit</dt>
847 <dd class="dr-type"><em class="dr-type-boolean">boolean</em></dd>
848 <dd class="dr-description"><code>true</code> if you want graphics to fit into new boundary box</dd>
849 </dl>
850 </div><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 source" href="raphael-src.html#L4347">&#x27ad;</a></h3>
851 <div class="dr-method"><p>Draws a text string. If you need line breaks, put “\n” in the string.
852 </p>
853 <p class="header">Parameters
854 </p>
855 <dl class="dr-parameters"><dt class="dr-param">x</dt>
856 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
857 <dd class="dr-description">x coordinate position</dd>
858 <dt class="dr-param">y</dt>
859 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
860 <dd class="dr-description">y coordinate position</dd>
861 <dt class="dr-param">text</dt>
862 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
863 <dd class="dr-description">The text string to draw</dd>
864 </dl>
865 <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>
866 <p class="header">Usage
867 </p>
868 <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>);
869 </code></pre>
870 </div><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 source" href="raphael-src.html#L4413">&#x27ad;</a></h3>
871 <div class="dr-property"><p>Points to the topmost element on the paper
872 </p>
873 </div><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 source" href="raphael-src.html#L56">&#x27ad;</a></h2>
874 <div class="dr-method"><p>Creates a canvas object on which to draw.
875 You must do this first, as all future calls to drawing methods
876 from this instance will be bound to this canvas.
877 </p>
878 <p class="header">Parameters
879 </p>
880 <dl class="dr-parameters"><dt class="dr-param">container</dt>
881 <dd class="dr-type"><em class="dr-type-HTMLElement">HTMLElement</em> <em class="dr-type-string">string</em></dd>
882 <dd class="dr-description">DOM element or its ID which is going to be a parent for drawing surface</dd>
883 <dt class="dr-param">width</dt>
884 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
885 <dd class="dr-description">&#160;</dd>
886 <dt class="dr-param">height</dt>
887 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
888 <dd class="dr-description">&#160;</dd>
889 </dl>
890 <p>or
891 </p>
892 <dl class="dr-parameters"><dt class="dr-param">x</dt>
893 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
894 <dd class="dr-description">&#160;</dd>
895 <dt class="dr-param">y</dt>
896 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
897 <dd class="dr-description">&#160;</dd>
898 <dt class="dr-param">width</dt>
899 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
900 <dd class="dr-description">&#160;</dd>
901 <dt class="dr-param">height</dt>
902 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
903 <dd class="dr-description">&#160;</dd>
904 </dl>
905 <p>or
906 </p>
907 <dl class="dr-parameters"><dt class="dr-param">all</dt>
908 <dd class="dr-type"><em class="dr-type-array">array</em></dd>
909 <dd class="dr-description">(first 3 or 4 elements in the array are equal to [containerID, width, height] or [x, y, width, height]. The rest are element descriptions in format {type: type, &lt;attributes>})</dd>
910 </dl>
911 <p>or
912 </p>
913 <dl class="dr-parameters"><dt class="dr-param">onReadyCallback</dt>
914 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
915 <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>
916 </dl>
917 <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>
918 <p class="header">Usage
919 </p>
920 <pre class="javascript code"><code><span class="c">// Each of the following examples create a canvas</span>
921 <span class="c">// that is 320px wide by 200px high.</span>
922 <span class="c">// Canvas is created at the viewport’s <span class="d">10</span>,<span class="d">50</span> coordinate.</span>
923 <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>);
924 <span class="c">// Canvas is created at the top left corner of the #notepad element</span>
925 <span class="c">// (or its top right corner <b>in</b> dir=<i>"rtl"</i> elements)</span>
926 <b>var</b> paper<span class="s"> = </span>Raphael(document.getElementById(<i>"notepad"</i>), <span class="d">320</span>, <span class="d">200</span>);
927 <span class="c">// Same as above</span>
928 <b>var</b> paper<span class="s"> = </span>Raphael(<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>);
929 <span class="c">// Image dump</span>
930 <b>var</b> set<span class="s"> = </span>Raphael([<i>"notepad"</i>, <span class="d">320</span>, <span class="d">200</span>, {
931     type: <i>"rect"</i>,
932     x: <span class="d">10</span>,
933     y: <span class="d">10</span>,
934     width: <span class="d">25</span>,
935     height: <span class="d">25</span>,
936     stroke: <i>"#f00"</i>
937 }, {
938     type: <i>"text"</i>,
939     x: <span class="d">30</span>,
940     y: <span class="d">40</span>,
941     text: <i>"Dump"</i>
942 }]);
943 </code></pre>
944 </div><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 source" href="raphael-src.html#L325">&#x27ad;</a></h3>
945 <div class="dr-method"><p>Returns angle between two or three points
946 </p>
947 <p class="header">Parameters
948 </p>
949 <dl class="dr-parameters"><dt class="dr-param">x1</dt>
950 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
951 <dd class="dr-description">x coord of first point</dd>
952 <dt class="dr-param">y1</dt>
953 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
954 <dd class="dr-description">y coord of first point</dd>
955 <dt class="dr-param">x2</dt>
956 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
957 <dd class="dr-description">x coord of second point</dd>
958 <dt class="dr-param">y2</dt>
959 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
960 <dd class="dr-description">y coord of second point</dd>
961 <dt class="dr-param optional">x3</dt>
962 <dd class="dr-optional">optional</dd>
963 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
964 <dd class="dr-description">x coord of third point</dd>
965 <dt class="dr-param optional">y3</dt>
966 <dd class="dr-optional">optional</dd>
967 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
968 <dd class="dr-description">y coord of third point</dd>
969 </dl>
970 <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>
971 </div><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 source" href="raphael-src.html#L5384">&#x27ad;</a></h3>
972 <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.
973 See also <a href="#Animation.delay" class="dr-link">Animation.delay</a> and <a href="#Animation.repeat" class="dr-link">Animation.repeat</a> methods.
974 </p>
975 <p class="header">Parameters
976 </p>
977 <dl class="dr-parameters"><dt class="dr-param">params</dt>
978 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
979 <dd class="dr-description">final attributes for the element, see also <a href="#Element.attr" class="dr-link">Element.attr</a></dd>
980 <dt class="dr-param">ms</dt>
981 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
982 <dd class="dr-description">number of milliseconds for animation to run</dd>
983 <dt class="dr-param optional">easing</dt>
984 <dd class="dr-optional">optional</dd>
985 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
986 <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>
987 <dt class="dr-param optional">callback</dt>
988 <dd class="dr-optional">optional</dd>
989 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
990 <dd class="dr-description">callback function. Will be called at the end of animation.</dd>
991 </dl>
992 <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>
993 </div><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 source" href="raphael-src.html#L358">&#x27ad;</a></h3>
994 <div class="dr-method"><p>Transform angle to degrees
995 </p>
996 <p class="header">Parameters
997 </p>
998 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
999 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1000 <dd class="dr-description">angle in radians</dd>
1001 </dl>
1002 <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>
1003 </div><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 source" href="raphael-src.html#L4838">&#x27ad;</a></h3>
1004 <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:
1005 </p>
1006 <ul>
1007     <li>“linear”</li>
1008     <li>“&lt;” or “easeIn” or “ease-in”</li>
1009     <li>“>” or “easeOut” or “ease-out”</li>
1010     <li>“&lt;>” or “easeInOut” or “ease-in-out”</li>
1011     <li>“backIn” or “back-in”</li>
1012     <li>“backOut” or “back-out”</li>
1013     <li>“elastic”</li>
1014     <li>“bounce”</li>
1015 </ul>
1016 <p>See also <a href="http://raphaeljs.com/easing.html">Easing demo</a>.</p>
1017 </div><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 source" href="raphael-src.html#L5831">&#x27ad;</a></h3>
1018 <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
1019 want to wrap some common transformation or attributes in one method. In difference to canvas methods,
1020 you can redefine element method at any time. Expending element methods wouldn’t affect set.
1021 </p>
1022 <p class="header">Usage
1023 </p>
1024 <pre class="javascript code"><code>Raphael.el.red<span class="s"> = </span><b>function</b> () {
1025     <b>this</b>.attr({fill: <i>"#f00"</i>});
1026 };
1027 <span class="c">// then use it</span>
1028 paper.circle(<span class="d">100</span>, <span class="d">100</span>, <span class="d">20</span>).red();
1029 </code></pre>
1030 </div><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 source" href="raphael-src.html#L967">&#x27ad;</a></h3>
1031 <div class="dr-method"><p>Utility method
1032 Find dot coordinates on the given cubic bezier curve at the given t.
1033 </p>
1034 <p class="header">Parameters
1035 </p>
1036 <dl class="dr-parameters"><dt class="dr-param">p1x</dt>
1037 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1038 <dd class="dr-description">x of the first point of the curve</dd>
1039 <dt class="dr-param">p1y</dt>
1040 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1041 <dd class="dr-description">y of the first point of the curve</dd>
1042 <dt class="dr-param">c1x</dt>
1043 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1044 <dd class="dr-description">x of the first anchor of the curve</dd>
1045 <dt class="dr-param">c1y</dt>
1046 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1047 <dd class="dr-description">y of the first anchor of the curve</dd>
1048 <dt class="dr-param">c2x</dt>
1049 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1050 <dd class="dr-description">x of the second anchor of the curve</dd>
1051 <dt class="dr-param">c2y</dt>
1052 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1053 <dd class="dr-description">y of the second anchor of the curve</dd>
1054 <dt class="dr-param">p2x</dt>
1055 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1056 <dd class="dr-description">x of the second point of the curve</dd>
1057 <dt class="dr-param">p2y</dt>
1058 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1059 <dd class="dr-description">y of the second point of the curve</dd>
1060 <dt class="dr-param">t</dt>
1061 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1062 <dd class="dr-description">position on the curve (0..1)</dd>
1063 </dl>
1064 <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>
1065 <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>
1066 <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>
1067 <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>
1068 <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>
1069 </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>
1070 <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>
1071 </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>
1072 <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>
1073 </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>
1074 <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>
1075 </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>
1076 </ol></li><li>}</li></ol>
1077 </div><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 source" href="raphael-src.html#L289">&#x27ad;</a></h3>
1078 <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,
1079 you can create your own pie chart function and ship it as a Raphaël plugin. To do this
1080 you need to extend the <code>Raphael.fn</code> object. Please note that you can create your own namespaces
1081 inside the <code>fn</code> object — methods will be run in the context of canvas anyway. You should alter
1082 the <code>fn</code> object before a Raphaël instance is created, otherwise it will take no effect.
1083 </p>
1084 <p class="header">Usage
1085 </p>
1086 <pre class="javascript code"><code>Raphael.fn.arrow<span class="s"> = </span><b>function</b> (x1, y1, x2, y2, size) {
1087     <b>return</b> <b>this</b>.path( ... );
1088 };
1089 <span class="c">// or create namespace</span>
1090 Raphael.fn.mystuff<span class="s"> = </span>{
1091     arrow: <b>function</b> () {…},
1092     star: <b>function</b> () {…},
1093     <span class="c">// etc…</span>
1094 };
1095 <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>);
1096 <span class="c">// then use it</span>
1097 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>});
1098 paper.mystuff.arrow();
1099 paper.mystuff.star();
1100 </code></pre>
1101 </div><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 source" href="raphael-src.html#L830">&#x27ad;</a></h3>
1102 <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>
1103 </p>
1104 <p class="header">Parameters
1105 </p>
1106 <dl class="dr-parameters"><dt class="dr-param optional">value</dt>
1107 <dd class="dr-optional">optional</dd>
1108 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1109 <dd class="dr-description">brightness, default is <code>0.75</code></dd>
1110 </dl>
1111 <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>
1112 </div><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 source" href="raphael-src.html#L847">&#x27ad;</a></h4>
1113 <div class="dr-method"><p>Resets spectrum position for <a href="#Raphael.getColor" class="dr-link">Raphael.getColor</a> back to red.
1114 </p>
1115 </div><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 source" href="raphael-src.html#L4747">&#x27ad;</a></h3>
1116 <div class="dr-method"><p>Return coordinates of the point located at the given length on the given path.
1117 </p>
1118 <p class="header">Parameters
1119 </p>
1120 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1121 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1122 <dd class="dr-description">SVG path string</dd>
1123 <dt class="dr-param">length</dt>
1124 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1125 <dd class="dr-description">&#160;</dd>
1126 </dl>
1127 <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>
1128 <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>
1129 <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>
1130 <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>
1131 </ol></li><li>}</li></ol>
1132 </div><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 source" href="raphael-src.html#L708">&#x27ad;</a></h3>
1133 <div class="dr-method"><p>Parses colour string as RGB object
1134 </p>
1135 <p class="header">Parameters
1136 </p>
1137 <dl class="dr-parameters"><dt class="dr-param">colour</dt>
1138 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1139 <dd class="dr-description">colour string in one of formats:</dd>
1140 </dl>
1141 <ul>
1142     <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
1143     <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
1144     <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
1145     <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200,&nbsp;100,&nbsp;0)</code>”)</li>
1146     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>”)</li>
1147     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>”)</li>
1148     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
1149     <li>hsl(•••, •••, •••) — same as hsb</li>
1150     <li>hsl(•••%, •••%, •••%) — same as hsb</li>
1151 </ul>
1152 <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>
1153 <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>
1154 <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>
1155 <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>
1156 <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>
1157 <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>
1158 </ol></li><li>}</li></ol>
1159 </div><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 source" href="raphael-src.html#L4762">&#x27ad;</a></h3>
1160 <div class="dr-method"><p>Return subpath of a given path from given length to given length.
1161 </p>
1162 <p class="header">Parameters
1163 </p>
1164 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1165 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1166 <dd class="dr-description">SVG path string</dd>
1167 <dt class="dr-param">from</dt>
1168 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1169 <dd class="dr-description">position of the start of the segment</dd>
1170 <dt class="dr-param">to</dt>
1171 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1172 <dd class="dr-description">position of the end of the segment</dd>
1173 </dl>
1174 <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>
1175 </div><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 source" href="raphael-src.html#L4728">&#x27ad;</a></h3>
1176 <div class="dr-method"><p>Returns length of the given path in pixels.
1177 </p>
1178 <p class="header">Parameters
1179 </p>
1180 <dl class="dr-parameters"><dt class="dr-param">path</dt>
1181 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1182 <dd class="dr-description">SVG path string.</dd>
1183 </dl>
1184 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-number">number</em> <span class="dr-description">length.</span></p>
1185 </div><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 source" href="raphael-src.html#L790">&#x27ad;</a></h3>
1186 <div class="dr-method"><p>Converts HSB values to hex representation of the colour.
1187 </p>
1188 <p class="header">Parameters
1189 </p>
1190 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1191 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1192 <dd class="dr-description">hue</dd>
1193 <dt class="dr-param">s</dt>
1194 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1195 <dd class="dr-description">saturation</dd>
1196 <dt class="dr-param">b</dt>
1197 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1198 <dd class="dr-description">value or brightness</dd>
1199 </dl>
1200 <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>
1201 </div><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 source" href="raphael-src.html#L515">&#x27ad;</a></h3>
1202 <div class="dr-method"><p>Converts HSB values to RGB object.
1203 </p>
1204 <p class="header">Parameters
1205 </p>
1206 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1207 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1208 <dd class="dr-description">hue</dd>
1209 <dt class="dr-param">s</dt>
1210 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1211 <dd class="dr-description">saturation</dd>
1212 <dt class="dr-param">v</dt>
1213 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1214 <dd class="dr-description">value or brightness</dd>
1215 </dl>
1216 <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>
1217 <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>
1218 <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>
1219 <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>
1220 <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>
1221 </ol></li><li>}</li></ol>
1222 </div><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 source" href="raphael-src.html#L804">&#x27ad;</a></h3>
1223 <div class="dr-method"><p>Converts HSL values to hex representation of the colour.
1224 </p>
1225 <p class="header">Parameters
1226 </p>
1227 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1228 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1229 <dd class="dr-description">hue</dd>
1230 <dt class="dr-param">s</dt>
1231 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1232 <dd class="dr-description">saturation</dd>
1233 <dt class="dr-param">l</dt>
1234 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1235 <dd class="dr-description">luminosity</dd>
1236 </dl>
1237 <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>
1238 </div><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 source" href="raphael-src.html#L552">&#x27ad;</a></h3>
1239 <div class="dr-method"><p>Converts HSL values to RGB object.
1240 </p>
1241 <p class="header">Parameters
1242 </p>
1243 <dl class="dr-parameters"><dt class="dr-param">h</dt>
1244 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1245 <dd class="dr-description">hue</dd>
1246 <dt class="dr-param">s</dt>
1247 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1248 <dd class="dr-description">saturation</dd>
1249 <dt class="dr-param">l</dt>
1250 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1251 <dd class="dr-description">luminosity</dd>
1252 </dl>
1253 <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>
1254 <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>
1255 <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>
1256 <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>
1257 <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>
1258 </ol></li><li>}</li></ol>
1259 </div><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 source" href="raphael-src.html#L300">&#x27ad;</a></h3>
1260 <div class="dr-method"><p>Handfull replacement for <code>typeof</code> operator.
1261 </p>
1262 <p class="header">Parameters
1263 </p>
1264 <dl class="dr-parameters"><dt class="dr-param">o</dt>
1265 <dd class="dr-type"><em class="dr-type-…">…</em></dd>
1266 <dd class="dr-description">any object or primitive</dd>
1267 <dt class="dr-param">type</dt>
1268 <dd class="dr-type"><em class="dr-type-string">string</em></dd>
1269 <dd class="dr-description">name of the type, i.e. “string”, “function”, “number”, etc.</dd>
1270 </dl>
1271 <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>
1272 </div><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 source" href="raphael-src.html#L862">&#x27ad;</a></h3>
1273 <div class="dr-method"><p>Utility method
1274 Parses given path string into an array of arrays of path segments.
1275 </p>
1276 <p class="header">Parameters
1277 </p>
1278 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1279 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1280 <dd class="dr-description">path string or array of segments (in the last case it will be returned straight away)</dd>
1281 </dl>
1282 <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>
1283 </div><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 source" href="raphael-src.html#L905">&#x27ad;</a></h3>
1284 <div class="dr-method"><p>Utility method
1285 Parses given path string into an array of transformations.
1286 </p>
1287 <p class="header">Parameters
1288 </p>
1289 <dl class="dr-parameters"><dt class="dr-param">TString</dt>
1290 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1291 <dd class="dr-description">transform string or array of transformations (in the last case it will be returned straight away)</dd>
1292 </dl>
1293 <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>
1294 </div><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 source" href="raphael-src.html#L1684">&#x27ad;</a></h3>
1295 <div class="dr-method"><p>Utility method
1296 Converts path to a new path where all segments are cubic bezier curves.
1297 </p>
1298 <p class="header">Parameters
1299 </p>
1300 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1301 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1302 <dd class="dr-description">path string or array of segments</dd>
1303 </dl>
1304 <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>
1305 </div><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 source" href="raphael-src.html#L1672">&#x27ad;</a></h3>
1306 <div class="dr-method"><p>Utility method
1307 Converts path to relative form
1308 </p>
1309 <p class="header">Parameters
1310 </p>
1311 <dl class="dr-parameters"><dt class="dr-param">pathString</dt>
1312 <dd class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em></dd>
1313 <dd class="dr-description">path string or array of segments</dd>
1314 </dl>
1315 <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>
1316 </div><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 source" href="raphael-src.html#L346">&#x27ad;</a></h3>
1317 <div class="dr-method"><p>Transform angle to radians
1318 </p>
1319 <p class="header">Parameters
1320 </p>
1321 <dl class="dr-parameters"><dt class="dr-param">deg</dt>
1322 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1323 <dd class="dr-description">angle in degrees</dd>
1324 </dl>
1325 <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>
1326 </div><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 source" href="raphael-src.html#L818">&#x27ad;</a></h3>
1327 <div class="dr-method"><p>Converts RGB values to hex representation of the colour.
1328 </p>
1329 <p class="header">Parameters
1330 </p>
1331 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1332 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1333 <dd class="dr-description">red</dd>
1334 <dt class="dr-param">g</dt>
1335 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1336 <dd class="dr-description">green</dd>
1337 <dt class="dr-param">b</dt>
1338 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1339 <dd class="dr-description">blue</dd>
1340 </dl>
1341 <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>
1342 </div><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 source" href="raphael-src.html#L592">&#x27ad;</a></h3>
1343 <div class="dr-method"><p>Converts RGB values to HSB object.
1344 </p>
1345 <p class="header">Parameters
1346 </p>
1347 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1348 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1349 <dd class="dr-description">red</dd>
1350 <dt class="dr-param">g</dt>
1351 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1352 <dd class="dr-description">green</dd>
1353 <dt class="dr-param">b</dt>
1354 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1355 <dd class="dr-description">blue</dd>
1356 </dl>
1357 <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>
1358 <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>
1359 <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>
1360 <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>
1361 </ol></li><li>}</li></ol>
1362 </div><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 source" href="raphael-src.html#L625">&#x27ad;</a></h3>
1363 <div class="dr-method"><p>Converts RGB values to HSL object.
1364 </p>
1365 <p class="header">Parameters
1366 </p>
1367 <dl class="dr-parameters"><dt class="dr-param">r</dt>
1368 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1369 <dd class="dr-description">red</dd>
1370 <dt class="dr-param">g</dt>
1371 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1372 <dd class="dr-description">green</dd>
1373 <dt class="dr-param">b</dt>
1374 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1375 <dd class="dr-description">blue</dd>
1376 </dl>
1377 <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>
1378 <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>
1379 <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>
1380 <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>
1381 </ol></li><li>}</li></ol>
1382 </div><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 source" href="raphael-src.html#L410">&#x27ad;</a></h3>
1383 <div class="dr-method"><p>Used when you need to draw in <code>&lt;iframe></code>. Switched window to the iframe one.
1384 </p>
1385 <p class="header">Parameters
1386 </p>
1387 <dl class="dr-parameters"><dt class="dr-param">newwin</dt>
1388 <dd class="dr-type"><em class="dr-type-window">window</em></dd>
1389 <dd class="dr-description">new window object</dd>
1390 </dl>
1391 </div><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 source" href="raphael-src.html#L372">&#x27ad;</a></h3>
1392 <div class="dr-method"><p>Snaps given value to given grid.
1393 </p>
1394 <p class="header">Parameters
1395 </p>
1396 <dl class="dr-parameters"><dt class="dr-param">values</dt>
1397 <dd class="dr-type"><em class="dr-type-array">array</em> <em class="dr-type-number">number</em></dd>
1398 <dd class="dr-description">given array of values or step of the grid</dd>
1399 <dt class="dr-param">value</dt>
1400 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1401 <dd class="dr-description">value to adjust</dd>
1402 <dt class="dr-param optional">tolerance</dt>
1403 <dd class="dr-optional">optional</dd>
1404 <dd class="dr-type"><em class="dr-type-number">number</em></dd>
1405 <dd class="dr-description">tolerance for snapping. Default is <code>10</code>.</dd>
1406 </dl>
1407 <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>
1408 </div><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 source" href="raphael-src.html#L227">&#x27ad;</a></h3>
1409 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports SVG.
1410 </p>
1411 </div><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 source" href="raphael-src.html#L209">&#x27ad;</a></h3>
1412 <div class="dr-property"><em class="dr-type dr-type-string">string</em><p>Can be “SVG”, “VML” or empty, depending on browser support.
1413 </p>
1414 </div><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 source" href="raphael-src.html#L233">&#x27ad;</a></h3>
1415 <div class="dr-property"><em class="dr-type dr-type-boolean">boolean</em><p><code>true</code> if browser supports VML.
1416 </p>
1417 </div><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>
1418 <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 source" href="raphael-src.html#L5627">&#x27ad;</a></h3>
1419 <div class="dr-method"><p>Executes given function for each element in the set.
1420 </p>
1421 <p>If function returns <code>false</code> it will stop loop running.
1422 </p>
1423 <p class="header">Parameters
1424 </p>
1425 <dl class="dr-parameters"><dt class="dr-param">callback</dt>
1426 <dd class="dr-type"><em class="dr-type-function">function</em></dd>
1427 <dd class="dr-description">function to run</dd>
1428 <dt class="dr-param">thisArg</dt>
1429 <dd class="dr-type"><em class="dr-type-object">object</em></dd>
1430 <dd class="dr-description">context object for the callback</dd>
1431 </dl>
1432 <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>
1433 </div><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 source" href="raphael-src.html#L5609">&#x27ad;</a></h3>
1434 <div class="dr-method"><p>Removes last element and returns it.
1435 </p>
1436 <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description">element</span></p>
1437 </div><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 source" href="raphael-src.html#L5589">&#x27ad;</a></h3>
1438 <div class="dr-method"><p>Adds each argument to the current set.
1439 </p>
1440 <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>
1441 </div></div></div></body></html>