css - How to smoothly load 10 csv files of 500kb each and merge the array with javascript and HTML5? -
given 10 csv files under same directory, same format, different values. each file size 500kb.
mergeddata = [] (f in filelist) { d3.tsv(f, function(error, data)){ //following code cannot work expected mergeddata = mergeddata.concat(data) //then plot d3js using mergeddata ... } } i use these data visualization d3, , aware javascript single threading.
the solution might web workers, can run in backend. based on http://www.w3schools.com/html/html5_webworkers.asp
since web workers in external files, not have access following javascript objects:
the window object document object parent object
there libraries around support asynchronous loading of files. 1 of developed maker of d3.js, mike bostock. take @ queue.js rather slim , lightweight. if not fit needs, there other libraries linked on queue.js page.
Comments
Post a Comment