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

Reordering axes does not work correctly if data is 2D array of numbers #347

Open jamesscottbrown opened 6 years ago

jamesscottbrown commented 6 years ago

For axis re-ordering to work correctly, the data must be an array of objects (with column names as attributes), rather than a 2D array of numbers (array of array of numbers).

For example, it does not work correctly if the reordering example is changed from

var data2 = d3.range(0,2*Math.PI,Math.PI/40)
  .map(function(x) {
    return {
      "-x": -x,
      x: x,
      "sin(x)": Math.sin(x),
      "cos(x)": Math.cos(x),
      "atan(x)": Math.atan(x),
      "exp(x)": Math.exp(x),
      "square(x)": x*x,
      "sqrt(x)": Math.sqrt(x),
    };
  });

to:

 var data2 = d3.range(0,2*Math.PI,Math.PI/40)
  .map(function(x) {
    return [-x, x, Math.sin(x), Math.cos(x), Math.atan(x), Math.exp(x), x*x, Math.sqrt(x)];
      });

or if .reorderable() is added to the 'Minimal Example'.

Whilst the order of the axes does change in response to dragging, lines still join the axes that was moved to the axes that were previously adjacent to it.

This limitation does not seem to be currently represented in the documentation.