MCPcopy
hub / github.com/jipegit/OSXAuditor / d3_selection_attr

Function d3_selection_attr

d3-3.2.8/d3.js:566–589  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

564 return this.each(d3_selection_attr(name, value));
565 };
566 function d3_selection_attr(name, value) {
567 name = d3.ns.qualify(name);
568 function attrNull() {
569 this.removeAttribute(name);
570 }
571 function attrNullNS() {
572 this.removeAttributeNS(name.space, name.local);
573 }
574 function attrConstant() {
575 this.setAttribute(name, value);
576 }
577 function attrConstantNS() {
578 this.setAttributeNS(name.space, name.local, value);
579 }
580 function attrFunction() {
581 var x = value.apply(this, arguments);
582 if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
583 }
584 function attrFunctionNS() {
585 var x = value.apply(this, arguments);
586 if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
587 }
588 return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
589 }
590 function d3_collapse(s) {
591 return s.trim().replace(/\s+/g, " ");
592 }

Callers 1

d3.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected