Adding Flag Sprites to Force Directed Graph

I’m currently working on the National Contiguity project and I’ve managed to create a graph using plain solid circles as nodes, but I’m having trouble actually implementing the suggested flag sprites in place of these circles.

My current project can be found here

Any ideas?

You actually had the right idea on lines 40 and 41. The problem is that you can’t append an <img> tag inside of an <svg>. The trick here is to realize that you aren’t required to use svg for everything in D3.


Ah, yeah that never occurred to me! Thanks for the tip.