I am facing an issue with loading and visualizing CSV files in my web application. I have 5 CSV files named 1.csv, 2.csv, up to 5.csv. The files contain data that changes regularly. However, when I select a file from the dropdown list for visualization, it seems like the data gets cached. Even if I delete the file or make changes to it, the visualization continues showing the initial data loaded. I have tried refreshing the page but the problem persists.
selector.on("change", function(d){
var selectedKey = keys[this.selectedIndex];
d3.csv(selectedKey +".csv", function(data){
console.log(selectedKey +".txt");
//var format = d3.time.format("%m/%d/%Y %H:%M:%S");
var format = d3.time.format("%Y/%m/%d %H:%M:%S");
data.forEach(function (e){
e.dist = +e.dist;
e.speed = +e.speed;
e.lat=+e.lat;
e.lon=+e.lon;
e.dd=format.parse(e.time);
//console.log(e.dd);
});
dataset=data;
var ndx = crossfilter(data);
dimx = ndx.dimension(function(d) {return d.bearing});
g = dimx.group(function(v){return v;});
var output = g.top(Infinity);
}
});
I need help identifying the root cause of this issue. Even after selecting a different file, such as 2.csv, the chart initially displays correctly. However, any subsequent changes made to 2.csv do not reflect in the visualization. Deleting 2.csv from the directory also does not update the visualization. This behavior persists even after refreshing the page and reselecting the file.