| 750 | return this.each(d3_selection_property(name, value)); |
| 751 | }; |
| 752 | function d3_selection_property(name, value) { |
| 753 | function propertyNull() { |
| 754 | delete this[name]; |
| 755 | } |
| 756 | function propertyConstant() { |
| 757 | this[name] = value; |
| 758 | } |
| 759 | function propertyFunction() { |
| 760 | var x = value.apply(this, arguments); |
| 761 | if (x == null) delete this[name]; else this[name] = x; |
| 762 | } |
| 763 | return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; |
| 764 | } |
| 765 | d3_selectionPrototype.text = function(value) { |
| 766 | return arguments.length ? this.each(typeof value === "function" ? function() { |
| 767 | var v = value.apply(this, arguments); |