I am using D3 with a json dataset to render a force directed diagram. The images on the diagram do not save when I save the SVG as a PNG. the images are rendered using a URL passed in the json data. I believe I saw the graphics will not be saved unless they are local. I need to save the graphic files to local storage and then modify my json to point to the correct local url.
I would like to accomplish with jquery and make it part of a function I have in place to strip the time stamp out of the json data. I have tried saving the graphics locally but they are still using the URL from a separate server.
my code so far is below.
//loop thru the json data and remove the time stamp from the DOB
$.each(json.nodes, function (i, item) {
var myNewDate = new Date(item.DOB);
item.DOB = (myNewDate.getMonth() + 1) + "/" + (myNewDate.getDate() + 1) + "/" + myNewDate.getFullYear();
//alert(item.ImageURL); next lines place the images in a div
img.src = item.ImageURL;
img.setAttribute("name", item.SubjectId)
img.setAttribute("alt", item.SubjectId);
document.getElementById("img-container").appendChild(img);
});
new to the jquery language so any help would be great
Pery