Reputation: 603
I am creating a visualization using d3 and my data consists of more than 80 CSV files within the same folder. So I would like to know whether there is an easy way to load all of them. I was thinking maybe checking how many files are there in the folder, and then just load them recursively. But seems it is not possible in D3? Any suggestions would be appreciated. Thanks!
Upvotes: 3
Views: 2146
Reputation: 109242
When you want to load a lot of files, you can use queue.js to do this more conveniently than repeated d3.csv
calls. However, checking how many files there are on the server isn't possible as such. The only way to do this is to have the server tell you, e.g. you load a file with a known name that gives you the names of the other files to load.
In your case, I would recommend merging the files you have into fewer though to simplify things. You may be able to merge the CSV files with common headers, or convert everything into JSON.
Upvotes: 4