MCPcopy Create free account
hub / github.com/plotly/plotly.js / fetch

Function fetch

src/lib/geo_location_utils.js:341–357  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

339 var promises = [];
340
341 function fetch(url) {
342 return new Promise(function (resolve, reject) {
343 d3.json(url, function (err, d) {
344 if (err) {
345 delete PlotlyGeoAssets[url];
346 var msg =
347 err.status === 404
348 ? 'GeoJSON at URL "' + url + '" does not exist.'
349 : 'Unexpected error while fetching from ' + url;
350 return reject(new Error(msg));
351 }
352
353 PlotlyGeoAssets[url] = d;
354 return resolve(d);
355 });
356 });
357 }
358
359 function wait(url) {
360 return new Promise(function (resolve, reject) {

Callers 3

fetchTraceGeoDataFunction · 0.85
get_geodata.mjsFile · 0.85
handleOnLoadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…