Read datasets and load them into DanfoJS
The browser version of DanfoJS is loaded by default.
// Get Url
const r = await fetch('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
const content = await r.text();
// Write ti file
_fs.writeFileSync(__dirname+'/finance-charts-apple.csv', content);
print("Done!")
The browser version only support http:// urls. To read local file, use Node FS API like below:
const data = _fs.readFileSync(__dirname+'/finance-charts-apple.csv', 'utf8');
//print(data)
const blob = new Blob([data], {
type: "application/text",
});
const df = await dfd.readCSV(blob);
print(df);