A New Book Resolution for 2016

As we enter a new year, I find myself eager to create a new book that explores the world of baseball data using a wide array of data visualization approaches. This idea has been in my head for several years at least, and has found partial fulfillment in my previously published pennant races book. However, I wish to tackle something broader that will touch a number of baseball categories as well as multiple data visualization approaches.

The working title for the book is ‘Baseball Grafika’, grafika being the Czech and Polish word for graphics, a word which still conveys the intent of the book regardless of language. If all goes well, the book will be available early in the 2016 baseball season, and will cover the following topics:

  • Franchise player networks
  • Trade pattern networks
  • Hall of Fame connection network
  • Franchise location maps
  • Player birthplace maps
  • Pennant race charts
  • Standings charts
  • Career trajectory graphs
  • Baseball dashboards

Fortunately, much work has been done over the last several years on at least a few of these topics, so we’re not starting from scratch, but this will still be a considerable, yet rewarding, challenge. Updates to come.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Mapping Projected Growth Rates with D3

The mapping bug has bit me recently, as I continue to explore a variety of resources, including CartoDB, Mapbox, Leaflet, and now D3. While D3 is not a dedicated mapping platform like the others, it is perhaps the most flexible of all, due to the wealth of map projections provided by Mike Bostock, Jason Davies, and the rest of the D3 community. In addition, it provides nearly unlimited potential through the use of colors, labels, tooltips, and so on, all customizable using CSS.

My latest effort is a rather simple foray into a time-based map using population projections from the UN, found here. This map owes a debt of gratitude to a similar creation found on github from Rich Donohue. I was able to use his example as a starting point and then simply tweak a handful of settings, provide a different data source, and manipulate color schemes and the map projection. This is a basic choropleth map, where every country has a fill color based on the projected rate of population growth for every five-year period through 2100. I removed the data for the first half of each decade, as it didn’t add to the story. The result is a map that shows 10-year intervals for every country from 2020 through 2100.

Here’s a glimpse of the map, or click here to go to the full version:

This is a relatively simple example that barely scrapes the surface of what D3 can do, but it reinforces my love affair with open source tools and communities. More to come.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

CartoDB MLB Birthplace Map

Finally, thanks to the brilliance of the CartoDB platform and abetted by the beautiful Stamen Design watercolors theme, I have a map that tracks the debut of thousands of major league ballplayers from 1871 to 2013 (2014 data will be added at a future date). This is one I’ve been cooking up for awhile, but couldn’t get to as a top priority, given that it required some late night time fixing geo codes for hundreds of towns in places like the Dominican Republic, Puerto Rico, Japan, and Venezuela. All that was finally completed, giving me a dataset with a high degree of integrity – probably 99% accurate.

Have a look at the finished map – going to full screen mode will let you appreciate it even more:

This is the first in what could become a series, as the same information could be displayed in a variety of other formats such as bubbles, choropleth (filled maps), or clusters.

What to say about CartoDB? It’s absolutely brilliant in both concept and execution, and the founders seem willing to make strategic modifications on the fly. For now, I’m working with the free version (limited data capacity), but in time, may want to step up, given the capabilities of the software.

Here’s a look at what I’m talking about, so you can get a feel for the user interface – very clean and easy to navigate. First, the entire window for the current project:

birthplace_carto_map_20141122

CSS styling is also available for those wishing to tweak their maps, with the wizards providing the initial styling:

carto_css_20141122

You can even limit your data using the available SQL window, a great option for users (like myself) who are well acquainted with SQL:

carto_sql_20141122

Finally, a simple toggle at the top of the window lets you move seamlesly between the map and data views. Here’s a quick look at the data for this project:

carto_data_20141122

I should mention that working with the data is just as easy as styling the map or using the wizards. I have been able to quickly change string values to dates, and to geo-reference the data using the latitude and longitude fields in my text file. Anyone with experience working with Excel or any number of database platforms knows that converting field types is often very challenging, and sometimes comes with the risk of losing the data in that field. Not so with CartoDB, as it easily converted the date values to timestamps suitable for the torque (timeline) mapping wizard.

You should be seeing more work from me using CartoDB, and it won’t be limited to just baseball data.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Mapping is Cool

It’s been a couple years since I last spent considerable time on mapping aka spatial visualization. Now, courtesy of an interesting online course through Coursera, I’m engaging with it again, and rediscovering how cool mapping can be.

This has also led me to some promising new tools such as TileMill, designed to help map designers make their maps more attractive. I’m simultaneously trying to get up to speed with TileMill while taking the class (and writing a book on Gephi), so it’s slow going at the moment. However, expect to see some forthcoming maps as I figure this stuff out, especially since the class requires a map project to get a passing grade. That’s always an incentive!

TileMill

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

MLB Birthplaces by Decade

I created a little visualization using Tableau Public that looks at the birthplace patterns by decade for Major League Baseball players. As you scroll through, you can see the various migrations, first from East to West, then to the South, and eventually to places like the Dominican Republic and Venezuela. Viewing these birthplaces really drives home the changes we have witnessed in Major League Baseball over recent decades.

Tableau Public, for those of you not familiar, allows users to upload data and create visualizations of various types, ranging from bar charts to maps. All content can be shared across the user base, leading to even more creative output.

You can find the viz here or in my Portfolio section under the Mapping menu. Enjoy!

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Cartographer’s Toolkit

Currently reading Cartographer’s Toolkit by Gretchen Peterson, and loving the visual approach the book takes. For those of you unfamiliar with the terminology, cartography is simply a technical name for the art of mapping and map creation. Peterson’s book is literally a toolkit for mapping professionals and amateurs alike, walking the reader through the best types of fonts, color schemes, and map styles to use in designing your own maps.

I particularly love her templated approach, where each page shows the same base geography while using different font pairings. There are some ideas in the book that will certainly influence my own approach to designing my upcoming pennant race book.

To take a look at some of her work, follow this link: Cartographer’s Toolkit.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Birthplace Mapper Update

Cool map alert!

For those who don’t know, mapping is cool!. Realized this for the umpteenth time as I finally got back to the player birthplace mapper I premiered a few weeks back. After a few hours wrestling with SQL code, and then overcoming a brain cramp on a data formatting issue, I think I’ve managed to get a 99% solution, with a high level of wow! factor thrown in. The remaining 1%, by the way, concerns some players who were apparently born in the ocean, at least according to the geo coordinates in my possession. I’ll get those fixed shortly, but in the meantime, have a look at the improved mapper.

Some of the missing pieces from my first run at this have been repaired – players born outside the US now have information that pops up when you mouse over their map marker. This is a major improvement over the hundreds of blanks the original attempt contained. The info boxes are also tied to the level of information available, thanks to the aforementioned SQL. There were no fewer than 16 combinations of available and missing information across country, state, city, birth year, debut, and name fields in the database. This makes for a rather interesting bit of database code, but you need not worry about that when you view the map. That headache belongs to me!

Kudos again to the Cloudmade project and its flexible mapping offshoot Leaflet. These apps are highly recommended for creating flexible, professional looking maps using GeoJSON (KML works too) and javascript. The speed and interactivity of these maps is spectacular, and there are many features I haven’t even figured out yet. Watch out when that happens!

.A final thanks for the inspiration and clustering approach (the cool stuff that happens with the markers when you zoom in or out) to Dave Leaver, who created the original map using this approach.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Birthplace Mapper – Work in Progress

After turning to Google Earth, I wasn’t pleased with the results, so I came back to Leaflet, worked a bit harder to figure it out, and found a great implementation to inspire me. My in process example is here – birthplace mapper. What this example does is to cluster the birthplace markers based their geographic proximity, separating and re-clustering them as you drill up or down.

This is really early in the process, as I plan to add more information to the markers, as well as fixing the ones that don’t currently display – mostly from outside the US, where state information may be absent. Still, the potential for this is high, and makes for a much better navigational experience than the Google Earth version I was working on. Try it out!


FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather