score:0

You can use d3.queue to load the files at the same time. The function in .awaitAll() is only evaluated after both CSV files have been loaded, and the function .await() only waits for one of the CSV files to complete loading.

function delayedHello(callback) {
  setTimeout(function() {
    console.log("Hello!");
    callback(null);
  }, 250);
}

d3.queue()
  .defer(delayedHello)
  .defer(delayedHello)
  .awaitAll(function(error, data) {
    console.log(error ,data);
  });

d3.queue()
  .defer(delayedHello)
  .defer(delayedHello)
  .await(function(error, data) {
    console.log(error ,data);
  });
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.13.0/d3.min.js"></script>


Related Query