for France Visual Component # of Elements Shape Complexity Interactive Standard Chosen Choropleth Map Medium/Big: ~40.000. US has only ~3.000. Complex: (Concave, Convex, Connected, Disconnected) Yes ? Thursday, February 28, 13
the Map • Canvas Color Picking for Interaction • CSS Transitions / Transforms for Zooming / Panning Take 2 - 2D Canvas / CSS3 Thursday, February 28, 13
{ 4 var r = i % 256, 5 g = ((i / 256) >>> 0) % 256, 6 b = ((i / (256 * 256)) >>> 0) % 256; 7 8 county.setAttribute('fill', 'rgb(' + r + ',' + g + ',' + b + ')'); 9 }); 1 //decode index from image 2 function getCounty(canvas, counties, x, y) { 3 var imageData = canvas.getImageData(), 4 width = imageData.width, 5 data = imageData.data, 6 index = (x + y * width) * 4, //RGBA components 7 r = data[index], 8 g = data[index + 1], 9 b = data[index + 2], 10 i = r + (g + b * 256) * 256; 11 12 return counties[i]; 13 } Offline: Encode index to county data array in colors Online: Decode RGB color to array index Thursday, February 28, 13
by asking yourself about... # of Elements Shape Complexity Interaction Animation Compatibility Libraries Small, Large Simple, Complex Yes, No Yes, No Desktop, Mobile, Browsers, etc. d3js, three.js, etc. Thursday, February 28, 13