Fork me on GitHub

Tabletop.js - gives your spreadsheets legs!

Grab the Data from Google Docs Spreadsheet using Tabletop.js

comment count

Test Case:

This is actually working

Press [Command] + [Option] + [' i ']

If you're on a mac, to open the console and see the console.log()

You should be able to see one large object of ~67 objects coming from the google spreadsheet, and two arrays being displayed with two different versions of the column headers

Code:

<h1>This is actually working</h1>
<h2>Press [Command] + [Option] + [' i ']</h2>
<p>If you're on a mac, to open the console and see the console.log()</p>
<p>You should be able to see one large object of ~67 objects coming from the google spreadsheet, and two arrays being displayed with two different versions of the column headers</p>
<script src="/choropleth/js/tabletop.js"></script>
<script src="/choropleth/js/miso.ds.deps.ie.min.0.4.0.js"></script>
<script type="text/javascript">
  window.onload = function() { init() };

  var mapKey = "0Arx6eO5Sf52fdDd5dFJjd3d4UEkxOHNuQnN6UnlEZkE";

  var ds = new Miso.Dataset({
    importer : Miso.Dataset.Importers.GoogleSpreadsheet,
    parser : Miso.Dataset.Parsers.GoogleSpreadsheet,
    key : mapKey,
    worksheet : "1"
  });

  function init() {
    Tabletop.init( { key: mapKey,
                     callback: showInfo,
                     simpleSheet: true } );
  }

  function showInfo(data, tabletop) {
    console.log(data);
    console.log(tabletop.sheets('Sheet1').column_names);
    ds.fetch({ 
      success : function() {
        console.log(ds.columnNames());
      },
      error : function() {
        console.log("Are you sure you are connected to the internet?");
      }
    });
  }
</script>