replace img with d3 graph