1.5.1
[raphael] / reference.html
1 <!DOCTYPE html>
2 <html lang="en">
3     <head>
4         <title>Raphaël Reference</title>
5         <meta http-equiv="content-language" content="en">
6         <meta charset="utf-8">
7         <meta name="author" content="Dmitry Baranovskiy">
8         <meta name="description" content="Vector Graphics JavaScript Library">
9         <meta name="keywords" content="JavaScript Library, Raphael, SVG, VML">
10         <meta name="viewport" content="width=450; user-scalable=no">
11         <link rel="apple-touch-icon-precomposed" href="/Raphael.png"/>
12         <link rel="shortcut icon" href="/favicon16.png" type="image/x-icon">
13         <link rel="stylesheet" href="site.css" type="text/css">
14         <link rel="shortcut icon" href="/favicon16.png" type="image/x-icon">
15     </head>
16     <body class="raphael" id="reference">
17         <div id="header">
18             <h1><span>&nbsp;</span>Raphaël—JavaScript Library</h1>
19         </div>
20         <div id="content">
21             <div id="top">&nbsp;</div>
22                     <div id="column-1">
23                         <h2>Main Function</h2>
24                         <h3 id="RAPHAEL">
25                             Raphael
26                         </h3>
27                         <p>
28                             Creates a canvas object on which to draw. You must do this first, as all future calls to drawing methods from this instance will be bound to this canvas.
29                         </p>
30                         <h4>Parameters</h4>
31                         <ol>
32                             <li>container <em>HTMLElement</em> or <em>string</em></li>
33                             <li>width <em>number</em></li>
34                             <li>height <em>number</em></li>
35                         </ol>
36                         <p>or</p>
37                         <ol>
38                             <li>x <em>number</em></li>
39                             <li>y <em>number</em></li>
40                             <li>width <em>number</em></li>
41                             <li>height <em>number</em></li>
42                         </ol>
43                         <p>or</p>
44                         <ol>
45                             <li>all <em>array</em> (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>})</li>
46                         </ol>
47                         <h4>Usage</h4>
48                         <pre class="javascript code"><code>// Each of the following examples create a canvas that is 320px wide by 200px high
49 // Canvas is created at the viewport’s 10,50 coordinate
50 var paper = Raphael(10, 50, 320, 200);
51 // Canvas is created at the top left corner of the #notepad element
52 // (or its top right corner in dir="rtl" elements)
53 var paper = Raphael(document.getElementById("notepad"), 320, 200);
54 // Same as above
55 var paper = Raphael("notepad", 320, 200);
56 // Image dump
57 var set = Raphael(["notepad", 320, 200, {
58     type: "rect",
59     x: 10,
60     y: 10,
61     width: 25,
62     height: 25,
63     stroke: "#f00"
64 }, {
65     type: "text",
66     x: 30,
67     y: 40,
68     text: "Dump"
69 }]);</code></pre>
70                         <h3 id="circle">
71                             circle
72                         </h3>
73                         <div class="sample" id="circle-sample"></div>
74                         <p>
75                             Draws a circle.
76                         </p>
77                         <h4>Parameters</h4>
78                         <ol>
79                             <li>x <em>number</em> X coordinate of the centre</li>
80                             <li>y <em>number</em> Y coordinate of the centre</li>
81                             <li>r <em>number</em> radius</li>
82                         </ol>
83                         <h4>Usage</h4>
84                         <pre class="javascript code"><code>var c = paper.circle(50, 50, 40);</code></pre>
85                         <h3 id="rect">
86                             rect
87                         </h3>
88                         <div class="sample" id="rect-sample"></div>
89                         <p>
90                             Draws a rectangle.
91                         </p>
92                         <h4>Parameters</h4>
93                         <ol>
94                             <li>x <em>number</em> X coordinate of top left corner</li>
95                             <li>y <em>number</em> Y coordinate of top left corner</li>
96                             <li>width <em>number</em></li>
97                             <li>height <em>number</em></li>
98                             <li>r <em>number</em> [optional] radius for rounded corners, default is 0</li>
99                         </ol>
100                         <h4>Usage</h4>
101                         <pre class="javascript code"><code>// regular rectangle</code>
102 <code>var c = paper.rect(10, 10, 50, 50);</code>
103 <code>// rectangle with rounded corners</code>
104 <code>var c = paper.rect(40, 40, 50, 50, 10);</code></pre>
105                         <h3 id="ellipse">
106                             ellipse
107                         </h3>
108                         <div class="sample" id="ellipse-sample"></div>
109                         <p>
110                             Draws an ellipse.
111                         </p>
112                         <h4>Parameters</h4>
113                         <ol>
114                             <li>x <em>number</em> X coordinate of the centre</li>
115                             <li>y <em>number</em> X coordinate of the centre</li>
116                             <li>rx <em>number</em> Horisontal radius</li>
117                             <li>ry <em>number</em> Vertical radius</li>
118                         </ol>
119                         <h4>Usage</h4>
120                         <pre class="javascript code"><code>var c = paper.ellipse(50, 50, 40, 20);</code></pre>
121                         <h3 id="image">
122                             image
123                         </h3>
124                         <div class="sample" id="image-sample"></div>
125                         <p>
126                             Embeds an image into the SVG/VML canvas.
127                         </p>
128                         <h4>Parameters</h4>
129                         <ol>
130                             <li>src <em>string</em> URI of the source image</li>
131                             <li>x <em>number</em> X coordinate position</li>
132                             <li>y <em>number</em> Y coordinate position</li>
133                             <li>width <em>number</em> Width of the image</li>
134                             <li>height <em>number</em> Height of the image</li>
135                         </ol>
136                         <h4>Usage</h4>
137                         <pre class="javascript code"><code>var c = paper.image("apple.png", 10, 10, 80, 80);</code></pre>
138                         <h3 id="set">
139                             set
140                         </h3>
141                         <div class="sample" id="set-sample"></div>
142                         <p>
143                             Creates array-like object to keep and operate couple of elements at once. Warning: it doesn’t create any elements for itself in the page.
144                         </p>
145                         <h4>Usage</h4>
146                         <pre class="javascript code"><code>var st = paper.set();</code>
147 <code>st.push(
148     paper.circle(10, 10, 5),
149     paper.circle(30, 10, 5)
150 );</code>
151 <code>st.attr({fill: "red"});</code></pre>
152                         <h3 id="text">
153                             text
154                         </h3>
155                         <div class="sample" id="text-sample"></div>
156                         <p>
157                             Draws a text string. If you need line breaks, put “\n” in the string.
158                         </p>
159                         <h4>Parameters</h4>
160                         <ol>
161                             <li>x <em>number</em> X coordinate position.</li>
162                             <li>y <em>number</em> Y coordinate position.</li>
163                             <li>text <em>string</em> The text string to draw.</li>
164                         </ol>
165                         <h4>Usage</h4>
166                         <pre class="javascript code"><code>var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!");</code></pre>
167                         <h3 id="path">
168                             path
169                         </h3>
170                         <div class="sample" id="path-sample"></div>
171                         <p>
172                             Creates a path element by given path data string.
173                         </p>
174                         <h4>Parameters</h4>
175                         <ol>
176                             <li>pathString <em>string</em> [optional] Path data in <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a>.</li>
177                         </ol>
178                         <h4>Usage</h4>
179                         <pre class="javascript code"><code>var c = paper.path("M10 10L90 90");
180 // draw a diagonal line:
181 // move to 10,10, line to 90,90</code></pre>
182                         <h3 id="clear">
183                             clear
184                         </h3>
185                         <p>
186                             Clears the canvas, i.e. removes all the elements.
187                         </p>
188                         <h4>Usage</h4>
189                         <pre class="javascript code"><code>var c = paper.path("M10 10L90 90");
190 paper.clear();</code></pre>
191                         <h2 id="Element">
192                             Element’s generic methods
193                         </h2>
194                         <p>
195                             Each object created on the canvas shares these same generic methods:
196                         </p>
197                         <h3 id="node">
198                             node
199                         </h3>
200                         <p>
201                             Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
202                         </p>
203                         <h4>Usage</h4>
204                         <pre class="javascript code"><code>// draw a circle at coordinate 10,10 with radius of 10
205 var c = paper.circle(10, 10, 10);
206 c.node.onclick = function () {
207     c.attr("fill", "red");
208 };</code></pre>
209                         <h3 id="paper">
210                             paper
211                         </h3>
212                         <p>
213                             Internal reference to “paper” where object drawn. Mainly for use in plugins and element extensions.
214                         </p>
215                         <h4>Usage</h4>
216                         <pre class="javascript code"><code>Raphael.el.cross = function () {
217     this.attr({fill: "red"});
218     this.paper.path("M10,10L50,50M50,10L10,50")
219         .attr({stroke: "red"});
220 }</code></pre>
221                         <h3 id="remove">
222                             remove
223                         </h3>
224                         <p>
225                             Removes element from the DOM. You can’t use it after this method call.
226                         </p>
227                         <h4>Usage</h4>
228                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
229 c.remove();</code></pre>
230                         <h3 id="hide">
231                             hide
232                         </h3>
233                         <p>
234                             Makes element invisible.
235                         </p>
236                         <h4>Usage</h4>
237                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
238 c.hide();</code></pre>
239                         <h3 id="show">
240                             show
241                         </h3>
242                         <p>
243                             Makes element visible.
244                         </p>
245                         <h4>Usage</h4>
246                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
247 c.show();</code></pre>
248                         <h3 id="rotate">
249                             rotate
250                         </h3>
251                         <p>
252                             Rotates the element by the given degree from its center point.
253                         </p>
254                         <h4>Parameters</h4>
255                         <ol>
256                             <li>degree <em>number</em> Degree of rotation (0 – 360°)</li>
257                             <li>isAbsolute <em>boolean</em> [optional] Specifies is degree is relative to previous position (<code>false</code>) or is it absolute angle (<code>true</code>)</li>
258                         </ol>
259                         <p>or</p>
260                         <ol>
261                             <li>degree <em>number</em> Degree of rotation (0 – 360°)</li>
262                             <li>cx <em>number</em> [optional] X coordinate of the origin of rotation</li>
263                             <li>cY <em>number</em> [optional] Y coordinate of the origin of rotation</li>
264                         </ol>
265                         <h4>Usage</h4>
266                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
267 c.rotate(45);        // rotation is relative
268 c.rotate(45, true);  // rotation is absolute</code></pre>
269                         <h3 id="translate">
270                             translate
271                         </h3>
272                         <p>
273                             Moves the element around the canvas by the given distances.
274                         </p>
275                         <h4>Parameters</h4>
276                         <ol>
277                             <li>dx <em>number</em> Pixels of translation by X axis</li>
278                             <li>dy <em>number</em> Pixels of translation by Y axis</li>
279                         </ol>
280                         <h4>Usage</h4>
281                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
282 // moves the circle 10&nbsp;px to the right and down
283 c.translate(10, 10);</code></pre>
284                         <h3 id="scale">
285                             scale
286                         </h3>
287                         <p>
288                             Resizes the element by the given multiplier.
289                         </p>
290                         <h4>Parameters</h4>
291                         <ol>
292                             <li>Xtimes <em>number</em> Amount to scale horizontally</li>
293                             <li>Ytimes <em>number</em> Amount to scale vertically</li>
294                             <li>centerX <em>number</em> [optional] X of the center of scaling, default is the center of the element</li>
295                             <li>centerY <em>number</em> [optional] Y of the center of scaling, default is the center of the element</li>
296                         </ol>
297                         <h4>Usage</h4>
298                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
299 // makes the circle 1.5 times larger
300 c.scale(1.5, 1.5);
301 // makes the circle half as wide, and 75% as high
302 c.scale(.5, .75);</code></pre>
303                         <h3 id="attr">
304                             attr
305                         </h3>
306                         <p>
307                             Sets the attributes of elements directly.
308                         </p>
309                         <h4>Parameters</h4>
310                         <ol>
311                             <li>attributeName <em>string</em></li>
312                             <li>value <em>string</em></li>
313                         </ol>
314                         <p>or</p>
315                         <ol>
316                             <li>params <em>object</em></li>
317                         </ol>
318                         <p>or</p>
319                         <ol>
320                             <li>attributeName <em>string</em> in this case method returns current value for given attribute name</li>
321                         </ol>
322                         <p>or</p>
323                         <ol>
324                             <li>attributeNames <em>array</em> in this case method returns array of current values for given attribute names</li>
325                         </ol>
326                         <p>or</p>
327                         <p>no parameters, in this case object containing all attributes will be returned</p>
328                         <h4>Possible parameters</h4>
329                         <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>
330                         <ul>
331                             <li id="attr-clip-rect">clip-rect <em>string</em> comma or space separated values: x, y, width and height</li>
332                             <li id="attr-cursor">cursor <em>string</em> CSS type of the cursor</li>
333                             <li id="attr-cx">cx <em>number</em></li>
334                             <li id="attr-cy">cy <em>number</em></li>
335                             <li id="attr-fill">
336                                 fill <em>colour</em> or <em>gradient</em>
337                                 <ul>
338                                     <li>linear gradient: “‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›”, example: “<samp>90-#fff-#000</samp>” – 90° gradient from white to black or “<samp>0-#fff-#f00:20-#000</samp>” – 0° gradient from white via red (at 20%) to black</li>
339                                     <li>radial gradient: “r[(‹fx›, ‹fy›)]‹colour›[-‹colour›[:‹offset›]]*-‹colour›”, example: “<samp>r#fff-#000</samp>” – gradient from white to black or “<samp>r(0.25, 0.75)#fff-#000</samp>” – gradient from white to black with focus point at 0.25, 0.75</li>
340                                     <li>Focus point coordinates are in 0..1 range</li>
341                                     <li>Radial gradients can only be applied to circles and ellipses</li>
342                                 </ul>
343                             </li>
344                             <li id="attr-fill-opacity">fill-opacity <em>number</em></li>
345                             <li id="attr-font">font <em>string</em></li>
346                             <li id="attr-font-family">font-family <em>string</em></li>
347                             <li id="attr-font-size">font-size <em>number</em></li>
348                             <li id="attr-font-weight">font-weight <em>string</em></li>
349                             <li id="attr-height">height <em>number</em></li>
350                             <li id="attr-href">href <em>string</em> URL, if specified element behaves as hyperlink</li>
351                             <li id="attr-opacity">opacity <em>number</em></li>
352                             <li id="attr-path">path <em>pathString</em> <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path’s data attribute’s format are described in the SVG specification.">SVG path string format</a></li>
353                             <li id="attr-r">r <em>number</em></li>
354                             <li id="attr-rotation">rotation <em>number</em></li>
355                             <li id="attr-rx">rx <em>number</em></li>
356                             <li id="attr-ry">ry <em>number</em></li>
357                             <li id="attr-scale">scale <em>string</em> comma or space separated values: xtimes, ytimes, cx, cy. See: <a href="#scale">scale</a></li>
358                             <li id="attr-src">src <em>string</em> (URL)</li>
359                             <li id="attr-stroke">stroke <em>colour</em></li>
360                             <li id="attr-stroke-dasharray">stroke-dasharray <em>string</em> [“”, “<samp>-</samp>”, “<samp>.</samp>”, “<samp>-.</samp>”, “<samp>-..</samp>”, “<samp>. </samp>”, “<samp>- </samp>”, “<samp>--</samp>”, “<samp>-&nbsp;.</samp>”, “<samp>--.</samp>”, “<samp>--..</samp>”]</li>
361                             <li id="attr-stroke-linecap">stroke-linecap <em>string</em> [“<samp>butt</samp>”, “<samp>square</samp>”, “<samp>round</samp>”]</li>
362                             <li id="attr-stroke-linejoin">stroke-linejoin <em>string</em> [“<samp>bevel</samp>”, “<samp>round</samp>”, “<samp>miter</samp>”]</li>
363                             <li id="attr-stroke-miterlimit">stroke-miterlimit <em>number</em></li>
364                             <li id="attr-stroke-opacity">stroke-opacity <em>number</em></li>
365                             <li id="attr-stroke-width">stroke-width <em>number</em></li>
366                             <li id="attr-target">target <em>string</em> used with <a href="#attr-href">href</a></li>
367                             <li id="attr-text-anchor">text-anchor <em>string</em> [“<samp>start</samp>”, “<samp>middle</samp>”, “<samp>end</samp>”], default is “middle”</li>
368                             <li id="attr-title">title <em>string</em> will create tooltip with a given text</li>
369                             <li id="attr-translation">translation <em>string</em> comma or space separated values: x and y</li>
370                             <li id="attr-width">width <em>number</em></li>
371                             <li id="attr-x">x <em>number</em></li>
372                             <li id="attr-y">y <em>number</em></li>
373                         </ul>
374                         <h4>Usage</h4>
375                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
376 // using strings
377 c.attr("fill", "black");
378 // using params object
379 c.attr({fill: "#000", stroke: "#f00", opacity: 0.5});
380 c.attr({
381     fill: "90-#fff-#000",
382     "stroke-dasharray": "-..",
383     "clip-rect": "10, 10, 100, 100"
384 });</code></pre>
385                         <h3 id="animate">
386                             animate
387                         </h3>
388                         <p>
389                             Changes an attribute from its current value to its specified value in the given amount of milliseconds.
390                         </p>
391                         <h4>Parameters</h4>
392                         <ol>
393                             <li>newAttrs <em>object</em> A parameters object of the animation results. (Not all attributes can be animated.)</li>
394                             <li>ms <em>number</em> The duration of the animation, given in milliseconds.</li>
395                             <li>callback <em>function</em> [optional]</li>
396                         </ol>
397                         <p>or</p>
398                         <ol>
399                             <li>newAttrs <em>object</em> A parameters object of the animation results. (Not all attributes can be animated.)</li>
400                             <li>ms <em>number</em> The duration of the animation, given in milliseconds.</li>
401                             <li>easing <em>string</em> [“<samp>></samp>”, “<samp>&lt;</samp>”, “<samp>&lt;></samp>”, “<samp>backIn</samp>”, “<samp>backOut</samp>”, “<samp>bounce</samp>”, “<samp>elastic</samp>”, “<samp>cubic-bezier(p1, p2, p3, p4)</samp>”] or <em>function</em> [optional], see <a href="http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag" title="CSS Transitions Module Level 3">explanation re cubic-bezier syntax</a></li>
402                             <li>callback <em>function</em> [optional]</li>
403                         </ol>
404                         <p>or</p>
405                         <ol>
406                             <li>keyFrames <em>object</em> Key-value map, where key represents keyframe timing: [“from”, “20%”, “to”, “35%”, etc] and value is the same as <code>newAttrs</code> from above, except it could also have <samp>easing</samp> and <samp>callback</samp> properties</li>
407                             <li>ms <em>number</em> The duration of the animation, given in milliseconds.</li>
408                         </ol>
409                         <p>Look at the <a href="bounce.html">example of keyframes usage</a></p>
410                         <h4>Attributes that can be animated</h4>
411                         <p>The <code>newAttrs</code> parameter accepts an object whose properties are the attributes to animate. However, not all attributes listed in the <code>attr</code> method reference can be animated. The following is a list of those properties that can be animated:</p>
412                         <ul>
413                             <li>clip-rect <em>string</em></li>
414                             <li>cx <em>number</em></li>
415                             <li>cy <em>number</em></li>
416                             <li>fill <em>colour</em></li>
417                             <li>fill-opacity <em>number</em></li>
418                             <li>font-size <em>number</em></li>
419                             <li>height <em>number</em></li>
420                             <li>opacity <em>number</em></li>
421                             <li>path <em>pathString</em></li>
422                             <li>r <em>number</em></li>
423                             <li>rotation <em>string</em></li>
424                             <li>rx <em>number</em></li>
425                             <li>ry <em>number</em></li>
426                             <li>scale <em>string</em></li>
427                             <li>stroke <em>colour</em></li>
428                             <li>stroke-opacity <em>number</em></li>
429                             <li>stroke-width <em>number</em></li>
430                             <li>translation <em>string</em></li>
431                             <li>width <em>number</em></li>
432                             <li>x <em>number</em></li>
433                             <li>y <em>number</em></li>
434                         </ul>
435                         <h4>Easing</h4>
436                         <p>
437                             For easing use built in functions or add your own by adding new functions to <code>Raphael.easing_formulas</code> object. Look at the <a href="easing.html">example of easing usage</a>.
438                         </p>
439                         <h4>Usage</h4>
440                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);
441 c.animate({cx: 20, r: 20}, 2000);
442 c.animate({cx: 20, r: 20}, 2000, "bounce");
443 c.animate({
444     "20%": {cx: 20, r: 20, easing: ">"},
445     "50%": {cx: 70, r: 120, callback: function () {…}},
446     "100%": {cx: 10, r: 10}
447 }, 2000);</code></pre>
448                         <h3 id="animateWith">
449                             animateWith
450                         </h3>
451                         <p>
452                             The same as <a href="#animate"><code>animate</code></a> method, but synchronise animation with another element.
453                         </p>
454                         <h4>Parameters</h4>
455                         <p>The same as for <a href="#animate"><code>animate</code></a> method, but first argument is an element.</p>
456                         <h4>Usage</h4>
457                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10),
458     r = paper.rect(10, 10, 10, 10);
459 c.animate({cx: 20, r: 20}, 2000);
460 r.animateWith(c, {x: 20}, 2000);</code></pre>
461                         <h3 id="animateAlong">
462                             animateAlong
463                         </h3>
464                         <div class="sample" id="along-sample"></div>
465                         <p>
466                             Animates element along the given path. As an option it could rotate element along the path.
467                         </p>
468                         <h4>Parameters</h4>
469                         <ol>
470                             <li>path <em>object</em> or <em>string</em> path element or path string along which the element will be animated</li>
471                             <li>ms <em>number</em> The duration of the animation, given in milliseconds.</li>
472                             <li>rotate <em>boolean</em> [optional] if true, element will be rotated along the path</li>
473                             <li>callback <em>function</em> [optional]</li>
474                         </ol>
475                         <h4>Usage</h4>
476                         <pre class="javascript code"><code>var p = r.path("M100,100c0,50 100-50 100,0c0,50 -100-50 -100,0z").attr({stroke: "#ddd"}),
477     e = r.ellipse(104, 100, 4, 4).attr({stroke: "none", fill: "#f00"}),
478     b = r.rect(0, 0, 620, 400).attr({stroke: "none", fill: "#000", opacity: 0}).click(function () {
479         e.attr({rx: 5, ry: 3}).animateAlong(p, 4000, true, function () {
480             e.attr({rx: 4, ry: 4});
481         });
482     });</code></pre>
483                         <h3 id="animateAlongBack">
484                             animateAlongBack
485                         </h3>
486                         <p>
487                             Similar to <a href="animateAlong"><code>animateAlong</code></a>. Animates element along the given path, starting from the end of it.
488                         </p>
489                         <h3 id="onAnimation">
490                             onAnimation
491                         </h3>
492                         <div class="sample" id="onanim-sample"></div>
493                         <p>
494                             Sets or resets the function that will be called on each stage of the animation.
495                         </p>
496                         <h4>Parameters</h4>
497                         <ol>
498                             <li>f <em>function</em> function that will be called on each stage of animation</li>
499                         </ol>
500                         <h4>Usage</h4>
501                         <pre class="javascript code"><code>var p = r.path("M10,50c0,50,80-50,80,0c0,50-80-50-80,0z"),
502     p2 = r.path(),
503     e = r.ellipse(10, 50, 4, 4).attr({stroke: "none", fill: "#f00"}).onAnimation(function () {
504         p2.attr({path: "M50,10L" + e.attr("cx") + "," + e.attr("cy")});
505     }),
506     b = r.rect(0, 0, 620, 400).attr({stroke: "none", fill: "#000", opacity: 0}).click(function () {
507         e.attr({rx: 5, ry: 3}).animateAlong(p, 4000, true, function () {
508             e.attr({rx: 4, ry: 4});
509         });
510     });</code></pre>
511                         <h3 id="getBBox">
512                             getBBox
513                         </h3>
514                         <p>
515                             Returns the dimensions of an element.
516                         </p>
517                         <h4>Usage</h4>
518                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);</code>
519 <code>var width = c.getBBox().width;</code></pre>
520                         <h3 id="toFront">
521                             toFront
522                         </h3>
523                         <p>
524                             Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
525                         </p>
526                         <h4>Usage</h4>
527                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);</code>
528 <code>c.toFront();</code></pre>
529                         <h3 id="toBack">
530                             toBack
531                         </h3>
532                         <p>
533                             Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
534                         </p>
535                         <h4>Usage</h4>
536                         <pre class="javascript code"><code>var c = paper.circle(10, 10, 10);</code>
537 <code>c.toBack();</code></pre>
538                         <h3 id="insertBefore">
539                             insertBefore
540                         </h3>
541                         <p>
542                             Inserts current object before the given one.
543                         </p>
544                         <h4>Usage</h4>
545                         <pre class="javascript code"><code>var r = paper.rect(10, 10, 10, 10);</code>
546 <code>var c = paper.circle(10, 10, 10);</code>
547 <code>c.insertBefore(r);</code></pre>
548                         <h3 id="insertAfter">
549                             insertAfter
550                         </h3>
551                         <p>
552                             Inserts current object after the given one.
553                         </p>
554                         <h4>Usage</h4>
555                         <pre class="javascript code"><code>var r = paper.rect(10, 10, 10, 10);
556 var c = paper.circle(10, 10, 10);
557 r.insertAfter(c);</code></pre>
558                         <h3 id="clone">
559                             clone
560                         </h3>
561                         <p>
562                             Returns a clone of the current element.
563                         </p>
564                         <h4>Usage</h4>
565                         <pre class="javascript code"><code>var r = paper.rect(10, 10, 10, 10);
566 var c = r.clone();</code></pre>
567                         <h2>Graphic Primitives</h2>
568                         <p>
569                             Methods of “paper” object, created with <code>Raphael</code> function call.
570                         </p>
571                         <h3 id="raphael">
572                             raphael
573                         </h3>
574                         <p>
575                             Internal reference to <code>Raphael</code> object. In case it is not available.
576                         </p>
577                         <h4>Usage</h4>
578                         <pre class="javascript code"><code>Raphael.el.red = function () {
579     var hsb = this.paper.raphael.rgb2hsb(this.attr("fill"));
580     hsb.h = 1;
581     this.attr({fill: this.paper.raphael.hsb2rgb(hsb).hex});
582 }</code></pre>
583                         <h3 id="getTotalLength">
584                             getTotalLength
585                         </h3>
586                         <p>
587                             Path specific method. Returns length of the path in pixels.
588                         </p>
589                         <h4>Usage</h4>
590                         <pre class="javascript code"><code>var p = r.path("M100,100c0,50 100-50 100,0c0,50 -100-50 -100,0z");
591     alert(p.getTotalLength());</code></pre>
592                         <h3 id="getPointAtLength">
593                             getPointAtLength
594                         </h3>
595                         <div class="sample" id="point-sample"></div>
596                         <p>
597                             Path specific method. Returns point description at given length.
598                         </p>
599                         <h4>Parameters</h4>
600                         <ol>
601                             <li>length <em>number</em> length in pixels from the beginining of the path to the point</li>
602                         </ol>
603                         <h4>Usage</h4>
604                         <pre class="javascript code"><code>var p = r.path("M10,50c0,50,80-50,80,0c0,50-80-50-80,0z");
605     var point = p.getPointAtLength(30);
606     r.circle(point.x, point.y, 3);</code></pre>
607                         <p>Returned object format:</p>
608                         <ul>
609                             <li>x – x coordinate of the point</li>
610                             <li>y – y coordinate of the point</li>
611                             <li>alpha – angle of the path at the point</li>
612                         </ul>
613                         <h3 id="getSubpath">
614                             getSubpath
615                         </h3>
616                         <div class="sample" id="subpath-sample"></div>
617                         <p>
618                             Path specific method. Returns the subpath string of a given path.
619                         </p>
620                         <h4>Parameters</h4>
621                         <ol>
622                             <li>from <em>number</em> length in pixels from the beginning of the path to the beginning of the subpath</li>
623                             <li>to <em>number</em> length in pixels from the beginning of the path to the end of the subpath</li>
624                         </ol>
625                         <h4>Usage</h4>
626                         <pre class="javascript code"><code>var p = r.path("M10,50c0,50,80-50,80,0c0,50-80-50-80,0z");
627     var path = p.getSubpath(10, 60);
628     r.path(path).attr({stroke: "#f00"});</code></pre>
629                         <h3 id="setSize">
630                             setSize
631                         </h3>
632                         <p>
633                             If you need to change dimensions of the canvas call this method
634                         </p>
635                         <h4>Parameters</h4>
636                         <ol>
637                             <li>width <em>number</em> new width of the canvas</li>
638                             <li>height <em>number</em> new height of the canvas</li>
639                         </ol>
640                         <h3 id="setWindow">
641                             setWindow
642                         </h3>
643                         <p>
644                             Should be called before main Raphael method. Sets which window should be used for drawing. Default is the current one. You need to use it if you want to draw inside <code>iframe</code>
645                         </p>
646                         <h4>Parameters</h4>
647                         <ol>
648                             <li>window <em>object</em></li>
649                         </ol>
650                         <h3 id="getRGB">
651                             getRGB
652                         </h3>
653                         <p>
654                             Parses passes string and returns an colour object. Especially useful for plug-in developers.
655                         </p>
656                         <h4>Parameters</h4>
657                         <ol>
658                             <li>color <em>string</em> Colour in form acceptable by library</li>
659                         </ol>
660                         <h4>Usage</h4>
661                         <pre class="javascript code"><code>var stroke = Raphael.getRGB(circle.attr("stroke")).hex;</code></pre>
662                         <h3 id="angle">
663                             angle
664                         </h3>
665                         <p>
666                             Gives you an angle of the line formed by two points or angle between two lines formed by three points.
667                         </p>
668                         <h4>Parameters</h4>
669                         <ol>
670                             <li>x1 <em>number</em> X of the first point</li>
671                             <li>y1 <em>number</em> Y of the first point</li>
672                             <li>x2 <em>number</em> X of the second point</li>
673                             <li>y2 <em>number</em> Y of the second point</li>
674                             <li>x3 <em>number</em> X of the third point [optional]</li>
675                             <li>y3 <em>number</em> Y of the third point [optional]</li>
676                         </ol>
677                         <h4>Usage</h4>
678                         <pre class="javascript code"><code>var angle = Raphael.angle(10, 10, 50, 50);</code></pre>
679                         <h3 id="rad">
680                             rad
681                         </h3>
682                         <p>
683                             Converts angle to radians.
684                         </p>
685                         <h4>Parameters</h4>
686                         <ol>
687                             <li>deg <em>number</em> value of an angle in degrees</li>
688                         </ol>
689                         <h4>Usage</h4>
690                         <pre class="javascript code"><code>var Sin = Math.sin(Raphael.rad(45));</code></pre>
691                         <h3 id="deg">
692                             deg
693                         </h3>
694                         <p>
695                             Converts angle to degree.
696                         </p>
697                         <h4>Parameters</h4>
698                         <ol>
699                             <li>rad <em>number</em> value of an angle in radians</li>
700                         </ol>
701                         <h3 id="snapTo">
702                             snapTo
703                         </h3>
704                         <p>
705                             Returns a number adjusted to one of various values, if it’s close enough.
706                         </p>
707                         <h4>Parameters</h4>
708                         <ol>
709                             <li>values <em>number or array</em> If values is a number, the value will be snapped to any multiple. If an array, the value will be snapped to the first element that’s within tolerance.</li>
710                             <li>value <em>number</em> The value to adjust</li>
711                             <li>tolerance <em>number</em> The value must be within tolerance of one of the snap values, or it will be returned unchanged [optional, default 10]</li>
712                         </ol>
713                         <h4>Usage</h4>
714                         <pre class="javascript code"><code>// adjust -10..10 to 0, 40..60 to 50, 90-110 to 100, etc
715 x = Raphael.snapTo(50, x);
716 // adjust 5..35 to 20, 45..75 to 60, otherwise no change
717 x = Raphael.snapTo([20, 60], x, 15);</code></pre>
718                         <h3 id="getColor">
719                             getColor
720                         </h3>
721                         <p>
722                             Returns a colour object for the next colour in spectrum
723                         </p>
724                         <h4>Parameters</h4>
725                         <ol>
726                             <li>value <em>number</em> brightness [optional]</li>
727                         </ol>
728                         <h4>Usage</h4>
729                         <pre class="javascript code"><code>var c = paper.path("M10,10L100,100").attr({stroke: Raphael.getColor()});</code></pre>
730                         <h3 id="getColor-reset">
731                             getColor.reset
732                         </h3>
733                         <p>
734                             Resets getColor function, so it will start from the beginning
735                         </p>
736                         <h3 id="registerFont">
737                             registerFont
738                         </h3>
739                         <p>
740                             Adds given font to the registered set of fonts for Raphaël. Should be used as an internal call from within Cufón’s font file. <a href="http://wiki.github.com/sorccu/cufon/about">More about Cufón and how to convert your font form TTF, OTF, etc to JavaScript file</a>. Returns original parameter, so it could be used with chaining.
741                         </p>
742                         <h4>Parameters</h4>
743                         <ol>
744                             <li>font <em>object</em> the font to register</li>
745                         </ol>
746                         <h4>Usage</h4>
747                         <pre class="javascript code"><code>Cufon.registerFont(Raphael.registerFont({…}))</code></pre>
748                         <h3 id="getFont">
749                             getFont
750                         </h3>
751                         <p>
752                             Finds font object in the registered fonts by given parameters. You could specify only one word from the font name, like “Myriad” for “Myriad Pro”.
753                         </p>
754                         <h4>Parameters</h4>
755                         <ol>
756                             <li>family <em>string</em> font family name or any word from it</li>
757                             <li>weight <em>string</em> weight of the font [optional]</li>
758                             <li>style <em>string</em> style of the font [optional]</li>
759                             <li>stretch <em>string</em> stretch of the font [optional]</li>
760                         </ol>
761                         <h4>Usage</h4>
762                         <pre class="javascript code"><code>paper.print(100, 100, "Test string", paper.getFont("Times", 800), 30);</code></pre>
763                         <h3 id="print">
764                             print
765                         </h3>
766                         <div class="sample" id="print-sample"></div>
767                         <p>
768                             Creates set of shapes to represent given font at given position with given size. Result of the method is set object (see <a href="#set">set</a>) which contains each letter as separate path object.
769                         </p>
770                         <h4>Parameters</h4>
771                         <ol>
772                             <li>x <em>number</em> x position of the text</li>
773                             <li>y <em>number</em> y position of the text</li>
774                             <li>text <em>string</em> text to print</li>
775                             <li>font <em>object</em> font object (see <a href="#getFont">getFont</a>)</li>
776                             <li>font_size <em>number</em> size of the font</li>
777                         </ol>
778                         <h4>Usage</h4>
779                         <pre class="javascript code"><code>var txt = r.print(10, 50, "print", r.getFont("Museo"), 30).attr({fill: "#fff"});
780 // following line will paint first letter in red
781 txt[0].attr({fill: "#f00"});</code></pre>
782                         <h3 id="plugins-canvas">
783                             Adding your own methods to canvas
784                         </h3>
785                         <p>
786                             You can add your own method to the canvas. For example if you want to draw pie chart, you can create your own pie chart function and ship it as a Raphaël plugin. To do this you need to extend Raphael.fn object. Please note that you can create your own namespaces inside fn object. Methods will be run in context of canvas anyway. You should alter fn object before Raphaël instance was created, otherwise it will take no effect.
787                         </p>
788                         <h4>Usage</h4>
789                         <pre class="javascript code"><code>Raphael.fn.arrow = function (x1, y1, x2, y2, size) {
790     return this.path( ... );
791 };
792 // or create namespace
793 Raphael.fn.mystuff = {
794     arrow: function () {…},
795     star: function () {…},
796     // etc…
797 };
798 var paper = Raphael(10, 10, 630, 480);
799 // then use it
800 paper.arrow(10, 10, 30, 30, 5).attr({fill: "#f00"});
801 paper.mystuff.arrow();
802 paper.mystuff.star();
803 </code></pre>
804                         <h3 id="plugins-elements">
805                             Adding your own methods to elements
806                         </h3>
807                         <p>
808                             You can add your own method to elements. This is usefull when you want to hack default functionality or want to wrap some common transformation or attributes in one method. In difference to canvas mathods, you can redefine element method at any time.
809                         </p>
810                         <h4>Usage</h4>
811                         <pre class="javascript code"><code>Raphael.el.red = function () {
812     this.attr({fill: "#f00"});
813 };
814 // then use it
815 paper.circle(100, 100, 20).red();
816 </code></pre>
817                         <h3 id="custom-attributes">
818                             Custom Attributes
819                         </h3>
820                         <p>
821                             If you have a set of attributes that you would like to represent as a function of some number you can do it easily with custom attributes:
822                         </p>
823                         <h4>Usage</h4>
824                         <pre class="javascript code"><code>paper.customAttributes.hue = function (num) {
825     num = num % 1;
826     return {fill: "hsb(" + num + ", .75, 1)"};
827 };
828 // Custom attribute “hue” will change fill
829 // to be given hue with fixed saturation and brightness.
830 // Now you can use it like this:
831 var c = paper.circle(10, 10, 10).attr({hue: .45});
832 // or even like this:
833 c.animate({hue: 1}, 1e3);
834
835 // You could also create custom attribute
836 // with multiple parameters:
837 paper.customAttributes.hsb = function (h, s, b) {
838     return {fill: "hsb(" + [h, s, b].join(",") + ")"};
839 };
840 c.attr({hsb: ".5 .8 1"});
841 c.animate({hsb: "1 0 .5"}, 1e3);
842 </code></pre>
843                         <h3 id="colour">
844                             Supported colour formats
845                         </h3>
846                         <p>
847                             You could specify colour in this formats:
848                         </p>
849                         <ul>
850                             <li>Colour name (“<samp>red</samp>”, “<samp>green</samp>”, “<samp>cornflowerblue</samp>”, etc)</li>
851                             <li>#••• — shortened HTML colour: (“<samp>#000</samp>”, “<samp>#fc0</samp>”, etc)</li>
852                             <li>#•••••• — full length HTML colour: (“<samp>#000000</samp>”, “<samp>#bd2300</samp>”)</li>
853                             <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<samp>rgb(200,&nbsp;100,&nbsp;0)</samp>”)</li>
854                             <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<samp>rgb(100%,&nbsp;175%,&nbsp;0%)</samp>”)</li>
855                             <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<samp>rgba(200,&nbsp;100,&nbsp;0, .5)</samp>”)</li>
856                             <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<samp>rgba(100%,&nbsp;175%,&nbsp;0%, 50%)</samp>”)</li>
857                             <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (“<samp>hsb(0.5,&nbsp;0.25,&nbsp;1)</samp>”)</li>
858                             <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
859                             <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
860                             <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>
861                             <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
862                             <li>hsla(•••, •••, •••) — same as above, but with opacity</li>
863                             <li>Optionally for hsb and hsl you could specify hue as a degree: “<samp>hsl(240deg,&nbsp;1,&nbsp;.5)</samp>” or, if you want to go fancy, “<samp>hsl(240°,&nbsp;1,&nbsp;.5)</samp>”</li>
864                         </ul>
865                         <h4>Usage</h4>
866                         <pre class="javascript code"><code>paper.circle(100, 100, 20).attr({
867     fill: "hsb(0.6, 1, 0.75)",
868     stroke: "red"
869 });</code></pre>
870                         <h3 id="safari">
871                             safari
872                         </h3>
873                         <p>
874                             There is an inconvenient rendering bug is Safari (WebKit): sometimes the rendering should be forced. This method should help with dealing with this bug.
875                         </p>
876                         <h4>Usage</h4>
877                         <pre class="javascript code"><code>paper.safari();</code></pre>
878                         <h3 id="ninja-mode">
879                             “Ninja Mode”
880                         </h3>
881                         <p>
882                             If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable <code>Raphael</code>, but anyway.) You can use <code>ninja</code> method. Beware, that in this case plugins could stop working, because they are depending on global variable existance.
883                         </p>
884                         <h4>Usage</h4>
885                         <pre class="javascript code"><code>(function (local_raphael) {
886     var paper = local_raphael(10, 10, 320, 200);
887     …
888 })(Raphael.ninja());
889 </code></pre>
890                         <h3 id="events">
891                             Events
892                         </h3>
893                         <p>
894                             You can attach events to elements by using element.node and your favourite library (<samp>$(circle.node).click(…)</samp>) or you can use built-in methods:
895                         </p>
896                         <h4>Usage</h4>
897                         <pre class="javascript code"><code>element.click(function (event) {
898     this.attr({fill: "red"});
899 });
900 element.dblclick(function (event) {
901     this.attr({fill: "red"});
902 });
903 element.mousedown(function (event) {
904     this.attr({fill: "red"});
905 });
906 element.mousemove(function (event) {
907     this.attr({fill: "red"});
908 });
909 element.mouseout(function (event) {
910     this.attr({fill: "red"});
911 });
912 element.mouseover(function (event) {
913     this.attr({fill: "red"});
914 });
915 element.mouseup(function (event) {
916     this.attr({fill: "red"});
917 });
918 element.hover(function (event) {
919     this.attr({fill: "red"});
920 }, function (event) {
921     this.attr({fill: "black"});
922 }, overScope, outScope);</code></pre>
923                         <p>
924                             Second parameter is optional scope. By default handlers are run in the scope of the element. To unbind events use the same method names with “un” prefix, i.e. <samp>element.unclick(f);</samp>
925                         </p>
926                         <h3 id="drag-n-drop">
927                             Drag ’n’ Drop
928                         </h3>
929                         <p>
930                             To make element “draggable” you need to call method <code>drag</code> on element.
931                         </p>
932                         <h4>Parameters</h4>
933                         <ol>
934                             <li>onmove <em>function</em> event handler for moving</li>
935                             <li>onstart <em>function</em> event handler for start</li>
936                             <li>onend <em>function</em> event handler for end of the drag</li>
937                         </ol>
938                         <h4>Usage</h4>
939                         <pre class="javascript code"><code>var c = R.circle(100, 100, 50).attr({
940     fill: "hsb(.8, 1, 1)",
941     stroke: "none",
942     opacity: .5
943 });
944 var start = function () {
945     // storing original coordinates
946     this.ox = this.attr("cx");
947     this.oy = this.attr("cy");
948     this.attr({opacity: 1});
949 },
950 move = function (dx, dy) {
951     // move will be called with dx and dy
952     this.attr({cx: this.ox + dx, cy: this.oy + dy});
953 },
954 up = function () {
955     // restoring state
956     this.attr({opacity: .5});
957 };
958 c.drag(move, start, up);</code></pre>
959                         <p>
960                             To unbind drag use the <samp>undrag</samp> method.
961                         </p>
962                     </div>
963                     <div id="column-2">
964                         <h2>
965                             <a href="index.html">Home</a>
966                         </h2>
967                         <h2>
968                             Contents
969                         </h2>
970                         <ul id="contents">
971                             <li>
972                                 <a href="#Raphael"><code>Raphael</code></a>
973                             </li>
974                             <li>
975                                 <a href="#circle"><code>circle</code></a>
976                             </li>
977                             <li>
978                                 <a href="#rect"><code>rect</code></a>
979                             </li>
980                             <li>
981                                 <a href="#ellipse"><code>ellipse</code></a>
982                             </li>
983                             <li>
984                                 <a href="#image"><code>image</code></a>
985                             </li>
986                             <li>
987                                 <a href="#set"><code>set</code></a>
988                             </li>
989                             <li>
990                                 <a href="#text"><code>text</code></a>
991                             </li>
992                             <li>
993                                 <a href="#path"><code>path</code></a>
994                             </li>
995                             <li>
996                                 <a href="#clear"><code>clear</code></a>
997                             </li>
998                             <li>
999                                 <a href="#node"><code>node</code></a>
1000                             </li>
1001                             <li>
1002                                 <a href="#paper"><code>paper</code></a>
1003                             </li>
1004                             <li>
1005                                 <a href="#remove"><code>remove</code></a>
1006                             </li>
1007                             <li>
1008                                 <a href="#hide"><code>hide</code></a>
1009                             </li>
1010                             <li>
1011                                 <a href="#show"><code>show</code></a>
1012                             </li>
1013                             <li>
1014                                 <a href="#rotate"><code>rotate</code></a>
1015                             </li>
1016                             <li>
1017                                 <a href="#translate"><code>translate</code></a>
1018                             </li>
1019                             <li>
1020                                 <a href="#scale"><code>scale</code></a>
1021                             </li>
1022                             <li>
1023                                 <a href="#attr"><code>attr</code></a>
1024                             </li>
1025                             <li>
1026                                 <a href="#animate"><code>animate</code></a>
1027                             </li>
1028                             <li>
1029                                 <a href="#animateWith"><code>animateWith</code></a>
1030                             </li>
1031                             <li>
1032                                 <a href="#animateAlong"><code>animateAlong</code></a>
1033                             </li>
1034                             <li>
1035                                 <a href="#animateAlongBack"><code>animateAlongBack</code></a>
1036                             </li>
1037                             <li>
1038                                 <a href="#getBBox"><code>getBBox</code></a>
1039                             </li>
1040                             <li>
1041                                 <a href="#toFront"><code>toFront</code></a>
1042                             </li>
1043                             <li>
1044                                 <a href="#toBack"><code>toBack</code></a>
1045                             </li>
1046                             <li>
1047                                 <a href="#insertBefore"><code>insertBefore</code></a>
1048                             </li>
1049                             <li>
1050                                 <a href="#insertAfter"><code>insertAfter</code></a>
1051                             </li>
1052                             <li>
1053                                 <a href="#clone"><code>clone</code></a>
1054                             </li>
1055                             <li>
1056                                 <a href="#raphael"><code>raphael</code></a>
1057                             </li>
1058                             <li>
1059                                 <a href="#getTotalLength"><code>getTotalLength</code></a>
1060                             </li>
1061                             <li>
1062                                 <a href="#getPointAtLength"><code>getPointAtLength</code></a>
1063                             </li>
1064                             <li>
1065                                 <a href="#getSubpath"><code>getSubpath</code></a>
1066                             </li>
1067                             <li>
1068                                 <a href="#setSize"><code>setSize</code></a>
1069                             </li>
1070                             <li>
1071                                 <a href="#setWindow"><code>setWindow</code></a>
1072                             </li>
1073                             <li>
1074                                 <a href="#getRGB"><code>getRGB</code></a>
1075                             </li>
1076                             <li>
1077                                 <a href="#angle"><code>angle</code></a>
1078                             </li>
1079                             <li>
1080                                 <a href="#rad"><code>rad</code></a>
1081                             </li>
1082                             <li>
1083                                 <a href="#deg"><code>deg</code></a>
1084                             </li>
1085                             <li>
1086                                 <a href="#snapTo"><code>snapTo</code></a>
1087                             </li>
1088                             <li>
1089                                 <a href="#getColor"><code>getColor</code></a>
1090                             </li>
1091                             <li>
1092                                 <a href="#getColor-reset"><code>getColor.reset</code></a>
1093                             </li>
1094                             <li>
1095                                 <a href="#registerFont"><code>registerFont</code></a>
1096                             </li>
1097                             <li>
1098                                 <a href="#getFont"><code>getFont</code></a>
1099                             </li>
1100                             <li>
1101                                 <a href="#print"><code>print</code></a>
1102                             </li>
1103                             <li>
1104                                 <a href="#plugins-canvas">Adding your own methods to canvas</a>
1105                             </li>
1106                             <li>
1107                                 <a href="#plugins-elements">Adding your own methods to elements</a>
1108                             </li>
1109                             <li>
1110                                 <a href="#custom-attributes">Custom Attributes</a>
1111                             </li>
1112                             <li>
1113                                 <a href="#colour">Supported colour formats</a>
1114                             </li>
1115                             <li>
1116                                 <a href="#safari">safari</a>
1117                             </li>
1118                             <li>
1119                                 <a href="#ninja-mode">“Ninja Mode”</a>
1120                             </li>
1121                             <li>
1122                                 <a href="#events">Events</a>
1123                             </li>
1124                         </ul>
1125                     </div>
1126                     <div  id="footer">
1127                         <h3 id="copyright">
1128                             <a href="http://www.opensource.org/licenses/mit-license.php" title="MIT License" rel="license">Some Rights Reserved</a> by <a href="http://dmitry.baranovskiy.com/">Dmitry Baranovskiy</a>
1129                         </h3>
1130                         <h3 id="font">
1131                             Logo by <a href="http://wasabicube.com/">Wasabicube</a>
1132                         </h3>
1133                     </div>
1134         </div>
1135         <script src="raphael.js" type="text/javascript" charset="utf-8"></script>
1136         <script src="syntax.js" type="text/javascript" charset="utf-8"></script>
1137         <script src="museo.js" type="text/javascript" charset="utf-8"></script>
1138         <script src="site.js" type="text/javascript" charset="utf-8"></script>
1139         <script type="text/javascript">
1140         var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
1141         document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
1142         </script>
1143         <script type="text/javascript">
1144         var pageTracker = _gat._getTracker("UA-616618-3");
1145         pageTracker._trackPageview();
1146         </script>
1147     </body>
1148 </html>