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

error on bundling/smoothing with dimension flipping #296

Open Sigfried opened 8 years ago

Sigfried commented 8 years ago

When I flip the same dimension I'm bundling on, the clusterCentroids get messed up:

d3.parcoords.js:1778 Uncaught TypeError: Cannot read property 'get' of undefined

    // centroids on 'virtual' axes
    if (i < cols - 1) {
        var cx = x + a * (position(p[i+1]) - x);
        var cy = y + a * (__.dimensions[p[i+1]].yscale(row[p[i+1]]) - y);
        if (__.bundleDimension !== null) {
---->       var leftCentroid = __.clusterCentroids.get(__.dimensions[__.bundleDimension].yscale(row[__.bundleDimension])).get(p[i]);
            var rightCentroid = __.clusterCentroids.get(__.dimensions[__.bundleDimension].yscale(row[__.bundleDimension])).get(p[i+1]);
            var centroid = 0.5 * (leftCentroid + rightCentroid);
            cy = centroid + (1 - __.bundlingStrength) * (cy - centroid);
        }
        centroids.push($V([cx, cy]));
    }
dehli commented 8 years ago

Hey @Sigfried, thanks for pointing this out. Is from when you call flipAxes? Does the error also occur when you double click on an axis?