| 765 | return this.each(d3_selection_property(name, value)); |
| 766 | }; |
| 767 | function d3_selection_property(name, value) { |
| 768 | function propertyNull() { |
| 769 | delete this[name]; |
| 770 | } |
| 771 | function propertyConstant() { |
| 772 | this[name] = value; |
| 773 | } |
| 774 | function propertyFunction() { |
| 775 | var x = value.apply(this, arguments); |
| 776 | if (x == null) delete this[name]; else this[name] = x; |
| 777 | } |
| 778 | return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; |
| 779 | } |
| 780 | d3_selectionPrototype.text = function(value) { |
| 781 | return arguments.length ? this.each(typeof value === "function" ? function() { |
| 782 | var v = value.apply(this, arguments); |