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

Every datapoint on an axis gets a tick #306

Closed RPaetau closed 8 years ago

RPaetau commented 8 years ago

Hello there, i have an issue where my parallel coordinate plot is making ticks at every datapoint on every axis. You can imagine just how chaotic this looks when there is a few hundred datapoints. I have a pretty standard setup of my parallel coordinate plot so i dont think this is what causes the issue:

                      pc1 = d3.parcoords()('.parcoords')
                          .data(data)
                          .color("#5254a3") 
                          .alpha(0.4)
                          .mode("queue")
                          .render()
                          .brushMode("1D-axes") // enable brushing
                          .brushedColor("#3254a3")
                          .reorderable()
                          .updateAxes();

I think however it is caused by the dataformat, cause i have tried instead of passing my data object, just passing an array with arrays of values, and in that case it renders just fine! This is not an option for me though, cause i need the "names" of each dataset to appear on the axis.

The dataformat i use (which works fine, mostly, except for the ticks) is something like this :

var data = [
     {x1: "2,3",x2:"3,5",x3:"20.1"},
     {x1: "5,4",x2:"1,2",x3:"18.6"},
    ....
]

I hope someone out there might be able to help me, even a hack to get around the issue quickly would be appreciated (:

Thank you for reading - Rasmus

syntagmatic commented 8 years ago

It looks like the numbers are going in as strings, which will cause d3.parcoords to interpet the values as a categorial dimension (creating a tick for each unique value). If you take out the quotes around numbers in that data structure, it should work like you expect.

RPaetau commented 8 years ago

That was actually how it was, but i changed it to strings after seeing thats how d3.csv formatted data, and ive seen it working from csv files. I have also just rechecked, it does not fix my issue sadly.. Thanks for taking time to answer! (:

syntagmatic commented 8 years ago

Do you have a link to the example? If it's not a number type detection issue, I don't have enough to say what it could be.

RPaetau commented 8 years ago

Arh darnit! You were right about the string thing! When i changed it to integers(Or thought i did) it was actually still strings, cause the json formatter from my asp.net webapi made it into strings. I was not aware of this, silly silly mistake on my part, but thank you so much for the help! Otherwise i fear this might have taken me weeks to catch (: You can close the issue (: