0

Is it possible to load the same csv twice with d3?

I have a flask server which updates a csv file every 10 seconds. I would like to reload the graph of the data every 10 seconds.

I used setInterval and inside I reuse

d3.csv("static/data.csv", function(error, data) {...

But when I print the data variable I always get the same graph, as if the csv didn't change.

When I refresh the page it takes the new data and there is no problem.

polka
  • 1,383
  • 2
  • 25
  • 40
Melki
  • 579
  • 2
  • 5
  • 26

1 Answers1

1

This is a result of browser caching. The easiest workaround is appending a random number, or the datetime stamp to the end of the url.

See this answer: Prevent browser caching of jQuery AJAX call result

Community
  • 1
  • 1
Jordan Soltman
  • 3,795
  • 17
  • 31