http://groups.google.com/group/d3-js/browse_thread/thread/9e0734603d6ba703
Interestingly, you can use the new selector functions in v2 to create
and append elements dynamically as part of the select operator. But
I'm not sure I'd recommend it, as you probably want to assign
different attributes or styles to different types, as well. But, if
you really want to create types dynamically, it would look something
like this:
selection.select(function(d) {
return this.appendChild(document.createElementNS(d3.ns.prefix.svg, d.type));
});
Mike