
Imagine a table of data, perhaps car data with columns: ID, Model, Make, Color, Age, etc. How do you process this data so that you can answer some simple questions or visualize it with JavaScript charts? Some questions, like “how many cars are red?” can be processed by looking at a count of rows that meet your criteria (rows where column color is red).
Other questions, like “what is the distribution of colors in your data set?”, requires shifting or pivoting the data, as you want to evaluate a specific column instead of rows. Charting will often need this data pivot and doing it optimally is crucial if you are working with a large amount of data on the client side.
Read more

I have seen a lot of cool D3 maps of US states, counties, and even zipcodes but what about cities or towns? I don’t mean plotting geo coordinates of a particular city but actually drawing the city or town boundary on the map. A population choropleth is a good use case for this but I have only seen one example of Vermont that shows town specific information. The initial problem is where do we even get the specific town boundary geospatial data?
Read more

Here is an update to the 1000 D3 examples compilation and in addition to many more d3 examples, the list is now sorted alphabetically. Most of the D3 examples in this list come from this excel list but I also added some updates and my examples to push the list over 2K. Examples are really helpful when doing any kind of development so I am hoping that this big list of D3 examples will be a valuable resource. Bookmark and share with others. Here is the huge list of D3 demos:
Read more

I have previously shared some frustrations with aggregating a good list of countries and capitals. The problem is that the word country is a bit arbitrary and used to represent everything from sovereign states, various dependencies, special sovereign lands, uninhabited islands, and other entities. Adding to this, we have self-declared sovereign states like Somaliland that are unrecognized by most organizations so it’s hard to tell how you want to define that and which capital city to use. Moreover, there are countries that claim the same capital city (Jerusalem), islands with rotating capitals (Tokelau), and large geographical areas with no capital (Antarctica). So, here is my take on aggregating a complete list of countries and capitals of the world.
Read more

Alexa is often used to identify the most popular websites on the Internet in terms of traffic. However, they don’t provide actual traffic numbers while other websites like QuantCast have these estimates. There are many valid use cases to leverage these rankings but I would guess that beyond the first 10k to 50k results, it gets quite inaccurate. Both services collect this data differently and they both provide a top 1 million list so today I decided to compare these two data sets against each other and figure out their differences in website ranking.
Read more

In my last web performance tools article I have mentioned Ilya Grigorik’s Bigqueries forum where people can share and discuss interesting queries on the HTTParchive. These queries can give us some insight into internet trends and the state of the web. Today, I wanted to share two of my favorite queries from that forum and follow up with some of my own queries to identify some interesting website trends. I have decided to execute my queries in MySQL with the latest imported HTTParchive dump. This is mostly because I am constantly running into limits with using the HTTPArchive database on Google BigQuery.
Read more