How to use Google Spreadsheet as data source

11th April, 2018 - 1 min. read - in Tutorials - Go to Index

Do you know you can publish any Google Spreadsheet in a CSV format for convenient usage in other environments, let’s say, in a D3.js script?

I know, it’s not the revelation of the year. Blame to me since I’ve discovered it only recently.

Google Spreadsheet can be an effective and accessible tool for initial data cleaning, exploration and visualization. Indeed, it can be used also for powerful data wrangling thanks to its set of formulas and computation ability.

It can be used as a single source of truth (because the export gets updated automatically if you modify something in the sheet) for an interactive visualization making it an interesting option for every DataViz practitioners.

The following is a very basic Proof-Of-Concept of what I said. The spreadsheet can be published as a whole as well as a partial set of sheets. You can grab the URL according to the format you need, for instance, here the HTML format for easy embedding:

And here the live sketch with a little barchart using the spreadsheet as data source:

See the Pen TestLoadGSPXwithD3 by Fabio Franchino (@abusedmedia) on CodePen.

I’ll post more use-case with this combination.

Want to ask something? Drop me a line!

Not ready to talk? Follow me on Twitter.


Spotted a typo or (likely) a grammar error? Send a pull request.