Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Add spikelines#2247
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
Uh oh!
There was an error while loading. Please reload this page.
Add spikelines #2247
Changes from all commits
132b5b285714e8cd83ecf006b55db14286be5875a937e419f911ae0e751d527f5628326c2f368f56413aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -398,7 +398,7 @@ axes.saveRangeInitial = function(gd, overwrite) { | ||
| axes.saveShowSpikeInitial = function(gd, overwrite) { | ||
| var axList = axes.list(gd, '', true), | ||
| hasOneAxisChanged = false, | ||
| allEnabled = 'on'; | ||
| allSpikesEnabled = 'on'; | ||
| for(var i = 0; i < axList.length; i++) { | ||
| var ax = axList[i]; | ||
| @@ -415,11 +415,11 @@ axes.saveShowSpikeInitial = function(gd, overwrite) { | ||
| hasOneAxisChanged = true; | ||
| } | ||
| if(allEnabled === 'on' && !ax.showspikes) { | ||
| allEnabled = 'off'; | ||
| if(allSpikesEnabled === 'on' && !ax.showspikes) { | ||
| allSpikesEnabled = 'off'; | ||
| } | ||
| } | ||
| gd._fullLayout._cartesianSpikesEnabled = allEnabled; | ||
| gd._fullLayout._cartesianSpikesEnabled = allSpikesEnabled; | ||
| return hasOneAxisChanged; | ||
| }; | ||
| @@ -2048,7 +2048,7 @@ axes.doTicks = function(gd, axid, skipTitle) { | ||
| top: pos, | ||
| bottom: pos, | ||
| left: ax._offset, | ||
| rigth: ax._offset + ax._length, | ||
| right: ax._offset + ax._length, | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Did this cause any bugs previously? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It did in one of my early implementations | ||
| width: ax._length, | ||
| height: 0 | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -387,6 +387,14 @@ module.exports = { | ||
| 'plotted on' | ||
| ].join(' ') | ||
| }, | ||
| spikesnap: { | ||
| valType: 'enumerated', | ||
| values: ['data', 'cursor'], | ||
| dflt: 'data', | ||
| role: 'style', | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though always debatable, all the new attributes you added should be ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Changed it for | ||
| editType: 'none', | ||
| description: 'Determines whether spikelines are stuck to the cursor or to the closest datapoints.' | ||
| }, | ||
| tickfont: fontAttrs({ | ||
| editType: 'ticks', | ||
| description: 'Sets the tick font.' | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might still need something similar here.
For example, with
then click on
toggleSpikeLinesgives:with no way to get back to the original behavior using the mode bar buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks!
Now, could you restore and update the
modebar_test.jscases you removed in your first commit?