toolkit/javascript/d3/src/core/ns.js
author Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
Tue, 15 Apr 2014 17:46:09 +0200
changeset 48 1b2dffb4ac2b
parent 47 c0b4a8b5a012
permissions -rw-r--r--
add wiki (wikimd) delete publication (bootstrap)

d3.ns = {

  prefix: {
    svg: "http://www.w3.org/2000/svg",
    xhtml: "http://www.w3.org/1999/xhtml",
    xlink: "http://www.w3.org/1999/xlink",
    xml: "http://www.w3.org/XML/1998/namespace",
    xmlns: "http://www.w3.org/2000/xmlns/"
  },

  qualify: function(name) {
    var i = name.indexOf(":");
    return i < 0 ? name : {
      space: d3.ns.prefix[name.substring(0, i)],
      local: name.substring(i + 1)
    };
  }

};