Skip to content

Commit 3a953db

Browse files
committed
coerce tickson,
... only on `type: 'category'` cartesian axes with visible ticks and/or grid lines.
1 parent 695f311 commit 3a953db

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

src/components/colorbar/draw.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ module.exports = function draw(gd, id) {
198198
letter: 'y',
199199
font: fullLayout.font,
200200
noHover: true,
201+
noTickson: true,
201202
calendar: fullLayout.calendar // not really necessary (yet?)
202203
};
203204

src/plots/cartesian/axis_defaults.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var setConvert = require('./set_convert');
2828
* outerTicks: boolean, should ticks default to outside?
2929
* showGrid: boolean, should gridlines be shown by default?
3030
* noHover: boolean, this axis doesn't support hover effects?
31+
* noTickson: boolean, this axis doesn't support 'tickson'
3132
* data: the plot data, used to manage categories
3233
* bgColor: the plot background color, to calculate default gridline colors
3334
*/
@@ -89,5 +90,10 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
8990

9091
if(options.automargin) coerce('automargin');
9192

93+
if(!options.noTickson &&
94+
containerOut.type === 'category' && (containerOut.ticks || containerOut.showgrid)) {
95+
coerce('tickson');
96+
}
97+
9298
return containerOut;
9399
};

src/plots/cartesian/layout_attributes.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ module.exports = {
304304
'the axis lines.'
305305
].join(' ')
306306
},
307+
tickson: {
308+
valType: 'enumerated',
309+
values: ['labels', 'boundaries'],
310+
role: 'info',
311+
editType: 'ticks',
312+
description: [
313+
'Determines where ticks and grid lines are drawn with respect to their',
314+
'corresponding tick labels.',
315+
'Only has an effect for axes of `type` *category*.',
316+
'When set to *boundaries*, ticks and grid lines are drawn half a category',
317+
'to the left/bottom of labels.'
318+
].join(' ')
319+
},
307320
mirror: {
308321
valType: 'enumerated',
309322
values: [true, 'ticks', false, 'all', 'allticks'],

src/plots/gl3d/layout/axis_defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
5050
letter: axName[0],
5151
data: options.data,
5252
showGrid: true,
53+
noTickson: true,
5354
bgColor: options.bgColor,
5455
calendar: options.calendar
5556
},

0 commit comments

Comments
 (0)