Skip to content

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

Merged
etpinard merged 6 commits into
masterfrom
spikes-when-no-ticklabels
Sep 5, 2017
Merged

Make hover spikes work when no tick labels are present#1980
etpinard merged 6 commits into
masterfrom
spikes-when-no-ticklabels

Conversation

@etpinard

Copy link
Copy Markdown
Contributor

fixes#1977 and makes #1604 obsolete.

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

@alexcjohnson

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Collaborator

Looks fantastic - thanks for testing positions. 💃

@etpinard
etpinard merged commit 624d5f6 into masterSep 5, 2017
@etpinard
etpinard deleted the spikes-when-no-ticklabels branch September 5, 2017 21:01
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugsomething broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

showspikes: true doesn't work if showticklabels: false

2 participants

@etpinard@alexcjohnson