def reverse(line_collection: vp.LineCollection) -> vp.LineCollection: """Reverse order of lines. Reverse the order of lines within their respective layers. Individual lines are not modified (in particular, their trajectory is not inverted). Only the order in which they are drawn is reversed. """ line_collection.reverse() return line_collection
def test_line_collection_reverse(): line_arr = [(0, 100j, 1000, 10), (5j, 3, 25j), (3 + 3j, 100, 10j)] lc = LineCollection(line_arr) lc.reverse() for i, line in enumerate(reversed(line_arr)): assert np.all(lc[i] == np.array(line))