Skip to content

Commit 9f3e1db

Browse files
committed
use instant key instead of an empty string
1 parent 4292f08 commit 9f3e1db

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
681681
ax._prevDateHead = '';
682682
ax._inCalcTicks = true;
683683

684+
var isPeriod = ax.ticklabelmode === 'period';
685+
684686
var ticksOut = new Array(tickVals.length);
685687
for(var i = 0; i < tickVals.length; i++) {
686688
var _minor = tickVals[i].minor;
@@ -693,7 +695,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
693695
_minor // noSuffixPrefix
694696
);
695697

696-
if(ax.ticklabelmode) {
698+
if(isPeriod) {
697699
ticksOut[i].periodX = i ? (
698700
tickVals[i].value +
699701
tickVals[i - 1].value
@@ -1792,7 +1794,7 @@ axes.drawOne = function(gd, ax, opts) {
17921794
if(!ax.visible) return;
17931795

17941796
var transFn = axes.makeTransFn(ax);
1795-
var transTickLabelFn = ax.ticklabelmode ?
1797+
var transTickLabelFn = ax.ticklabelmode === 'period' ?
17961798
axes.makeTransPeriodFn(ax) :
17971799
axes.makeTransFn(ax);
17981800

@@ -2532,7 +2534,7 @@ axes.drawLabels = function(gd, ax, opts) {
25322534
var vals = opts.vals;
25332535
if(
25342536
ax.showticklabels &&
2535-
ax.ticklabelmode // === 'period'
2537+
ax.ticklabelmode === 'period'
25362538
) {
25372539
vals = vals.slice();
25382540
vals.shift();

src/plots/cartesian/layout_attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ module.exports = {
480480
},
481481
ticklabelmode: {
482482
valType: 'enumerated',
483-
values: ['', 'period'],
484-
dflt: '',
483+
values: ['instant', 'period'],
484+
dflt: 'instant',
485485
role: 'info',
486486
editType: 'ticks',
487487
description: [

0 commit comments

Comments
 (0)