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

flipAxisAndUpdatePCP bug? #294

Closed Sigfried closed 8 years ago

Sigfried commented 8 years ago

I think there is a bug here:

https://github.com/syntagmatic/parallel-coordinates/blob/master/src/axis.js#L8

function flipAxisAndUpdatePCP(dimension) {
   var g = pc.svg.selectAll(".dimension");

   pc.flip(dimension);

   d3.select(this.parentElement)
      .transition()
        .duration(__.animationTime)
        .call(axis.scale(__.dimensions[dimension].yscale));

    pc.render();
 }

this is undefined in this function, at least for me it is.

dehli commented 8 years ago

How are you calling flipAxis?

Sigfried commented 8 years ago
 pc.flipAxes(['month'])
dehli commented 8 years ago

Maybe it has to do with the ordering? In basic.html the following code works.

var parcoords = d3.parcoords()("#example")
  .data([
    [0, -0, 0, 0, 0, 1],
    [1, -1, 1, 2, 1, 1],
    [2, -2, 4, 4, 0.5, 1],
    [3, -3, 9, 6, 0.33, 1],
    [4, -4, 16, 8, 0.25, 1]
  ])
  .render()
  .createAxes()
  .flipAxes(['0']);

Are you calling it after createAxes has been called? If that's the case, I can make sure to update the documentation.

Sigfried commented 8 years ago

I am calling it after everything else. But I might be screwing something else up because brushing and reordering aren't working on my chart even though I'm turning those on.

dehli commented 8 years ago

Ahh, are you including sylvester.js and d3.svg.multibrush.js?

Sigfried commented 8 years ago

Ah, no. I'll go get those.

... No. Something still screwed up. I'm in a react context and was using react-parallel-coordinates and brushing/reordering were working, but that uses an old version of parallel-coordinates, so I scrapped it.

On Fri, Apr 8, 2016 at 7:32 AM, c.p. notifications@github.com wrote:

Ahh, are you including sylvester.js and d3.svg.multibrush.js?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/syntagmatic/parallel-coordinates/issues/294#issuecomment-207392578

Sigfried commented 8 years ago

I'm not sure what https://github.com/Git-me-outta-here/react-parallel-coordinates is doing to get brushing to work in react that I wasn't doing (though it isn't including sylvester and multibrush), but I'm back to using it (with a couple fixes to use the latest version of parallel-coordinates). Still not able to flipAxes.

Sigfried commented 8 years ago

I see now that the code is actually working, the yscale domain is getting flipped, but visibly on the chart nothing is happening, it appears unflipped.

Sigfried commented 8 years ago

Nevermind. I just have to call .render().createAxes() after calling .flip().

dehli commented 8 years ago

Glad you got it working! :)

Sigfried commented 8 years ago

Thanks!