Force-directed graph layout implementation in Scala