The library is called Gable (G(oogle)+(T)able) and what it does is take semi-structured JavaScript objects and dumps them to a Google Table object literal or to CSV -- kind of like google.visualization.arrayToDataTable() but for objects of all types.
Gable( 'food_data_pie' )
.add( {
value: [
{ 'Food': 'Apple Pie', 'kCal': 405 }
, [ 'Beer, Light', 95 ]
, [ 'Carrots, Raw, Whole', 30 ]
, [ 'Doughnuts, Cake Type, Plain', 210 ]
, [ 'Enchilada', 235 ]
, [ 'Froot Loops Cereal', 110 ]
, [ 'Grape Soda', 180 ]
, [ 'Hamburger, 4oz Patty', 445 ]
], meta: {
title: 'USDA Nutrient Database'
}
} )
.draw( {
target: 'example4'
, type: 'pie'
, meta: {
backgroundColor: '#FDF6E3'
, height: 400
, series: [ { color: '#586E75' }, { color: '#EEE8D5' } ]
, legend: { position: 'bottom', textStyle: { color: 'black', fontSize: 16 } }
}
} );
I've cross-browser tested it and am getting ready to put it into production use where I work. Before that point, I'm planning to release the code under a dual MIT/GPL license so a wider software community can enjoy the work.
Check it out and let me know how it could be improved, or just submit a pull request on Github. I've benefitted greatly from the Visualization API and I'd love to help spur adoption of this wonderful library.