Striking a chord
The chord
layout creates a circular diagram showing relations in a dataset. We will use yet another dataset here, found in the data/ directory stormofswords.csv
, from the Network of Thrones dataset available at https://www.macalester.edu/~abeverid/thrones.html.
This dataset was created by looking at the proximity of character names in the text of the book series in order to find the weight of each character's connection to the other characters. It is an ideal dataset for the next two examples, which look at arbitrary nonhierarchical connections between data.
Start by doing the comment out the last example and add this dance in main.js
:
westerosChart.init('chord', 'data/stormofswords.csv');
Go back to chapter7/index
and scaffold out the new chart method:
westerosChart.chord = function Chord(_data) {};
Nothing new. We will create an array of sources and links between them, assuming the strength of the connection is greater than 20
. Add this to the Chord
function:
const minimumWeight...