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

fix ternary hover after zoom/pan events #688

Merged
merged 5 commits into from
Jun 27, 2016

Conversation

alexcjohnson
Copy link
Collaborator

#660 had a weird interaction with ternary that hover events stopped being registered after zooming. This fixes that, and tests the fix.

@n-riesco @etpinard As I mentioned in slack, probably longer-term these mousemove/mouseout/click event handlers should get subsumed into dragElement... but this fixes the issue for now.

registered after zooming. This fixes that, and tests the fix.
select_test had a slight variant with the callback built into
doubleClick - changed it into the other form where you just do
.then(callback)
Dunno why eslint cannot find the config file correctly from the test
directory when I'm using sublime...
@alexcjohnson
Copy link
Collaborator Author

I consolidated all the separate definitions of click and doubleClick in our jasmine tests... doubleClick in particular was slightly different in different places, for no good reason.

};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard per my commit message... somehow eslint run through sublime cannot sort out the config files within the jasmine directory, even though as far as I can tell it's all correct. In any other directory things look fine. Have you seen this? If I change test/jasmine/.eslintrc from "extends": "../../.eslintrc" to "extends": "../.eslintrc" it no longer complains, though that's clearly not what you want as it'll think node is allowed.

I suppose we could make that change and also explicitly set env.node=false, that seems to work for me, but it's strange that this would be necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. No, I've never seen that one before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking it may be worth moving all our .eslintrc in a config/ at the root of the repo instead of having them scattered around (and hidden in) the directory tree.

We could move test_syntax.js to tasks/.

Having

test/
  |
  - image/
  - jasmine/
  - test_syntax.js
  - .eslintrc  (which is only relevant for test_syntax.js)

isn't great.

// constrain ymin/max to the visible plot, so the label goes
// at the middle of the piece you can see
ymin = Math.max(ymin, 0);
ymax = Math.min(ymax, ya._length);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you have, for example, a shape that goes way off the top of the plot, the label will still be centered on the visible portion rather than pinned to the top (and because of how this happens, the x position of the label could also have ended up screwy previously)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. That sounds good.

Now that all the scatter ternary hover label testing infrastructure is in place, would you mind adding a test case for this?

@alexcjohnson
Copy link
Collaborator Author

This latest commit about label positions addresses a different issue from the ternary hover disappearing entirely... but I added it here because a) I needed to fix that before I could even see the zoomed-in label positions, and b) it still fits the PR title "fix ternary (and scatter!) hover after zoom/pan events"

// from the mousemove events and then simulate
// a click event on mouseup
var click = require('../assets/click');
var doubleClick = require('../assets/double_click');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic. Thanks so much!

@etpinard
Copy link
Contributor

Thanks for the hot fix!

💃 after #688 (comment) is done.

@alexcjohnson alexcjohnson merged commit a19cf2f into master Jun 27, 2016
@alexcjohnson alexcjohnson deleted the fix-ternary-hover-after-zoom branch June 27, 2016 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants