由于谷歌应用程序脚本是在JavaScript中,我想知道如果我可以以某种方式导入它并使用它,而不是图表库。在Google Apps脚本中使用d3.js绘图?
2
A
回答
1
是的,原则上你可以包含你喜欢的任何Javascript库。但是,它必须符合Google的Caja消毒 - see the "JavaScript Libraries" subheading here。您需要使用Html Service而不是Ui Service来构建您的应用。
[更新时间:2015年02月09日] HtmlService自从最初编写以来已有所改进。 This page on restrictions详细介绍了3种不同的沙箱模式。 IFRAME模式不使用Caja消毒。
1
0
是的,你可以导入D3和谷歌Apps脚本使用它。要做到这一点,你需要如下描述把它列入你的脚本:https://github.com/d3/d3
这里是一个Hello World GAS script在吉斯特
相关问题
- 1. 使用Google Apps脚本在Google Apps帐户中迁移邮件
- 2. 在Google Apps脚本中使用Mandrill API
- 3. 在Apps脚本中使用Google API?
- 4. 在Google Apps脚本中使用范围
- 5. 在Google Apps脚本中使用Javascript
- 6. 在Google Apps脚本中使用jsPDF
- 7. 使用Google Apps脚本
- 8. 在Google Apps脚本中使用Crypto-JS - 什么是C.lib?
- 9. Google Apps脚本:如何在HtmlService中使用js库
- 10. Google Apps脚本使HTTP POST
- 11. Google Apps引擎,Google Apps脚本和Javascript
- 12. Google Apps脚本CoffeeScript
- 13. Google Apps脚本DockPanel
- 14. Google Apps脚本[createServerClickHandler]
- 15. 从Google Apps脚本
- 16. Google Site Apps脚本
- 17. Google Apps脚本ToggleButton用法
- 18. Google Apps脚本中的Highcharts
- 19. 在Google Apps脚本中使用Google字体
- 20. 使用C#执行Google Apps脚本
- 21. 离线使用Google Apps脚本
- 22. 使用Google Apps脚本连接Twilio
- 23. 使用Google Apps脚本的电报API
- 24. 如何使用此Google Apps脚本?
- 25. Google Apps脚本MailApp使用htmlBody文档
- 26. 使用CURL访问Google Apps脚本
- 27. 使用Google Apps脚本清除文档
- 28. 使用Google Apps脚本的QuickBooks API POST
- 29. Google Apps脚本:何时使用getActiveSpreadsheet()
- 30. 使用Google Apps脚本获取图表中的所有系列
好的,谢谢。那么,我应该将代码复制到一个新文件d3.gs中,并在出现错误时修复它们?我希望这可以在电子表格中运行并发送HTML电子邮件。 –
我只是试图用''包含它,但失败了(有一些有用的错误),所以你建议的方法听起来像一个很好的开始的地方。 – Daniel
这个[Google博客文章](http://googleappsdeveloper.blogspot.co.uk/2012/11/using-open-source-libraries-in-apps.html)可能会对你有所帮助,因为那位开发者经历了类似的过程为[underscore.js](http://underscorejs.org/)库。 – Daniel