# How to use the raphael.el function in raphael

## To help you get started, we’ve selected a few raphael examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

harvard-lil / perma / perma_web / static / js / helpers / mapping / usmap.js View on Github
``````tmp1 = Math.sqrt(Math.cos(phi1 / 180 * pi)) + 2 * n * Math.sin(phi1 / 180 * pi);
tmp2 = scale * Math.pow(tmp1 - 2 * n * Math.sin(midLat / 180 * pi),0.5) / n;
tmp3 = n * (lng - midLng);
p     = scale * Math.pow(tmp1 - 2 * n * Math.sin(lat / 180 * pi),0.5) / n;
x     = p * Math.sin(tmp3 / 180 * pi);
y     = tmp2 - p * Math.cos(tmp3 / 180 * pi);
return([x,y])
}
}

map.draw();
return map;
};

Raphael.el.darken = function(increment) {
hsl = Raphael.rgb2hsl(this.attr('fill'));
var newLightness = (hsl.l - increment &lt;= 0) ? 0 : (hsl.l - increment);
this.attr({fill: "hsl("+ hsl.h +","+hsl.s+","+newLightness+")"});
}

Raphael.el.lighten = function(increment) {
hsl = Raphael.rgb2hsl(this.attr('fill'));
var newLightness = (hsl.l + increment &gt;= 1) ? 1 : (hsl.l + increment);
this.attr({fill: "hsl("+ hsl.h +","+hsl.s+","+newLightness+")"});
}``````
thingsboard / thingsboard / ui / src / app / widget / lib / digital-gauge.js View on Github
``````this.gauge.level.animate = function(attrs, refreshAnimationTime, refreshAnimationType) {
if (attrs.fill) {
attrs.stroke = attrs.fill;
attrs.fill = 'rgba(0,0,0,0)';
}
return Raphael.el.animate.call(tbGauge.gauge.level, attrs, refreshAnimationTime, refreshAnimationType);
}``````
harvard-lil / perma / perma_web / static / js / helpers / mapping / usmap.js View on Github
``````return([x,y])
}
}

map.draw();
return map;
};

Raphael.el.darken = function(increment) {
hsl = Raphael.rgb2hsl(this.attr('fill'));
var newLightness = (hsl.l - increment &lt;= 0) ? 0 : (hsl.l - increment);
this.attr({fill: "hsl("+ hsl.h +","+hsl.s+","+newLightness+")"});
}

Raphael.el.lighten = function(increment) {
hsl = Raphael.rgb2hsl(this.attr('fill'));
var newLightness = (hsl.l + increment &gt;= 1) ? 1 : (hsl.l + increment);
this.attr({fill: "hsl("+ hsl.h +","+hsl.s+","+newLightness+")"});
}``````

## raphael

JavaScript Vector Library

MIT