mbostock/d3 — pull request #521 by ZeeAgency (2012-02-20 20:45:31+00:00)
Title: Expose d3_selection_enterPrototype for better extensibility

In order to make some d3 plugins I came to extend ```d3_selectionPrototype``` which was fortunately available as ```d3.selection.prototype```.

But, unfortunately, I discovered that ```d3_selection_enterPrototype``` wasn't available as a *public API*, so here I'm just proposing to expose ```d3_selection_enter``` as ```d3.selection.enter``` and to put ```d3_selection_enterPrototype``` as its prototype ```d3.selection.enter.prototype```.

Btw, I think extensibility deserves better doc, will probably do another pull request about it next time.

Also, as I just wanted to make a one-feature pull request I didn't include this but I think it would probably be nice to have some kind of helper like :

d3.selection.extend = function(name, method) {
d3.selection[name] = d3.selection.enter[name] = method;
return d3.selection;
};

What do you think ?