Skip to content

Instantly share code, notes, and snippets.

@veltman
Last active August 28, 2017 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veltman/c722d09dddbf86327abd17e52b7fce42 to your computer and use it in GitHub Desktop.
Save veltman/c722d09dddbf86327abd17e52b7fce42 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.11.3/xlsx.full.min.js"></script>
<script>
d3.request("turtles.xlsx")
.responseType("arraybuffer")
.get(function(err, response){
var binary = String.fromCharCode.apply(null, new Uint8Array(response.response)),
workbook = XLSX.read(binary, { type: "binary" }),
data = XLSX.utils.sheet_to_json(d3.values(workbook.Sheets)[0]);
d3.select("body").append("pre")
.append("code")
.text(JSON.stringify(data, null, " "));
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment