-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add spikelines #2247
Add spikelines #2247
Changes from all commits
132b5b2
85714e8
cd83ecf
006b55d
b14286b
e5875a9
37e419f
911ae0e
751d527
f562832
6c2f368
f56413a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
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, | ||
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? 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', | ||
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 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.' | ||
|
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
toggleSpikeLines
gives: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.js
cases you removed in your first commit?