Data, Maps, Usability, and Performance

API canvas d3 data geo GeoJSON html5 image JavaScript json maps mysql PHP WordPress

Zoom into US Zip Codes in Leaflet Map

zipdecode on leaflet

It has been a while since I touched Leaflet and today I want to play around with mapping zip codes. I really liked Ben Fry’s zipdecode project and have seen other interesting implementations. But, I want to go beyond highlighting and actually zoom into the appropriate areas based on each number of the zip code. I think this would be an interesting take on zip decoding and I am going to implement it on a Leaflet map.
Read more

Convert CSV to JSON in JavaScript

CSV to JSON convert

I have been dealing with a lot of CSV and TSV files lately and I am a bit surprised at the lack of support for these formats in jQuery. D3.js supports it out of the box which is awesome but often times I need to convert CSV to JSON without loading D3. You could argue that I should just convert the data into JSON before loading it onto the page, especially since at the end of the day I will need to convert it into a JavaScript object. That is an option, and there are many converters out there, but what about transferring more data over the network? CSV and TSV are always going to be smaller than JSON and I like that, so often times, I actually prefer to load a CSV file into the page and convert it into JSON with JavaScript. Also, a TSV or CSV to JSON conversion function in JavaScript is pretty simple.
Read more