-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Set default layout.axis.tickmode to 'sync' when axis is overlaying
#7684
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
Open
emilykl
wants to merge
8
commits into
master
Choose a base branch
from
shared-axis-lines-default
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+32
−22
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
46a77cc
run formatter
emilykl eff3ec3
set default tickmode to 'sync' when axis is overlaying
emilykl fe1d62c
remove duplicate draw call for axes with tickmode: 'sync'
emilykl badfa8b
bugfix: if overlaid axis is categorical, default to 'auto' rather tha…
emilykl 4d888f3
explicitly set tickmode auto for mock
emilykl a9b937b
update image baselines
emilykl 7de68e8
update tickmode attribute description
emilykl 7d71516
update plot-schema
emilykl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,7 +35,8 @@ var tickmode = extendFlat({}, minorTickmode, { | |||||
| description: [ | ||||||
| minorTickmode.description, | ||||||
| 'If *sync*, the number of ticks will sync with the overlayed axis', | ||||||
| 'set by `overlaying` property.' | ||||||
| 'set by `overlaying` property. When no other tick info is provided,', | ||||||
| 'overlyaing (non-categorical) axes default to *sync*, while other axes default to *auto*.', | ||||||
|
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.
Suggested change
|
||||||
| ].join(' ') | ||||||
| }); | ||||||
|
|
||||||
|
|
||||||
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,43 +6,48 @@ var isTypedArraySpec = require('../../lib/array').isTypedArraySpec; | |||||
| var decodeTypedArraySpec = require('../../lib/array').decodeTypedArraySpec; | ||||||
|
|
||||||
| module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) { | ||||||
|
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.
Suggested change
|
||||||
| if(!opts) opts = {}; | ||||||
| if (!opts) opts = {}; | ||||||
|
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.
Suggested change
|
||||||
| var isMinor = opts.isMinor; | ||||||
| var cIn = isMinor ? containerIn.minor || {} : containerIn; | ||||||
| var cOut = isMinor ? containerOut.minor : containerOut; | ||||||
| var prefix = isMinor ? 'minor.' : ''; | ||||||
|
|
||||||
| function readInput(attr) { | ||||||
| var v = cIn[attr]; | ||||||
| if(isTypedArraySpec(v)) v = decodeTypedArraySpec(v); | ||||||
| if (isTypedArraySpec(v)) v = decodeTypedArraySpec(v); | ||||||
|
|
||||||
| return ( | ||||||
| v !== undefined | ||||||
| ) ? v : (cOut._template || {})[attr]; | ||||||
| return v !== undefined ? v : (cOut._template || {})[attr]; | ||||||
| } | ||||||
|
|
||||||
| var _tick0 = readInput('tick0'); | ||||||
| var _dtick = readInput('dtick'); | ||||||
| var _tickvals = readInput('tickvals'); | ||||||
| var _overlaying = readInput('overlaying'); | ||||||
| var _categorical = axType === 'category' || axType === 'multicategory'; | ||||||
|
|
||||||
| var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' : | ||||||
| _dtick ? 'linear' : | ||||||
| 'auto'; | ||||||
| var tickmodeDefault; | ||||||
| if (isArrayOrTypedArray(_tickvals)) { | ||||||
| tickmodeDefault = 'array'; | ||||||
| } else if (_dtick) { | ||||||
| tickmodeDefault = 'linear'; | ||||||
| } else if (_overlaying && !_categorical) { | ||||||
| tickmodeDefault = 'sync'; | ||||||
| } else { | ||||||
| tickmodeDefault = 'auto'; | ||||||
| } | ||||||
| var tickmode = coerce(prefix + 'tickmode', tickmodeDefault); | ||||||
|
|
||||||
| if(tickmode === 'auto' || tickmode === 'sync') { | ||||||
| if (tickmode === 'auto' || tickmode === 'sync') { | ||||||
| coerce(prefix + 'nticks'); | ||||||
| } else if(tickmode === 'linear') { | ||||||
| } else if (tickmode === 'linear') { | ||||||
| // dtick is usually a positive number, but there are some | ||||||
| // special strings available for log or date axes | ||||||
| // tick0 also has special logic | ||||||
| var dtick = cOut.dtick = cleanTicks.dtick( | ||||||
| _dtick, axType); | ||||||
| cOut.tick0 = cleanTicks.tick0( | ||||||
| _tick0, axType, containerOut.calendar, dtick); | ||||||
| } else if(axType !== 'multicategory') { | ||||||
| var dtick = (cOut.dtick = cleanTicks.dtick(_dtick, axType)); | ||||||
| cOut.tick0 = cleanTicks.tick0(_tick0, axType, containerOut.calendar, dtick); | ||||||
| } else if (axType !== 'multicategory') { | ||||||
| var tickvals = coerce(prefix + 'tickvals'); | ||||||
| if(tickvals === undefined) cOut.tickmode = 'auto'; | ||||||
| else if(!isMinor) coerce('ticktext'); | ||||||
| if (tickvals === undefined) cOut.tickmode = 'auto'; | ||||||
| else if (!isMinor) coerce('ticktext'); | ||||||
| } | ||||||
| }; | ||||||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6 Bytes
(100%)
test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-40 Bytes
(100%)
test/image/baselines/zorder-overlayed-subplots-multiple-traces-one-subplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,7 +103,8 @@ | |
| "yaxis2": { | ||
| "gridwidth": 2, | ||
| "side": "right", | ||
| "overlaying": "y" | ||
| "overlaying": "y", | ||
| "tickmode": "auto" | ||
| } | ||
| } | ||
| } | ||
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
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.
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.