Skip to main content
100%

Linked *strict* Beeswarm

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Dec 29, 2017

This linked beeswarm chart displays every murderer and victim from Agatha Christie’s Hercule Poirot novels, with each circle’s vertical position strictly encoding the book’s publication year. The y-coordinate is fixed to the date value before the force-based simulation runs, preventing the typical beeswarm distortion. The interactive visualization uses D3 v4 with a Voronoi overlay to enlarge hover/tap targets, and it renders in SVG with data loaded from a CSV file.

AI-generated description

This block is a remake of <a href='http://bl.ocks.org/HarryStevens/'>HarryStevens</a>'s block: <a href='http://bl.ocks.org/HarryStevens/bd3ce1862ccfbb5b0c78b56aca8fca6c'>Linked Beeswarm</a>, where the position of circle strictly encode dates, because I'm always confused when a beeswarm does not the job it was dedicated for.

To fix the y-coordinate for a strict encoding of the data-based value (here, the date), 1 line of code is required (before starting the force-based simulation):

data.forEach(function(d){ d.fy = y(d.book_year); });

Another option would have been to use the d3_beeswarm plugin, which computes the final arrangement thanks to a one-pass algorithm, which is much more faster than using a force-based simultation.

==ORIGINAL README==

This is the code for the "linked beeswarm" chart I made for a story on the history of Hercule Poirot.

I added a checkbox to let you see the Voronoi diagram, which optimizes the size of the mouseover / tap area of each circle.

gpl-3.0 Licensed

Similar vizzes