Open gka opened 8 years ago
See mbostock/d3#1923 for earlier discussion.
One problem is that Image does not support the same API as XMLHttpRequest (for example, setting custom headers on the request, or aborting the request). There’s a way to do with the blob responseType and URL.createObjectURL.
Alternatively, d3.image could be an unrelated, though similar API to d3-request. Maybe it would only support the simple case you mention. That might be a little confusing, but, maybe it’s still useful?
If you want to pre-load images for use in canvas, you have to do this
d3-request could abstract this, so I can load images in a queue etc