Using D3 in server side Gas

There are plenty of examples on this site of using D3 for its visualization capabilities, whether from Excel, Apps Script or some other platform. I like D3 a lot, and now with the release of d3 v4, which is much more modular, you can use it server side from Apps Script. 

Why would you ? 

Well, D3 had plenty of polyfills for array functions and other goodies before they actually showed up in Apps Script, but in addition to that it also plenty of useful functions for manipulating arrays that are not implemented in Apps Script, but it also has many other functions for data manipulation and math problems.

Set up


You'll need the d3Gas library.

1vZzEtFKAG_PHn44HgEdSBave5NQ-SprisJ0Ngid0ovahwEOMkBO1s6DX

Then you can do this 

var d3 = d3Gas.d3;

Examples

Since there are plenty of uses for this, I'll do a page on each one - links below


and that's all folks..

For more like this, see Google Apps Scripts snippets. Why not join our forumfollow the blog or follow me on twitter to ensure you get updates when they are available. 

You want to learn Google Apps Script?

Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly

If you prefer Video style learning I also have two courses available. also published by O'Reilly.
Google Apps Script for Developers and Google Apps Script for Beginners.