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
510 stars 211 forks source link

common scale for single value/ordinal axes #113

Open julianheinrich opened 9 years ago

julianheinrich commented 9 years ago

Creating a set of axes with the same scale (e.g. by calling pc.commonScale()) but just one value (line) doesn't work because as of #79 axes with single values are converted to ordinal scales.

For example, I want to go from this: image to that: image

which I am currently achieving by assigning a domain to every dimension:

var domain = [0,1,2,3,4,5,6,7,8,9,10];
pc.dimensions().forEach(function(d) {
    pc.scale(d, domain);
});

But this is not ideal, as I am actually having numeric, continuous data.

syntagmatic commented 9 years ago

Julian, I've been starting from scratch to establish a new pattern for defining new data types and setting dimension metadata (scale, type, axis, etc). I'm curious what you think of the types and dimensions objects in this example:

http://bl.ocks.org/syntagmatic/8ff691209324f1814257

Also related to #90 and #91. One of the goals is to remove all of the autoscaling functionality currently baked into the core of d3.parcoords, which is the root cause of several classes of bug in the library.

julianheinrich commented 9 years ago

That's a great start @syntagmatic !

After skimming through your example, I can't think of anything missing in the types and dimensions objects. Do you want to make the dimensions a required input together with the data, or are we going to set some defaults if dimensions are not supplied by the user?

syntagmatic commented 9 years ago

Dimensions/types need a compare or defaultSort property to know how to order values.

I don't necessarily want to get rid of detecting dimensions and autoscaling entirely. But it should be built in a more modular way to allow testing, and to disentangle automatic settings from rendering/interaction.

I'm going to keep trying this pattern against datasets with complex labelling to see how flexible it is. Here's another example.

http://bl.ocks.org/syntagmatic/94be812f8b410ae29ee2