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

Polyline with multiple attributes per axis #304

Open
sc28 opened this issue May 2, 2016 · 4 comments
Open

Polyline with multiple attributes per axis #304

sc28 opened this issue May 2, 2016 · 4 comments

Comments

@sc28
Copy link

sc28 commented May 2, 2016

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
Copy link
Owner

syntagmatic commented May 2, 2016

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
Copy link
Owner

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

@julianheinrich
Copy link
Collaborator

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

@sc28
Copy link
Author

sc28 commented May 3, 2016

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.

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