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

Polyline with multiple attributes per axis #304

Open sc28 opened 8 years ago

sc28 commented 8 years ago

Is there any way for a polyline to "branch" off to multiple attributes on an axis?

This could be useful in some cases, in particular for nominal type axes. For example, here is a mock-up using the cars data set. In this example, each car could be produced in several locations, and the corresponding polyline would be displayed something like this:

multiple_attributes

I'm fairly new to D3 and JS, so I'm not sure how complex this would be to implement (or if it would be in fact useful).

syntagmatic commented 8 years ago

This is a great idea. It's complex because it requires rendering a nested data structure.

I suggest implementing this as plain D3 code. There is much less overall complexity in some of the examples on bl.ocks.org than in d3.parcoords.js.

Two possible starting places: http://bl.ocks.org/mbostock/1341021 http://bl.ocks.org/syntagmatic/c9fb69e425a3c07cfbd09169941fbf46

syntagmatic commented 8 years ago

And great mockup by the way! It's very helpful to have a visual of the ideal behavior

julianheinrich commented 8 years ago

I guess the common workaround is to have three lines for the car (that's probably how you created the mockup?).

sc28 commented 8 years ago

Thanks for the quick responses! @julianheinrich in fact the mock-up is just visual (edited in Gimp), but duplicating the line and editing the attribute would indeed produce this result.

However, this might cause some undesired side-effects in some cases (e.g. when using density to show number of lines; by changing the rank of the attribute (the more lines go through it, the higher it is ranked); artificially changing the average axis value as in #282 ).

What would be nicer is indeed a nested structure, for example interpreting multiple values for a given column in the .csv, if separated by a defined delimiter such as "/". The .csv for the mock up would look like:

csv_multi_attributes

A bit out of reach for now, but thanks for pointing out the bl.ocks codes which are indeed probably a better place to start.