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

Modebar toggle spikes fixup #4241

Merged
merged 3 commits into from
Oct 1, 2019
Merged

Modebar toggle spikes fixup #4241

merged 3 commits into from
Oct 1, 2019

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Oct 1, 2019

fixes #4237 - which I think dates back to #2247 released in 1.33.0 😑

cc @archmoj it would be nice to squeeze this one in 1.50.0. Thanks!

... during modebar button on-click logic for cartesian axes.

    Previously, we assume that _cartesianSpikesEnabled was always
    on when clicking on the other modebar buttons for cartesian
    axes. This is obviously wrong.
- This is an artefact from the early days of "spikes" where
  they only worked with hovermode:'closest'
@etpinard etpinard added bug something broken status: reviewable labels Oct 1, 2019
Comment on lines -256 to -262
} else if(astr === 'hovermode' && val === 'closest') {
for(i = 0; i < axList.length; i++) {
ax = axList[i];
if(allSpikesEnabled === 'on' && !ax.showspikes) {
allSpikesEnabled = 'off';
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some history here:


it('should work after clicking on "autoScale2d"', function() {
var buttonAutoScale = selectButton(modeBar, 'autoScale2d');
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('off');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, clicking on the "autoScale2d" modebar button on a graph that has _cartesianSpikesEnabled: 'off' on first draw, results in

gd._fullLayout._cartesianSpikesEnabled // => 'on'

which is obviously wrong.

@archmoj
Copy link
Contributor

archmoj commented Oct 1, 2019

Brilliant fix.
@etpinard thanks for the fix and providing clear details.
💃

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.

Clicking "Autoscale" in menu-bar also graphically toggles spikemode
2 participants