Previously, we were computing the node position relative to the node, which is dangerous is the node is transformed. Computing it relative to the parent allows nodes to be positioned using the "transform" attribute.
* jasondavies-qq: Improvements to qq chart. Add x- and y-scales to Q-Q plot. Add Q-Q plot.
* jasondavies-spline-editor: Minor improvements to spline example. Simplify path handling. Bind mouse event handlers to window. Move spline editor to standalone directory. Add spline editor example.
* jasondavies-sort: Sort example improvements. Add parallel option to merge sort example. Add animated merge sort example.
Simplify the implementation of parallel merge-sort, so that we have one pass per swap across chunks. Use a data join so that the elements are translated rather than rotated, since this better conveys the underlying sort. Auto-play the animation in parallel, and restart a few seconds after it finishes.
This simply shows the merges happening in parallel.
Inspired by the phrase "reminiscent of wind gusting over tall grasses" in <http://vis.stanford.edu/protovis/ex/sort.html>. It seemed abominable not to animate the swaying tall grasses!
There will always be a single <path> element, so no need to handle enter, update and exit cases. WebKit seems to erroneously warn (in the error console) that it can't parse `d=""`. I can't see anything in the SVG spec disallowing an empty `d` attribute so I think this is safe to ignore.
This produces much nicer behaviour when the mouse dragged outside the <svg>'s area. Thanks, Mike!
We don't actually need the separate `fx` and `fy` attributes on each node; instead we can modify the `x` and `y` attributes directly, since we're using position Verlet! This commit also adds the layout's `alpha` parameter to the tick event, such that normalized external forces can be applied.
I've dropped path transitions on Mike's recommendation as D3 doesn't have smart path interpolation at the moment so they don't work too well. I've also fixed some issues with data joins.
This avoids excessive graph jiggling when new nodes are added to an existing layout. Rather than initializing the new node positions randomly, the new nodes are positioned to be adjacent to linked nodes.
The force layout's listeners are now scoped using the "force" namespace, allowing other event listeners to be registered. In addition, the force layout now stops propagation of mouseup events when a node is moved; this allows a mouseup listener on the node to fire only when it is not moved.
Gravity was getting too strong near the edges, causing bunch-up of nodes. We now use weaker exponential growth in gravitational strength, rather than linear.