Wednesday 15 January 2014

d3.js symbol instead of circle -


I am using code to create SVG division, and I'm working fine.

  nodeEnter .append ("svg: circle") .attr ("r", 1e-6) .attr ("id", function (d) {return d.name;})   

Now I want to use custom symbols instead of circle. I got these symbols in BMP files.

Please guide me on how to do it.

Thank you Krishna

I think that's what you are looking for :

The interesting code is:

  nodeEnter.append ("image") .attr ("xlink: href", "https://github.com/favicon. Ico ") // should work with bmp .attr (" x ", -8) .attr (" y ", - 8) .attr (" width ", 16) .attr (" height ", 16) ;    

No comments:

Post a Comment