Mar
21
2008

pick the prez

Earlier this week we rolled out the Electoral College Prediction Map, which lets users game out how the Electoral College vote may go with this November’s presidential election. Start from scratch, or select from a variety of “modes” to get you started (for example, possible 2008 swing states, highlighted below). Once you’re done, you can save your glorious picks in the form of a link you can send around or some code to embed the map in a Web page or blog post:

<p><strong>><a href='http://www.washingtonpost.com/wp-srv/politics/interactives/campaign08/electoral-college/'>Electoral College Prediction Map</a></strong> - Predict the winner of the general election. Use the map to experiment with winning combinations of states. Save your prediction and send it to friends.</p>

In addition to the interactive elements, this project offered an extra challenge: Not all states follow the same rules in awarding electoral votes. Maine and Nebraska award one electoral vote to the winner of each congressional district and an additional two electoral votes to the winner of the statewide popular vote. To allow users to pick the results in these states at a more granular level, I added the district boundaries and a little square in each state to represent the “at-large” vote.

(In 2004, a Colorado ballot initiative to split the state’s electoral votes proportionally according to the statewide popular vote failed. Had it passed, I’m not entirely sure how I would have presented that on this map — perhaps by dividing the state up into 9 individually-clickable blocks (corresponding to its number of electoral votes). However, that solution poses its own problems, as those blocks might be confused with district boundaries. Thankfully, it’s not a problem I have to worry about right now.)

The map itself predates my time at post.com. I’ve been using and steadily refining it over the years for various projects, from this 2005 map of Medicare data to a 2006 navigational map for midterm election results to this map of campaign events by state and 2008 primary results.

The way the map is structured right now, I have a movieclip called “map,” and inside of that, I have a series of layers with many other movieclips:

  • A movieclip (named “stateNames_mc”) with text labels for each state. Each label is a separate movieclip, named according to the state’s postal abbreviation. (Exceptions are Indiana, Oregon and Nebraska, who can’t use the standard postal abbreviations because they conflict with native Flash functions. For these states, I use “ind,” “ore” and “neb.”)
  • The overall outlines of the map
  • A series of movieclips with thick inset borders for each state (used most recently for a map displaying U.S. gun laws). The movieclips are named according to their state postal abbreviation and the word “inset.” (Example: “va_inset”)
  • A series of movieclips with the fills for each state (NOT the outlines), named according to the state postal abbreviation.

At some point, I want to clean this up a bit, so that the structure of the “map” movieclip is more like this:

  • map outlines
  • a single movieclip for each state; inside that movieclip are the following:
    • state label (named “label”)
    • inset border (named “inset”)
    • state fill (named “fill”)

Then I can address any element of a state more like this: “map.va.label” or “map.va.fill.” It’s not tremendously different from how I have it set up now, just a bit tidier and easier to hand off to someone else.

Regardless, it’s set up in a way that allows me a good bit of flexibility to show, hide or recolor pretty much any element I need, all controlled via ActionScript (parsing parameters in an XML file that’s unique to each project).

Post a comment

As a spam-control measure, your comment may require my approval before it will appear on the entry. Thanks for waiting. To avoid the moderation delay, consider filling in your e-mail address. It won't appear on the site, but I use it to whitelist frequent commenters so their comments appear automatically.


The following HTML tags are permitted (if you want to use them):
p, br, a href, b, strong, u, i, em, ol, ul, li, cite, blockquote

TrackBack

TrackBack URL for this entry: http://www.morethanthis.net/mtadmin/mt-tb.cgi/4188