hshhrr / plotly-upset

UpSet intersection visualization utility for Plolty (Python-only)
MIT License
6 stars 0 forks source link

Issure with sorting along y_axis #2

Open AssiaSOntoforce opened 9 months ago

AssiaSOntoforce commented 9 months ago

Hey, it seems that when sorting along the y-axis is on, the order of the black dots and edges is not correct anymore. It seems that reordering of the dots and edges is not implemented for sorted_y (see difference upper and lower). Could you perhaps take a look at it? Otherwise the package is absolutely awesome

 if sorted_x is not None:
            a, b, c = int_ss, string_repr, np.arange(0, 2 ** len(sets))
            order = False if sorted_x.lower() == "a" or sorted_x.lower() == "ascending" else True
            sorted_list = sorted(zip(a, b, c), reverse=order)
            transposed = np.array(sorted_list).T

            a, b, c = transposed

            int_ss, string_repr, _sorted_sequence = a.astype(int), b, c.astype(int)

            t, f, edges = get_sorted_nodes_and_edges(
                t=t, f=f, edges=edges,
                sorted_sequence=_sorted_sequence
            )

        if sorted_y is not None:
            a, b = ind_ss, sets
            order = False if sorted_y.lower() == "a" or sorted_x.lower() == "ascending" else True
            sorted_list = sorted(zip(a, b), reverse=order)
            transposed = np.array(sorted_list).T
            a, b = transposed
            ind_ss, sets = a.astype(int), b
hshhrr commented 9 months ago

Thank you. I'll look into it asap.