Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordering axis seems broken? (or what am I missing here) #280

Open
antz29 opened this issue Mar 2, 2016 · 2 comments
Open

Reordering axis seems broken? (or what am I missing here) #280

antz29 opened this issue Mar 2, 2016 · 2 comments

Comments

@antz29
Copy link

antz29 commented Mar 2, 2016

I'm building a visulisation of a PCA model and the ability to re-order the axis is fantastic here, but it seems that it's not behaving as I would expect.

Here I have some test data displaying a PCA model with 4 clusters.
image

When I move axis 1 to the end, it's as if it stay 'attached' to axis 2, so the lines are drawn over the top of the others.
image

This isn't how the examples behave, and certainly not what I was expecting, so I presume it's me doing something stupid but I have compared the examples and can't see what I'm doing wrong here.

var parcoords = d3.parcoords()("#chart")
  .data(m.getData())
  .smoothness(0.15)  
  .bundleDimension("1")
  .bundlingStrength(0.3)
  .hideAxis(["group"])
  .alpha(0.4)  
  .color((obj) => ({"Guacano" : '#F44336','Vicugna' : '#FF9800','Alpaca' : '#9C27B0','Domestic' : '#00BCD4'}[obj.group]))
  .composite("darker")
  .mode("queue")
  .render()
  .reorderable()
  .alphaOnBrushed(0.2)
  .brushMode("1D-axes");  

The data I'm rendering looks like this:

[
   {
      "1":629,
      "2":397,
      "3":940,
      "4":366,
      "5":959,
      "6":505,
      "7":457,
      "8":279,
      "9":115,
      "10":504,
      "group":"Guacano"
   }
]

What could I be doing wrong here?

@julianheinrich
Copy link
Collaborator

I've seen this happening a while ago and thought I fixed it, are you using the latest version on github?

murphy66 pushed a commit to murphy66/parallel-coordinates that referenced this issue Mar 22, 2016
@murphy66
Copy link

I noticed this issue as well. The thing is that sortDimensions() doesn't really change the order of the dimensions just sets the index attribute. The drawing in single_path() then loops through dimensions in the wrong order. I could fix the issue by sorting the dimensions by index before drawing the lines but this leads to poor performance.

Here is my quick and dirty fix:
murphy66@1705222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants