Skip to content

Instantly share code, notes, and snippets.

View luvaas's full-sized avatar

Darren Luvaas luvaas

View GitHub Profile
@luvaas
luvaas / addClass, removeClass, and hasClass shims
Last active March 15, 2016 05:11
Jquery extensions that add missing addClass, removeClass, and hasClass shims for SVG elements
//addClass shim for SVG
var originalAddClass = $.fn.addClass;
$.fn.addClass = function(value) {
var orig = originalAddClass.apply(this, arguments);
if(!value) return orig;
for (var i=0; i<this.length; i++ ) {
var elem = this[ i ];
@luvaas
luvaas / README.md
Last active August 2, 2016 18:15 — forked from brattonc/README.md
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Converted to D3 v4 8/2/2016

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include: