Sparklines in D3

A couple weeks ago, Protovis, a visualization library I’d been using was deprecated in favor of D3 and I thought I’d share some of the work I’d done porting visualizations from the old to the new.

One example that Protovis has for which there is no corresponding tutorial is sparklines. This sparkline shows the San Diego Padres’ first 100 games of the 2011 season. Up ticks are wins and down ticks are losses. Red ticks show shutouts. This is similar to the visualization in Tufte’s “Beautiful Evidence” p. 54.

I created another simple visualization for the National League West. This shows all five teams of the NL West on a single graphic. It is pretty easy to adapt this code to a single sparkline. So far I have been fairly pleased with D3’s performance and the ease of use.

Django logging and sentry

Django-sentry has been a fairly useful tool for me. The docs are good but they only talk about integrating with logging the old way.

Here’s how to use Sentry with logging dictionary config:

RPC4Django 0.1.9 is now available

Go get it!

Here are the changes:

  • Added a CookieTransport class with a lot of help from Douglas Peter Sculley.
  • RPC4Django’s logging now goes to the rpc4django logger.
  • Catches an ExpatError in xmlrpclib that was previously uncaught under certain conditions
  • Fixed error with scanning of INSTALLED_APPS for @rpcmethods. This was causing an issue when South was installed. (#807628)
  • Fixed bug #807653 related to scanning ServerProxy objects