--- /dev/null
+/*!
+ * Raphael Blur Plugin 0.1
+ *
+ * Copyright (c) 2009 Dmitry Baranovskiy (http://raphaeljs.com)
+ * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
+ */
+
+(function () {
+ if (Raphael.vml) {
+ var reg = / progid:\S+Blur\([^\)]+\)/g;
+ Raphael.el.blur = function (size) {
+ var s = this.node.style,
+ f = s.filter;
+ f = f.replace(reg, "");
+ if (size != "none") {
+ s.filter = f + " progid:DXImageTransform.Microsoft.Blur(pixelradius=" + (+size || 1.5) + ")";
+ s.margin = Raphael.format("-{0}px 0 0 -{0}px", Math.round(+size || 1.5));
+ } else {
+ s.filter = f;
+ s.margin = 0;
+ }
+ };
+ } else {
+ var $ = function (el, attr) {
+ if (attr) {
+ for (var key in attr) if (attr.hasOwnProperty(key)) {
+ el.setAttribute(key, attr[key]);
+ }
+ } else {
+ return doc.createElementNS("http://www.w3.org/2000/svg", el);
+ }
+ };
+ Raphael.el.blur = function (size) {
+ // Experimental. No WebKit support.
+ if (size != "none") {
+ var fltr = $("filter"),
+ blur = $("feGaussianBlur");
+ fltr.id = "r" + (Raphael.idGenerator++).toString(36);
+ $(blur, {stdDeviation: +size || 1.5});
+ fltr.appendChild(blur);
+ this.paper.defs.appendChild(fltr);
+ this._blur = fltr;
+ $(this.node, {filter: "url(#" + fltr.id + ")"});
+ } else {
+ if (this._blur) {
+ this._blur.parentNode.removeChild(this._blur);
+ delete this._blur;
+ }
+ this.node.removeAttribute("filter");
+ }
+ };
+ }
+})();
\ No newline at end of file
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
-Raphael.fn.g.star = function (cx, cy, r, r2, rays) {
+Raphael.fn.star = function (cx, cy, r, r2, rays) {
r2 = r2 || r * .382;
rays = rays || 5;
var points = ["M", cx, cy + r2, "L"],
points.push("z");
return this.path(points);
};
+Raphael.fn.polyline = function () {
+ var points = "M".concat(arguments[0] || 0, ",", arguments[1] || 0, "L");
+ for (var i = 2, ii = arguments.length - 1; i < ii; i++) {
+ points += arguments[i] + "," + arguments[++i];
+ }
+ arguments[ii].toLowerCase() == "z" && (points += "z");
+ return this.path(points);
+};
Raphael.fn.polygon = function (cx, cy, r, n) {
n = +n < 3 || !n ? 5 : n;
var points = ["M", cx, cy - r, "L"],
r = r / 2;
return this.path("M".concat(cx - r / 2, ",", cy - r / 2, "l", [0, -r, r, 0, 0, r, r, 0, 0, r, -r, 0, 0, r, -r, 0, 0, -r, -r, 0, 0, -r, "z"]));
};
-Raphael.fn.g.arrow = function (cx, cy, r) {
+Raphael.fn.arrow = function (cx, cy, r) {
return this.path("M".concat(cx - r * .7, ",", cy - r * .4, "l", [r * .6, 0, 0, -r * .4, r, r * .8, -r, r * .8, 0, -r * .4, -r * .6, 0], "z"));
};