- attrNames (array) in this case method returns array of current values for given attribute names
= (object) @Element if attrsName & value or params are passed in.
= (...) value of the attribute if only attrsName is passed in.
= (array) array of values of the attribute if attrsNames is passed in.
= (object) object of attributes if nothing is passed in.
> Possible parameters
# <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>
o arrow-end (string) arrowhead on the end of the path. The format for string is `<type>[-<width>[-<length>]]`. Possible types: `classic`, `block`, `open`, `oval`, `diamond`, `none`, width: `wide`, `narrow`, `midium`, length: `long`, `short`, `midium`.
o clip-rect (string) comma or space separated values: x, y, width and height
o cursor (string) CSS type of the cursor
o cx (number)
o cy (number)
o fill (string) colour, gradient or image
o fill-opacity (number)
o font (string)
o font-family (string)
o font-size (number) font size in pixels
o font-weight (string)
o height (number)
o href (string) URL, if specified element behaves as hyperlink
o opacity (number)
o path (string) SVG path string format
o r (number)
o rx (number)
o ry (number)
o src (string) image URL, only works for @Element.image element
* gradient from white to black or “`r(0.25, 0.75)#fff-#000`” – gradient from white to black with focus point
* at 0.25, 0.75. Focus point coordinates are in 0..1 range. Radial gradients can only be applied to circles and ellipses.
> Path String
# <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>
> Colour Parsing
# <ul>
# <li>Colour name (“<code>red</code>”, “<code>green</code>”, “<code>cornflowerblue</code>”, etc)</li>
# <li>#••• — shortened HTML colour: (“<code>#000</code>”, “<code>#fc0</code>”, etc)</li>
# <li>#•••••• — full length HTML colour: (“<code>#000000</code>”, “<code>#bd2300</code>”)</li>
# <li>rgb(•••, •••, •••) — red, green and blue channels’ values: (“<code>rgb(200, 100, 0)</code>”)</li>
# <li>rgb(•••%, •••%, •••%) — same as above, but in %: (“<code>rgb(100%, 175%, 0%)</code>”)</li>
# <li>rgba(•••, •••, •••, •••) — red, green and blue channels’ values: (“<code>rgba(200, 100, 0, .5)</code>”)</li>
# <li>rgba(•••%, •••%, •••%, •••%) — same as above, but in %: (“<code>rgba(100%, 175%, 0%, 50%)</code>”)</li>
# <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
# <li>hsba(•••, •••, •••, •••) — same as above, but with opacity</li>
# <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>
# <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
# <li>hsla(•••, •••, •••) — same as above, but with opacity</li>
# <li>Optionally for hsb and hsl you could specify hue as a degree: “<code>hsl(240deg, 1, .5)</code>” or, if you want to go fancy, “<code>hsl(240°, 1, .5)</code>”</li>
# </ul>
\*/
elproto.attr=function(name,value){
elproto.attr=function(name,value){
if(this.removed){
if(this.removed){
returnthis;
returnthis;
...
@@ -2571,6 +2761,13 @@
...
@@ -2571,6 +2761,13 @@
setFillAndStroke(this,params);
setFillAndStroke(this,params);
returnthis;
returnthis;
};
};
/*\
* Element.toFront
[ method ]
**
* Moves the element so it is the closest to the viewer’s eyes, on top of other elements.
= (object) @Element
\*/
elproto.toFront=function(){
elproto.toFront=function(){
if(this.removed){
if(this.removed){
returnthis;
returnthis;
...
@@ -2580,6 +2777,13 @@
...
@@ -2580,6 +2777,13 @@
svg.top!=this&&tofront(this,svg);
svg.top!=this&&tofront(this,svg);
returnthis;
returnthis;
};
};
/*\
* Element.toBack
[ method ]
**
* Moves the element so it is the furthest from the viewer’s eyes, behind other elements.
= (object) @Element
\*/
elproto.toBack=function(){
elproto.toBack=function(){
if(this.removed){
if(this.removed){
returnthis;
returnthis;
...
@@ -2591,6 +2795,13 @@
...
@@ -2591,6 +2795,13 @@
}
}
returnthis;
returnthis;
};
};
/*\
* Element.insertAfter
[ method ]
**
* Inserts current object after the given one.
= (object) @Element
\*/
elproto.insertAfter=function(element){
elproto.insertAfter=function(element){
if(this.removed){
if(this.removed){
returnthis;
returnthis;
...
@@ -2604,6 +2815,13 @@
...
@@ -2604,6 +2815,13 @@
insertafter(this,element,this.paper);
insertafter(this,element,this.paper);
returnthis;
returnthis;
};
};
/*\
* Element.insertBefore
[ method ]
**
* Inserts current object before the given one.
= (object) @Element
\*/
elproto.insertBefore=function(element){
elproto.insertBefore=function(element){
if(this.removed){
if(this.removed){
returnthis;
returnthis;
...
@@ -2764,6 +2982,12 @@
...
@@ -2764,6 +2982,12 @@
this._viewBox=[x,y,w,h,!!fit];
this._viewBox=[x,y,w,h,!!fit];
returnthis;
returnthis;
};
};
/*\
* Paper.clear
[ method ]
**
* Clears the paper, i.e. removes all the elements.