Skip to content

Instantly share code, notes, and snippets.

@GerardoFurtado
Last active April 3, 2018 23:38
Show Gist options
  • Save GerardoFurtado/9f8757091061f983bad478ec68f54279 to your computer and use it in GitHub Desktop.
Save GerardoFurtado/9f8757091061f983bad478ec68f54279 to your computer and use it in GitHub Desktop.
fresh block
license: mit
foo bar baz
12 23 43
21 43 52
foo bar baz
92 76 48
87 17 17
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@7/dist/polyfill.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.4/fetch.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<h1>Please check the console</h1>
<script>
var csv1 = d3.csv("file1.csv");
var csv2 = d3.csv("file2.csv");
Promise.all([csv1, csv2]).then(function(data){
console.log("Files loaded!")
console.log("File 1: " + JSON.stringify(data[0]))
console.log("File 2: " + JSON.stringify(data[1]))
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment