Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 16d792c

Browse files
committedJul 8, 2024··
Add constant ONEMILLI
for enhanced clarity of function `periodCompatibleWithTickformat`
1 parent a580821 commit 16d792c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎src/constants/numerical.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = {
3737
ONEHOUR: 3600000,
3838
ONEMIN: 60000,
3939
ONESEC: 1000,
40+
ONEMILLI: 1,
4041
ONEMICROSEC: 0.001,
4142
/*
4243
* For fast conversion btwn world calendars and epoch ms, the Julian Day Number

‎src/plots/cartesian/axes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var HALFDAY = ONEDAY / 2;
3131
var ONEHOUR = constants.ONEHOUR;
3232
var ONEMIN = constants.ONEMIN;
3333
var ONESEC = constants.ONESEC;
34+
var ONEMILLI = constants.ONEMILLI;
3435
var ONEMICROSEC = constants.ONEMICROSEC;
3536
var MINUS_SIGN = constants.MINUS_SIGN;
3637
var BADNUM = constants.BADNUM;
@@ -4607,7 +4608,7 @@ function setShiftVal(ax, axShifts) {
46074608
function periodCompatibleWithTickformat(period, tickformat) {
46084609
return (
46094610
/%f/.test(tickformat) ? period >= ONEMICROSEC :
4610-
/%L/.test(tickformat) ? period >= 1 :
4611+
/%L/.test(tickformat) ? period >= ONEMILLI :
46114612
/%[SX]/.test(tickformat) ? period >= ONESEC :
46124613
/%M/.test(tickformat) ? period >= ONEMIN :
46134614
/%[HI]/.test(tickformat) ? period >= ONEHOUR :

0 commit comments

Comments
 (0)
Please sign in to comment.