a mashup of the 538 twitter network from @xaranke with the Network Annotation with Collision Detection block from @elijah_meeks
This demonstrates how to use d3-annotation() with bboxCollide
to procedurally place node labels. After using the nodes data to create a network visualization of the Les Miserables play, we filter the nodes to leave out the side characters and pass that array to d3-annotation
. We then create a second forceSimulation
, this time using the size of the notes as the property in our bounding box collision detection, to move the labels out of each others' way.
d3-annotation
by Susie Lu.
Updated missing url https://cdn.rawgit.com/susielu/d3-annotation/master/d3-annotation.js to https://cdn.jsdelivr.net/gh/susielu/d3-annotation/d3-annotation.js
https://d3js.org/d3.v4.js
https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.23.1/babel.min.js
https://cdn.rawgit.com/susielu/d3-annotation/master/d3-annotation.js