Skip to content

Commit 84e74fc

Browse files
committed
revise options
1 parent 6a1750a commit 84e74fc

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

src/plots/cartesian/axes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ function formatLog(ax, out, hover, extraPrecision, hideexp) {
18991899

19001900
if(tickformat || (dtChar0 === 'L')) {
19011901
out.text = numFormat(Math.pow(10, x), ax, hideexp, extraPrecision);
1902-
} else if(isNumeric(dtick) || ((dtChar0 === 'D') && (Lib.mod(x + 0.01, 1) < 0.1))) {
1902+
} else if(isNumeric(dtick) || ((dtChar0 === 'D') && (Lib.mod(x + 0.01, 1) < 0.1 || ax.minorloglabels === 'complete'))) {
19031903
var p = Math.round(x);
19041904
var absP = Math.abs(p);
19051905
var exponentFormat = ax.exponentformat;
@@ -1919,9 +1919,7 @@ function formatLog(ax, out, hover, extraPrecision, hideexp) {
19191919
}
19201920
} else if(dtChar0 === 'D') {
19211921
out.text =
1922-
ax.minorloglabels === 'exponential' ? Math.pow(10, x).toExponential(0) :
1923-
ax.minorloglabels === 'scientific' ? Math.pow(10, x).toExponential(0).replace(/e\+?/, 'x10<sup>') :
1924-
ax.minorloglabels === 'metric' ? Lib.numberFormat('0.1s')(Math.pow(10, x)) :
1922+
ax.minorloglabels === 'none' ? '' :
19251923
/* ax.minorloglabels === 'small digits' */ String(Math.round(Math.pow(10, Lib.mod(x, 1))));
19261924

19271925
out.fontSize *= 0.75;

src/plots/cartesian/layout_attributes.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,15 +1138,14 @@ module.exports = {
11381138

11391139
minorloglabels: {
11401140
valType: 'enumerated',
1141-
values: ['small digits', 'exponential', 'scientific', 'metric'],
1142-
dflt: 'small digits',
1141+
values: ['small digits', 'complete', 'none'],
1142+
dflt: 'metric',
11431143
editType: 'calc',
11441144
description: [
11451145
'Determines how minor log labels are displayed.',
11461146
'If *small digits*, small digits i.e. 2 or 5 are displayed.',
1147-
'If *exponential*, exponential notation is applied.',
1148-
'If *scientific*, scientific notation is applied.',
1149-
'If *metric*, SI-prefix with one significant digits are displayed.',
1147+
'If *complete*, complete digits are displayed.',
1148+
'If *none*, no labels are displayed.',
11501149
].join(' ')
11511150
},
11521151

test/image/mocks/zz-minorloglabels.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,21 @@
44
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
55
"y": [0, 1, 2, 3, 4, 5, 6]
66
}, {
7-
"name": "exponential",
7+
"name": "complete",
88
"xaxis": "x2",
99
"yaxis": "y2",
1010
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
1111
"y": [0, 1, 2, 3, 4, 5, 6]
1212
}, {
13-
"name": "scientific",
13+
"name": "none",
1414
"xaxis": "x3",
1515
"yaxis": "y3",
1616
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
1717
"y": [0, 1, 2, 3, 4, 5, 6]
18-
}, {
19-
"name": "metric",
20-
"xaxis": "x4",
21-
"yaxis": "y4",
22-
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
23-
"y": [0, 1, 2, 3, 4, 5, 6]
2418
}],
2519
"layout": {
2620
"grid": {
27-
"rows": 4,
21+
"rows": 3,
2822
"columns": 1,
2923
"xgap": 0.25,
3024
"ygap": 0.25,
@@ -36,20 +30,16 @@
3630
},
3731
"xaxis2": {
3832
"type": "log",
39-
"minorloglabels": "exponential"
33+
"minorloglabels": "complete"
4034
},
4135
"xaxis3": {
4236
"type": "log",
43-
"minorloglabels": "scientific"
44-
},
45-
"xaxis4": {
46-
"type": "log",
47-
"minorloglabels": "metric"
37+
"minorloglabels": "none"
4838
},
4939
"title": {
5040
"text": "options of minorloglabels"
5141
},
5242
"width": 1200,
53-
"height": 800
43+
"height": 600
5444
}
5545
}

0 commit comments

Comments
 (0)