Reputation: 14901
Since Google Apps Script is in javascript, I was wondering if I could somehow import it and use it instead of the charting library.
Upvotes: 2
Views: 3764
Reputation: 560
Yes you can import d3 and use it in Google Apps Script. To do so, you need to include it in your script as described here: https://github.com/d3/d3
Here is a hello world GAS script in Gist
Upvotes: 0
Reputation: 2196
As of 2016, it works perfectly. Here is a simple example.
You can find the code here: github-D3-GAS
Upvotes: 2
Reputation: 1462
Yes, in principle you can include any Javascript library you like. However, it must comply with Google's Caja sanitization - see the "JavaScript Libraries" subheading here. You will need to build your app using the Html Service and not Ui Service.
[Update 02/09/2015] The HtmlService has moved on a little since this was originally written. This page on restrictions details more about the 3 different sandbox modes. The IFRAME mode does not use the Caja sanitization.
Upvotes: 1