4

Finding the Story in the EU Fisheries Data

 3 years ago
source link: https://dev.to/benjamesdavis/finding-the-story-in-the-eu-fisheries-data-1gpc
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Finding the Story in the EU Fisheries Data

As Brexit trade negotiations were dragging on at the start of the year, a lot of the discourse was focused on perceived inequities in fishing rights. I felt there was a story in the data that needed to be told. Despite having the largest Exclusive Economic Zone (EEZ) of all EU countries, and some of the richest fishing grounds, UK fleets are restricted to quite modest catches.

Initially, I had grand plans to create a sort of ‘flow map’ that would trace the translocation of fish from fishing grounds to the country of landing. The Common Fisheries Policy provides EU states with mutual access to each other's fishing grounds, but sets quotas that are largely based on catch figures from 40 years ago which today seem arbitrary. Earlier this year, the UK government was pushing to reverse this by proposing a “zonal attachment” model, where quotas would be carved up relative to the abundance of fish in each country’s waters.

I was interested to see what a switch to this model would mean. How significant a change would this make? Which countries would be the winners and losers?

The Data

Each EU state reports its annual landings across a grid of spatial cells, called ICES rectangles - each about 30 nautical miles by 30 nautical miles in size. By clipping this grid against a map of EEZ polygons, ICES rectangles could be assigned to the country whose waters they are contained within, providing a state of origin for reported catches. Where cells straddled jurisdictions, catches were split relative to the proportion of the cell that falls within each country.

Aggregating catches within each EEZ gave an approximation of what quotas would look like under a zonal attachment model, while aggregating catches by fleet shows how much the existing quotas diverge from this model.

Visualization Inspiration

Initially, I had grand plans to create a sort of ‘flow map’ that would trace the translocation of fish from fishing grounds to the country of landing. One idea was to represent EEZ biomasses on a dot density map with dots transitioning into geographically arranged catch bars. Another was to illustrate catch flows through arrows of varying thickness, on a map that would’ve likely resembled the opening sequence of “Dad’s Army”.

Both options were technically challenging and promised to produce a snazzy output, but since the geographic component was kind of superfluous for the analysis, it threatened to distract from the crux of the piece. I didn’t really care whether fish were flowing between adjacent or more distant countries - just the extent to which they were flowing between countries, and the resulting net imports / exports. Therefore, I opted to de-couple the flow component from the map component to favour a more functional chart in the form of a Sankey.

Although Sankey has become a bit hackneyed in recent years, there have been some compelling D3-based variants that have breathed new life into the chart form. My main inspiration was from an NYT article on social mobility bias, that conveyed ‘flows’ of black and white boys from different backgrounds into different socio-economic classes. Instead of encoding flows through ribbon thickness, like a traditional Sankey, particles flow between the Sankey dimension in varying density and frequency. The animation mesmerizes and keeps the reader engaged as the result emerges gradually through the course of the animation.

By complementing the particle Sankey with marginal bar charts of fish biomass, the net flows out of and into each country could still be easily compared. For example, it’s clear Denmark gets a good deal, catching in excess of the biomass that their fishing grounds produce, while the UK is justified in feeling hard done by, with the majority of UK fish ending up in other country’s nets.

I was pleased with how the marginal bar charts melded in with the animation sequence. At the top, the bars (representing fish caught in each country’s waters) are pushed downwards and seemingly shred into tiny particles - akin to Banksys’ self-shredding artwork, and then as they work their way down shuffle satisfyingly into their destined lanes (representing the fleet of capture).

Why Observable?

For me, Observable is a gallery, a self-contained development environment, a sandbox, a collaboration platform, and crucially - as a relative newcomer to D3 - a library for learning. It’s simple and quick to browse through other people’s work, dig into their code, and decipher the mechanics of their visuals.

For this particular piece, a search for “animated Sankey” yielded a raft of examples from an Amelia Wattenberger tutorial, which would form the basis of my Sankey template. Further, by porting Elijah Meeks' particle Sankey from Blocks to Observable, I learned of some neat javascript functions (e.g. getPointAtLength) that helped better control the paths of the particles.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK