The Facebook Primary

The Facebook Primary

Organisation: FiveThirtyEight (United States)

Publication Date: 04/09/2016

Size of team/newsroom:large


This interactive map shows where presidential candidates get the most Facebook likes. Users can toggle candidates on and off and zoom in to see finer detail at the state, county, and zip code level. There are also a series of built-in scenarios to guide readers into the interactive and highlight particularly interesting parts of the data. The aim of the map is to allow users to see the overall distribution in likes, and then quickly hone in on the smaller geographic areas that they personally care about. There are some interesting trends to be found in the data: Donald Trump’s total Facebook dominance in Appalachia and Bernie Sanders’ enormous lead over Hillary Clinton in the Midwest have proven to have some predictive power.

What makes this project innovative? What was its impact?

The sort of data we received from Facebook is only available through collaboration, so this mapping project was one-of-a-kind, and it offers some real insights into the dynamics of the 2016 election. The city-zoom is also an important feature: By offering a separate level of zoom for specific urban areas, the map highlights key zones that can get missed due to their relatively small geographic footprint. There were also some specific technical innovations for this project, including a new javascript library (d3-pre) which was developed to pre-render the raw svg generated by d3 code. These innovations are described below.

Technologies used for this project:

This project was built using d3 and topojson. We developed a new library specifically for this project – d3-pre – which pre-compiles the svg generated from d3 code instead of waiting for these calculations to take place on the client side. This provided enormous load time savings, allowing the detailed map to appear on the page much faster. There were several other optimizations to ensure that the svg map loaded and transformed as smoothly as possible, for example high resolution state borders only appeared on hover. We believe that this project approaches the limits of standard vector mapping -- anything larger or more detailed would have had to be done with vector or raster tiling. This project also included an extensive build to convert the raw data provided by Facebook into an optimized form for mapping. This build included Node.js, R, QGIS, and command-line topojson.
Follow this project

Comments (0)

You have to be connected to contribute

You have to be connected to follow

Leave this project and no longer be informed about this project

By joining this project, you will be informed by email when an update or a new contribution is posted on the website.

Thank you for your active participation !

The GEN Community Team