Sha256: 3132ec71a793848f29f3c140bf64edc8b94e0959c07b5499932505993cfdfc09
Contents?: true
Size: 1.17 KB
Versions: 31
Compression:
Stored size: 1.17 KB
Contents
d3_selectionPrototype.attr = function(name, value) { name = d3.ns.qualify(name); // If no value is specified, return the first value. if (arguments.length < 2) { var node = this.node(); return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); } function attrNull() { this.removeAttribute(name); } function attrNullNS() { this.removeAttributeNS(name.space, name.local); } function attrConstant() { this.setAttribute(name, value); } function attrConstantNS() { this.setAttributeNS(name.space, name.local, value); } function attrFunction() { var x = value.apply(this, arguments); if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); } function attrFunctionNS() { var x = value.apply(this, arguments); if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); } return this.each(value == null ? (name.local ? attrNullNS : attrNull) : (typeof value === "function" ? (name.local ? attrFunctionNS : attrFunction) : (name.local ? attrConstantNS : attrConstant))); };
Version data entries
31 entries across 31 versions & 2 rubygems