I'm just starting to learn JavaScript and the D3 library. I recently explored the "d3-fetch" module (available at https://github.com/d3/d3-fetch) and the d3.dsv command API (find it here: https://github.com/d3/d3-dsv). However, I am struggling to understand how to use a custom delimiter, like a semicolon, in the dsv parser. Specifically, I need to parse an entire file rather than just a string input.
Below is the code I thought would work, but unfortunately doesn't. I would appreciate any guidance on why this isn't functioning as expected:
<body>
<script type="text/javascript">
var scsv = d3.dsvFormat(";");
d3.text("$lab/raw.csv").then(function(raw) {
scsv.parse(raw).then(function(d) {
console.log(d);
});
});
</script>
</body>