Skip to content

Make hover spikes work when no tick labels are present #1980

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

Merged
merged 6 commits into from
Sep 5, 2017

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Sep 1, 2017

fixes #1977 and makes #1604 obsolete.

@alexcjohnson I wouldn't mind a +1 on my approach before I add a test or two.

@etpinard etpinard added status: in progress bug something broken labels Sep 1, 2017
- so that hover knows where to draw spikes
@alexcjohnson
Copy link
Collaborator

Looks solid to me. Might want to calculate the rest of the bbox attributes just so people can pretend it's a real bbox (I see one caller that looks for .height for example).

- when label position is undefined, don't (re)-calc its bounding box
  as that could override previous 'correct' calculations
  (e.g. when overlaying axes are present)
- add dummy bounding box value whenever showticklabels is false
.then(function() {
Fx.hover('graph', {xval: 2, yval: 3}, 'xy');
expect(d3.selectAll('line.spikeline').size()).toEqual(4);
expect(d3.selectAll('circle.spikeline').size()).toEqual(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it worth verifying that these things have reasonable dimensions/positions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. done in 92b606b

- assert number of spike line visible as well as
  their position attributes
@alexcjohnson
Copy link
Collaborator

Looks fantastic - thanks for testing positions. 💃

@etpinard etpinard merged commit 624d5f6 into master Sep 5, 2017
@etpinard etpinard deleted the spikes-when-no-ticklabels branch September 5, 2017 21:01
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.

showspikes: true doesn't work if showticklabels: false
2 participants