daveliepmann/vdquil — pull request #3 by mars0i (2014-09-16 16:04:03+00:00)
Title: Chapter 8 example

Hi,

I was interested in using Quil to create network graphics. After I bought Fry's Visualizing Data, I found your Quil translations of chapters 3-7 to be helpful--thanks. I decided to try translating Fry's force layout code from Chapter 8. I got a minimal version working. Feel free to incorporate it into your repository if you'd like. All of my additions should be in the chapter8 directory, except that I updated some of the version numbers in project.clj. (I created an earlier pull request, but then closed it because I realized I'd included some files that didn't belong there.) There's a data directory under chapter 8 that includes the huckfinn data that Fry uses, but I never got around to using it.

I didn't try to match the stylistic decisions in your code. For example, I used Quil's functional mode.

I found it a bit difficult to make Fry's force layout code into a purely functional style, but eventually succeeded by taking liberties with the organization of the code. That is, it's more of a rewrite than a translation. (Nevertheless, I'd guess that a force layout algorithm implemented in Clojure from the start, by someone who understood how it works, would be simpler. Fry doesn't explain the principles captured in his force layout code, and I didn't do the research to fully understand force layout principles. I just tried to reproduce the same mathematical effects that I saw in Fry's code.)