Skip to content

Instantly share code, notes, and snippets.

@nowherenearithaca
Created June 1, 2012 14:08
Show Gist options
  • Save nowherenearithaca/2852410 to your computer and use it in GitHub Desktop.
Save nowherenearithaca/2852410 to your computer and use it in GitHub Desktop.
d3.ns.qualify
qualify: function(name) {
var i = name.indexOf(":"),
prefix = name;
if (i >= 0) {
prefix = name.substring(0, i);
name = name.substring(i + 1);
}
return d3_nsPrefix.hasOwnProperty(prefix)
? {space: d3_nsPrefix[prefix], local: name}
: name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment