Skip to content

How about adding d3.image for loading images? #11

@gka

Description

@gka

If you want to pre-load images for use in canvas, you have to do this

var imageObj = new Image();
imageObj.onload = function() {
     // do sth, e.g.
     context.drawImage(this, 0, 0);
};
imageObj.src = url;

d3-request could abstract this, so I can load images in a queue etc

d3.image(url, function(err, img) {
    context.drawImage(img, 0,0);
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions