Force-Directed Graph in ToxicLibs
in
Contributed Library Questions
•
1 year ago
Hello!
I am trying to re-create something very similar to NYTimes recent National Conventions Word Count visualization using Processing and ToxicLibs:
Could someone help me understand the force/spring logic behind this visualization at a conceptual level?
My understanding is that there should be a negative attraction force around each particle to take care of collisions. From there, would the particles be attracted by a positive force in the middle of the visualization, but "pulled" left or right (by a spring?) depending on its relative democratic/republican word usage?
If so, would this be best implemented in Processing/ToxicLibs with VerletSpring2D, or with VerletMinDistanceSpring2D?
The way I have it set up now is with locked particles on the left (p1) and right (p2), and a positive attraction force in the middle. I then create spring connections between p1 and all nodes, and p2 and all nodes. I have then been trying to weight the "springiness" and/or minimum distance to push/pull the nodes according to frequency. I can't seem to get a result similar to the NYTimes visualization, though.
My Processing experience is beginner/intermediate, so I just wanted to see if I am even headed in the right direction on this. Any help would be greatly appreciated!
All the best,
Ryan
1