Method: Rubyvis::Layout::Arc#sort
- Defined in:
- lib/rubyvis/layout/arc.rb
#sort(f = nil, &block) ⇒ Object
Specifies an optional sort function. The sort function follows the same comparator contract required by Rubyvis::Dom::Node.sort(). Specifying a sort function provides an alternative to sort the nodes as they are specified by the nodes property; the main advantage of doing this is that the comparator function can access implicit fields populated by the network layout, such as the link_degree.
<p>Note that arc diagrams are particularly sensitive to order. This is referred to as the seriation problem, and many different techniques exist to find good node orders that emphasize clusters, such as spectral layout and simulated annealing.
173 174 175 176 177 |
# File 'lib/rubyvis/layout/arc.rb', line 173 def sort(f=nil,&block) f||=block @_sort=f self end |