Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flip axes programmatically and turn off interactive flipping #19

Closed
wraseman opened this issue Nov 13, 2018 · 6 comments
Closed

Flip axes programmatically and turn off interactive flipping #19

wraseman opened this issue Nov 13, 2018 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@wraseman
Copy link
Collaborator

@joshhjacobson, do you know how to flip axes in Parcoords without a mouse click? I can't figure out how to do it programmatically, only how to do it by clicking on the axes.

Also, do you know if there is a way to turnoff interactive flipping of axes? I want to put a preferred direction arrow in (and therefore, don't want the user to be able to mess with the axis orientation).

@wraseman wraseman added the question Further information is requested label Nov 13, 2018
@joshhjacobson
Copy link
Member

Looking at the source code from parcoords here, it looks like the syntax should be pc.flip("axes name") or pc.flip(["axis1", "axis2", ...]). This is slightly different from the original syntagmatic syntax which was pc.flipAxes(), more info here. Let me know if this works, I haven't tested it, but it's a feature I plan to create a parasol wrapper for.

I think this functionality is hard-coded in parcoords as an "on-click" event (it's present even in our most basic examples), so I don't know that we actually have the power to disable it right now. This might be a question and potential request for our friends at parcoords.

@wraseman
Copy link
Collaborator Author

Thanks! For some reason pc.flip("axes name") is working for me but not pc.flip(["axis1", "axis2", ...]). I can make the former method work, so that's not too much of a problem but not ideal of course.

It's okay if we can't disable the "on-click" flipping, I doubt many users will even know the flipping feature exists if we don't advertise it.

Agreed though. There could definitely be some improvements on the Parcoords end.

@wraseman wraseman reopened this Nov 14, 2018
@wraseman
Copy link
Collaborator Author

Welp. It turns out that when I use pc.flip("axis name") brushing stops working... It's always something! Could you put this as a top priority (just below setAxesLayout()? Axis flipping is an essential feature for visualizing the objective space.

@joshhjacobson
Copy link
Member

Classic. Does it break all brushes or just linked brushes? In either case, could you provide a brief example?

I'll put this at the top of my list and also reach out to the parcoords team about providing the option to make flipping non-interactive.

@wraseman
Copy link
Collaborator Author

Here ya go:

var ps = Parasol(data)('.parcoords')
ps.charts.forEach(
  (pc) => {
      .flip('rel. (-)')
      .render()
      .updateAxes(0);
  }
)

When I try to brush the flipped axis, all the polylines disappear:
image
I also get the following error which is associated with implementing the Parcoords methods:
image

The weird thing is that when I interactively flip the axis back to its original orientation, the brushing works again.
image

@joshhjacobson
Copy link
Member

Update: In parcoords, the correct syntax to flip one or more axes is pc.flipAxes(["x", "y"]). The same now holds for the parasol wrapper of the function.

The issue with polylines disappearing on flipped axes is tracked in BigFatDog/parcoords-es#60.

Sometime soon, I'll submit a PR to parcoords making interactive flipping configurable; similar to how rotateLabels works currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants