Monday, September 11, 2017

More heatmaps: other types of crime is San Francisco, 2003-2016

This is a follow-up to the earlier post about visualizing SFPD data. Now let's focus on other crime categories: vehicle theft, larceny/theft, burglary, assault.


Animated GIF is not the best way to explore patterns. Check out the original interactive charts for each type of crime below.

SFPD incident database and heatmaps: drug-related incident patterns

San Francisco Police Department provides free access to a great data source:  https://data.sfgov.org/browse?category=Public+Safety. The following couple of charts display drug-related incident distribution by year, weekday, time of day, and district.




Some observations:

  • the notorious "welfare Wednesday" effect is present in early years;
  • incident numbers drop significantly starting 2010, which may be caused by Proposition 215: Wikipedia says "It was not until March 2009 that federal officials announced that they would no longer try to thwart medical marijuana distribution/use in California".
There is a follow-up post focusing on other types of crime in SF using the same data source.

The following are the steps to create the weekday/time heatmap chart using charte.ca editor.

Tuesday, August 15, 2017

World Health Organization (WHO): spotting spending patterns in 2000-2015

It took me a while to find and groom WHO spending numbers. All financial reports I used can be found here. There were a few challenges, here are some worth mentioning.

1. Between 2000 and 2011, the WHO published two-year financial reports, and in 2012, they switched to one-year schedule.

2. The list of expenditure categories was changing from year two year. As a result, I could not break down equipment and supplies category into meaningful groups, so medical supplies and furniture fall into the same category. Same with the "Other" category: it includes grants, research contracts, local subsidies and what not.

3. Since 2008, WHO financial reports stopped providing staff costs breakdown, so "Stuff costs" category includes full-time and part-time employees, consultants and even governing body delegates.


Below is the two-axis chart that shows absolute spending numbers as bars and the share of some spending categories as lines:



Key observations:

  • the WHO is drifting towards outsourcing some of the activities: watch the staff+equipment spending go down while contractual services going up;
  • the share of travel expenses grew three times between 2000 and 2015.


It turned out both observations make sense: just google "world health organization outsourcing" and "world health organization travel expenses".

Tuesday, August 8, 2017

Animated GIF is alive and well

I have just came across a blog featuring high-quality charts visualizing all kinds of data: https://datasoaring.blogspot.com. Charts are made with plot.ly, highcharts, bokeh, charte.ca and other tools. Some charts are published as high-quality animated GIFs. Apparently, the blogger uses this data format as a last resort - not so many tools out there support animation right out of the box. Anyways, good to see charte.ca in a good company.

Log scale for XY charts

From now on, charte.ca supports log scale in all XY charts (bubble, scatter, motion). Consider the following visualization of World Bank and SIPRI Military Expenditure Database data:




Why log scale? There are a few cases when a log scale is appropriate. The most well known is: log scales allow a large range to be displayed without small values being compressed down into bottom of the graph. Consider the same visualization made using linear scale (this is just a screenshot, not an interactive chart, but it gives you a good idea about the problem):

Tuesday, August 1, 2017

More fun with motion charts: European top 20 imports and exports, 1990-2016

World Bank Group provides a lot of data to play with. Let's build a motion chart based on export, import, and GDP data for European top 20 economies, grouped by regions - Northern, Western, Eastern, and Southern.




Watch international trade shrinking between 2008 and 2009!

Monday, July 31, 2017

Motion charts: add categories and animate those bubbles

charte.ca now supports motion charts. Motion charts are basically bubble charts with one more dimension added (usually, it's time). In charte.ca, we use category for this dimension, remember category radio buttons in charte.ca pie charts and bar charts? So, our motion charts are bubble charts with category radio buttons.

Recently, Statistics Canada published a quick overview of interprovincial migration data, using simple line charts. Let's make this data look fancier:



Here are the steps to create this motion chart.