Skip to content

Instantly share code, notes, and snippets.

@nowherenearithaca
Created June 1, 2012 13:49
Show Gist options
  • Save nowherenearithaca/2852297 to your computer and use it in GitHub Desktop.
Save nowherenearithaca/2852297 to your computer and use it in GitHub Desktop.
d3 "append" definition
d3_selectionPrototype.append = function(name) {
name = d3.ns.qualify(name);
function append() {
return this.appendChild(document.createElementNS(this.namespaceURI, name));
}
function appendNS() {
return this.appendChild(document.createElementNS(name.space, name.local));
}
return this.select(name.local ? appendNS : append);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment