1 if(typeof Raphael !== "undefined") {
  2     // adds a Raphael custom attribute "d" which maps to "path"
  3     // in d3/svg, the definition of a path is specified via attribute "d",
  4     // in raphael, it's specified via attribute "path".
  5     //
  6     // this bridges the two worlds a little
  7     function d3_raphael_addCustomAttributes(paper) {
  8         paper.ca.d = function(path) {
  9             return {path: path};
 10         }
 11     }
 12 
 13     // adds selection.attr("class",...) support
 14     // see raphaelselection.attr
 15 }
 16