Motivation:
Learn Processing.JS and create Data Visualizations
Goals:
Work through the examples by writing the less code possible and whenever possible make it the same as the processing examples on the book
References:
John Resig - Processing.JS
F1LT3R Processing.js fork
processing.js googlegroup contributions
Hyper-Metrix
Processing.org
Visualizing Data by Ben Fry
JQuery
Files: ex_pag21.htm
Files: ex_pag22.htm
Files: ex_pag31.htm + map.png
Notes:
img tag must be present on the page as it will be used as a placeholder for the image itself.Files: ex_pag33.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Notes: I had to create a javascript version of the original table.pde file that is referenced in the book. The main differences are:
float getFloat(String rowName, int column) and float getFloat(int rowIndex, int column) were split in two since javascript doesn't support (that i know of) for overloads with the same number of argumentsloadData function that is somewhat used as the original Table(string filename) constructorloadStrings() function in processing.js but used instead a the jquery function: $.ajax({type: "GET", url: fileName, async: false}).responseText;
Files: ex_pag35.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Files: ex_pag37.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Notes:
Files: ex_pag38.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Files: ex_pag40.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Files: ex_pag41.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
Files: ex_pag43.htm + map.png + table_01.js (replaces table.pde) + locations.tsv
I developed another example based on this chapter on plotting data on maps.
First experiment on creating a dynamic heatmap.
Using an svg file that I got from wikipedia I created a map of Portugal divided by its diferent regions. Then, using data from the Portuguese Statistics Institute I set the fill color of each region based on the percentual population variation.
Files: ex_extend1.htm + coordenadas_nuts3.tsv (this file has the diferent vertex for each region)+ populacao_nuts3_2007-1991_variacao.tsv (this file has the different values per region)
Other Files (not need to run the example, only for future reference): ine__1991-2000.xslx, populacao_1991_2007.xslx
Notes:
getColCount() on table.js