Javascript constraint-based graph layout