Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import dataframe-js into Google App Script?

I have used the http link to import the package:

var d3Url = "https://gmousse.github.io/dataframe-js/dist/dataframe.js";
eval(UrlFetchApp.fetch(d3Url).getContentText());

But when I do const df = new DataFrame(company_df[1], company_df[0]), it gives a Reference Error: DataFrame is not defined.

I have also tried to put var DataFrame = dfjs.DataFrame; at the top. But, no luck.

How can I correctly import the package?

like image 497
JOHN Avatar asked Apr 09 '26 08:04

JOHN


1 Answers

Try to put

var Url = "https://gmousse.github.io/dataframe-js/dist/dataframe.min.js";
eval(UrlFetchApp.fetch(Url).getContentText());

in the same file of var DataFrame = dfjs.DataFrame;

It works although I don't know the reasons.

like image 146
JOHN Avatar answered Apr 11 '26 22:04

JOHN