Listening to progress events in d3.csv()

Is there a way to listen to progress events in d3.csv() v5? I’d like to do something like this:

but it seems since d3@5 we can’t do this anymore.

Yes, the Fetch API supports streaming:

It’s not a drop-in replacement for progress events, because the Fetch API is quite different from the old XMLHttpRequest. But you could use the technique above to monitor the progress of the download, and then when it’s downloaded entirely, parse the CSV using d3.csvParse.

There must be some streaming CSV parsers around. I implemented one myself at some point, but not in a way that’s compatible with the newer Streams API. It might be nice to revisit that now that browsers support it.