echo ‘var firstnames = new Array(“‘, join($firstnames,'”,”‘),'”);’;
That’s it! Then, because Processing.js can use global JS variables, I can easily populate the various variables within my Legislator class with their corresponding data arrays.
I have a very simple demo up at http://lcc.gatech.edu/~tgibes3/ccp_test/ccp_sqltest.php. All it does is display the name of the moused-over legislator, but it demonstrates that my front-end and back-end setup will work. Whew!
With this out of the way, I can spend next week working on more layout ideas, with the added piece-of-mind that whatever data I use can easily be placed into my design.
A note on the back-end: It was fairly simple to setup the database – just uploaded a CSV! I’ll be able to add/remove fields as needed, with almost no limitations to the amount of data I use.