<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, <attributes>})</li>
</ol>
<h4>Usage</h4>
<preclass="javascript code"><code>// Each of the following examples create a canvas that is 320px wide by 200px high
// Canvas is created at the viewport's 10,50 coordinate
...
...
@@ -59,7 +63,9 @@ var paper = Raphael(10, 50, 320, 200);
// Canvas is created at the top left corner of the #notepad element (or its top right corner in dir="rtl" elements)
var paper = Raphael(document.getElementById("notepad"), 320, 200);
// Same as above
var paper = Raphael("notepad", 320, 200);</code></pre>
@@ -188,45 +194,54 @@ c.scale(.5, .75); // makes the circle half as wide, and 75% as high</code></pre
<ol>
<li>attributeNames <em>array</em> in this case method returns array of current values for given attribute names</li>
</ol>
<p>or</p>
<p>no parameters, in this case object containing all attributes will be returned</p>
<h4>Possible parameters</h4>
<p>Please refer to the <ahref="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>
<ul>
<li>clip-rect <em>string</em> comma or space separated values: x, y, width and height</li>
<li>cx <em>number</em></li>
<li>cy <em>number</em></li>
<li>fill <em>colour</em></li>
<li>fill-opacity <em>number</em></li>
<li>font <em>string</em></li>
<li>font-family <em>string</em></li>
<li>font-size <em>number</em></li>
<li>font-weight <em>string</em></li>
<li>gradient <em>string</em> “‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›”, example: <samp>"90-#fff-#000"</samp> or <samp>"0-#fff-#f00:20-#000"</samp></li>
<li>height <em>number</em></li>
<li>opacity <em>number</em></li>
<li>path <em>pathString</em><ahref="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>
<li>r <em>number</em></li>
<li>rotation <em>number</em></li>
<li>rx <em>number</em></li>
<li>ry <em>number</em></li>
<li>scale <em>string</em> comma or space separated values: xtimes, ytimes, cx, cy. See: <ahref="#scale">scale</a></li>
<li>translation <em>string</em> comma or space separated values: x and y</li>
<li>width <em>number</em></li>
<li>x <em>number</em></li>
<li>y <em>number</em></li>
<liid="attr-clip-rect">clip-rect <em>string</em> comma or space separated values: x, y, width and height</li>
<liid="attr-cx">cx <em>number</em></li>
<liid="attr-cy">cy <em>number</em></li>
<liid="attr-fill">
fill <em>colour</em> or <em>gradient</em>
<ul>
<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>
<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>
<li>Focus point coordinates are in 0..1 range</li>
<li>Radial gradients can only be applied to circles and ellipses</li>
<liid="attr-path">path <em>pathString</em><ahref="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>
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.
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.
<ahref="http://www.opensource.org/licenses/mit-license.php"title="MIT License"rel="license">Some Rights Reserved</a> by <ahref="http://dmitry.baranovskiy.com/">Dmitry Baranovskiy</a>
</h3>
<h3id="font">
Font by <ahref="http://www.exljbris.nl">Jos Buivenga</a> · Logo by <ahref="http://wasabicube.com/">Wasabicube</a> ·
Logo by <ahref="http://wasabicube.com/">Wasabicube</a> ·
Work at this project started as 20% time at <ahref="http://www.atlassian.com/"title="Atlassian — Software to Track, Test & Collaborate, from Enterprises to Open Source Projects.">Atlassian</a>