Handle layout and positioning more intelligently in cytoscapejs.html