How To Embed Bitmap Into D3js Generated Svg Code?
Given access to suitable topojson and bitmaps, I use the topoJSON file to generate a SVG viz via D3js. Then I append a bitmap to it via : // Append bitmap svg.append('image')
Solution 1:
This example shows how to draw an image to a canvas element and use the .toDataURL
function to get a snapshot of this canvas into a string that you can then use as the xlink:href
attribute:
Post a Comment for "How To Embed Bitmap Into D3js Generated Svg Code?"