NodeList doesn't support .sort() directly, so we need to convert to a real Array first. I've done this in selectAll for efficiency i.e. this avoids a new Array being created every time the same selection is sorted. However, it may be slightly more efficient to create the Array only when sorting, to avoid unnecessary Array creation when sorting isn't used, which is probably the common case. Unfortunately it's difficult to test this because JSDOM uses a real Array instead of a NodeList!
… reflect what we are calculating; charge no longer appears in `k` calculation in repulsive force calculations.