Merged
Conversation
... 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
commented
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'; | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Some history here:
- Cartesian spikes were first introduced in Cartesian dropline support #1461
- back then, they only worked with
hovermode: 'closest' - this particular block got added in rpaskowitz@762b54a w/o tests
- Add spikelines #2247 made spikes work regardless of
hovermode, but didn't 🔪 this block
etpinard
commented
Oct 1, 2019
|
|
||
| it('should work after clicking on "autoScale2d"', function() { | ||
| var buttonAutoScale = selectButton(modeBar, 'autoScale2d'); | ||
| expect(gd._fullLayout._cartesianSpikesEnabled).toBe('off'); |
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
|
Brilliant fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!