A quick adaptation of Mike Bostock's force-directed graph showing character co-occurence in Les Misérables. In this version, the character names are displayed. This is accomplished by wrapping both circles and text svg components within a group svg component.
Compare to the original diagram by Mike Bostock.
Please check out my blog on JavaScript and Typescript at https://typeofnan.dev!
I noticed while trying out your code, that the drag event on the nodes is not as smooth as it is in the original by Mike Bostock. I altered the way you registered the drag events and it resolved this issue. Maybe you could review this. Otherwise great work!