D3.js has tsv and csv fetches. Let's say if we have data:
x y
1 3
2.2 -1.8
3 4
is it true that the data can actually be separated just by whitespaces? We can write a preprocessor to convert the file by splitting the file by whitespaces, such as
const data = `x y
1 3
2.2 -1.8
3 4`;
console.log(data.split("\n").map(line => line.trim().split(/\s+/).join("\t")).join("\n"));
But is there a way to use D3.js directly and fetch the data by the way like above?