Skip to content

Commit 2676d24

Browse files
committed
rename attribute to skipticklabels and update description
1 parent 3b259ed commit 2676d24

File tree

18 files changed

+341
-337
lines changed

18 files changed

+341
-337
lines changed

draftlogs/6088_add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Implement `skipticklabels` on 2D axes & colorbars [[#6088](https://github.com/plotly/plotly.js/pull/6088)]

src/components/colorbar/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ module.exports = overrideAll({
166166
ticklen: axesAttrs.ticklen,
167167
tickwidth: axesAttrs.tickwidth,
168168
tickcolor: axesAttrs.tickcolor,
169-
ticklabeljump: axesAttrs.ticklabeljump,
169+
skipticklabels: axesAttrs.skipticklabels,
170170
showticklabels: axesAttrs.showticklabels,
171171
tickfont: fontAttrs({
172172
description: 'Sets the color bar\'s tick label font'

src/components/colorbar/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ function mockColorBarAxis(gd, opts, zrange) {
933933
showticklabels: opts.showticklabels,
934934
ticklabelposition: opts.ticklabelposition,
935935
ticklabeloverflow: opts.ticklabeloverflow,
936-
ticklabeljump: opts.ticklabeljump,
936+
skipticklabels: opts.skipticklabels,
937937
tickfont: opts.tickfont,
938938
tickangle: opts.tickangle,
939939
tickformat: opts.tickformat,

src/plots/cartesian/axes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
835835
x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
836836
}
837837

838-
var ticklabeljump = ax.ticklabeljump;
838+
var skipticklabels = ax.skipticklabels;
839839

840840
var maxTicks = Math.max(1000, ax._length || 0);
841841
var tickVals = [];
@@ -876,7 +876,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
876876
value: x
877877
};
878878

879-
if(ticklabeljump && (id % (ticklabeljump + 1))) {
879+
if(skipticklabels && (id % (skipticklabels + 1))) {
880880
obj.jumpLabel = true;
881881
}
882882

@@ -2990,7 +2990,7 @@ axes.drawLabels = function(gd, ax, opts) {
29902990
var axLetter = axId.charAt(0);
29912991
var cls = opts.cls || axId + 'tick';
29922992

2993-
var vals = ax.ticklabeljump ?
2993+
var vals = ax.skipticklabels ?
29942994
opts.vals.filter(function(d) { return !d.jumpLabel; }) :
29952995
opts.vals;
29962996

src/plots/cartesian/layout_attributes.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,17 @@ module.exports = {
412412
'To set ticks every 4 years, set `dtick` to *M48*'
413413
].join(' ')
414414
},
415-
ticklabeljump: {
415+
skipticklabels: {
416416
valType: 'integer',
417417
min: 0,
418418
dflt: 0,
419419
editType: 'ticks',
420420
description: [
421-
'Sets the step between ticklabels.',
422-
'Could be used to hide labels between every n-th ticks.'
421+
'Sets the spacing between tick labels as compared to the spacing between ticks.',
422+
'A value of 0 (default) means each tick gets a label.',
423+
'A value of 1 means shows every 2nd level.',
424+
'A larger value n means only every (n+1)th tick is labeled.',
425+
'`tick0` determines which labels are shown.'
423426
].join(' ')
424427
},
425428
tickvals: {

src/plots/cartesian/tick_label_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
2828
color: dfltFontColor
2929
});
3030

31-
if(!options.noTicklabeljump) coerce('ticklabeljump');
31+
if(!options.noskipticklabels) coerce('skipticklabels');
3232

3333
if(!options.noAng) coerce('tickangle');
3434

src/plots/gl3d/layout/axis_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
4343
showGrid: true,
4444
noTickson: true,
4545
noTicklabelmode: true,
46-
noTicklabeljump: true,
46+
noskipticklabels: true,
4747
noTicklabelposition: true,
4848
noTicklabeloverflow: true,
4949
bgColor: options.bgColor,

src/plots/polar/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var axisTickAttrs = overrideAll({
3232
ticklen: axesAttrs.ticklen,
3333
tickwidth: axesAttrs.tickwidth,
3434
tickcolor: axesAttrs.tickcolor,
35-
ticklabeljump: axesAttrs.ticklabeljump,
35+
skipticklabels: axesAttrs.skipticklabels,
3636
showticklabels: axesAttrs.showticklabels,
3737
showtickprefix: axesAttrs.showtickprefix,
3838
tickprefix: axesAttrs.tickprefix,

src/plots/smith/layout_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
8383
}
8484

8585
handleTickLabelDefaults(axIn, axOut, coerceAxis, axOut.type, {
86-
noTicklabeljump: true,
86+
noskipticklabels: true,
8787
noAng: !isRealAxis,
8888
noExp: true,
8989
font: {

src/plots/ternary/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var ternaryAxesAttrs = {
2525
ticklen: axesAttrs.ticklen,
2626
tickwidth: axesAttrs.tickwidth,
2727
tickcolor: axesAttrs.tickcolor,
28-
ticklabeljump: axesAttrs.ticklabeljump,
28+
skipticklabels: axesAttrs.skipticklabels,
2929
showticklabels: axesAttrs.showticklabels,
3030
showtickprefix: axesAttrs.showtickprefix,
3131
tickprefix: axesAttrs.tickprefix,

0 commit comments

Comments
 (0)