(input, init)
| 8368 | var tsv = dsvParse(tsvParse); |
| 8369 | |
| 8370 | function image(input, init) { |
| 8371 | return new Promise(function(resolve, reject) { |
| 8372 | var image = new Image; |
| 8373 | for (var key in init) image[key] = init[key]; |
| 8374 | image.onerror = reject; |
| 8375 | image.onload = function() { resolve(image); }; |
| 8376 | image.src = input; |
| 8377 | }); |
| 8378 | } |
| 8379 | |
| 8380 | function responseJson(response) { |
| 8381 | if (!response.ok) throw new Error(response.status + " " + response.statusText); |