syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

Manually reorder axis #355

Closed berci-i closed 2 years ago

berci-i commented 3 years ago

Is it possible to restore a manually saved order?

I am saving the value of .getOrderedDimensionKeys() in localStorage. I tried to use something like .reorder({ 1: -1, 355: 999999999, 21: -9, 778: 999 }), .reorder(["355", "21", "778", "1"]), .dimensions({ 355: 999999999, 21: -9, 778: 999, 1: -1 }) and .dimensions(["355", "21", "778", "1"]) with calling .render().updateAxes() after each try, but nothing seems to reorder them.

In an example I managed to reorder them with the first variant but only with great differences of numbers and for manual inputs.

Is any of the function mentioned above supposed to work? If yes, which one and how? Thank you in advice!

berci-i commented 2 years ago

If anyone needs help on this, it can be accomplished by adding index to dimensions (source parallel-coordinates ) I initially missed it because index": Integer position for ordering dimensions on the x axis part on the same line with yscale and I was not sure it was supposed to be on dimensions😅