d3 / d3

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

Home Page:https://d3js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught (in promise) ReferenceError: FileAttachment is not defined.

Adi-11 opened this issue · comments

(async () => {
  const file = d3.csvParse(
    await FileAttachment("category-brands.csv").text(),
    d3.autoType
  );
  data = file;
  console.log(data);
})();

Giving Error: Uncaught (in promise) ReferenceError: FileAttachment is not defined.
Even after looking for all the resources, no solution was found!!

FileAttachment is defined in https://github.com/observablehq/stdlib and mostly for use on https://observablehq.com ; to load files you can alternatively use fetch, or in the case of a CSV file, d3.csv.