How to use the d3-fetch.blob function in d3-fetch

To help you get started, we’ve selected a few d3-fetch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / d3-fetch / d3-fetch-tests.ts View on Github external
import * as d3Fetch from 'd3-fetch';
import { DSVParsedArray, DSVRowString } from 'd3-dsv';

interface MyType {
    foo: string;
}

const url = 'foo.bar';

const init: RequestInit = {};

let p1: Promise = d3Fetch.blob(url);
p1 = d3Fetch.blob(url, init);

let p2: Promise = d3Fetch.buffer(url);
p2 = d3Fetch.buffer(url, init);

let p3: Promise = d3Fetch.image(url);
const imageProperties = {
    width: '300px',
    height: '500px'
};
p3 = d3Fetch.image(url, imageProperties);

let p4: Promise = d3Fetch.json(url);
p4 = d3Fetch.json(url, init);
let p5: Promise = d3Fetch.json(url);
p5 = d3Fetch.json(url, init);
github DefinitelyTyped / DefinitelyTyped / types / d3-fetch / d3-fetch-tests.ts View on Github external
import * as d3Fetch from 'd3-fetch';
import { DSVParsedArray, DSVRowString } from 'd3-dsv';

interface MyType {
    foo: string;
}

const url = 'foo.bar';

const init: RequestInit = {};

let p1: Promise = d3Fetch.blob(url);
p1 = d3Fetch.blob(url, init);

let p2: Promise = d3Fetch.buffer(url);
p2 = d3Fetch.buffer(url, init);

let p3: Promise = d3Fetch.image(url);
const imageProperties = {
    width: '300px',
    height: '500px'
};
p3 = d3Fetch.image(url, imageProperties);

let p4: Promise = d3Fetch.json(url);
p4 = d3Fetch.json(url, init);
let p5: Promise = d3Fetch.json(url);
p5 = d3Fetch.json(url, init);