parallel-coordinates icon indicating copy to clipboard operation
parallel-coordinates copied to clipboard

common scale for single value/ordinal axes

Open julianheinrich opened this issue 9 years ago • 3 comments

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.

julianheinrich avatar Aug 02 '15 23:08 julianheinrich

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.

syntagmatic avatar Aug 04 '15 18:08 syntagmatic

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?

julianheinrich avatar Aug 04 '15 23:08 julianheinrich

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

syntagmatic avatar Aug 05 '15 01:08 syntagmatic