Accessing CSV file with D3 inside meteor

I have successfully fetched an HTML table displaying data from a csv file using D3, but when I moved the same code into the meteor project, I got problems. The data object passed to the callback for d3.csv () fetches the HTML file line 1 at a time, not the csv data. This only happens when you try to launch it into a meteor.

My code is set up like this:

if (Meteor.isClient) {
  d3.csv("data/dataset.csv", function(data) {
    console.dir(data);

    // do stuff
  });
}

if (Meteor.isServer) {
  // do other stuff
}

      

Any ideas on why this might be happening?

+3


source to share


1 answer


(Simple copying of Ashkat's comment as requested by @booyaa in the comments :)



try putting your csv file in public/data/data.csv

+3


source







All Articles