Skip to content

Commit d1c475e

Browse files
committed
more options
1 parent 9c45b4d commit d1c475e

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

src/plots/cartesian/axes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ function formatLog(ax, out, hover, extraPrecision, hideexp) {
19201920
} else if(dtChar0 === 'D') {
19211921
out.text =
19221922
ax.minorloglabels === 'exponential' ? Math.pow(10, x).toExponential(0) :
1923+
ax.minorloglabels === 'scientific' ? Math.pow(10, x).toExponential(0).replace(/e\+?/, 'x10<sup>') :
19231924
ax.minorloglabels === 'full value' ? Lib.numberFormat('0.1s')(Math.pow(10, x)) :
19241925
/* ax.minorloglabels === 'small digits' */ String(Math.round(Math.pow(10, Lib.mod(x, 1))));
19251926

src/plots/cartesian/layout_attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,12 +1138,13 @@ module.exports = {
11381138

11391139
minorloglabels: {
11401140
valType: 'enumerated',
1141-
values: ['small digits', 'exponential', 'full value'],
1141+
values: ['small digits', 'scientific', 'exponential', 'full value'],
11421142
dflt: 'small digits',
11431143
editType: 'calc',
11441144
description: [
11451145
'Determines how minor log labels are displayed.',
11461146
'If *small digits*, small digits are displayed.',
1147+
'If *exponential*, exponential notation is applied.',
11471148
'If *exponential*, scientific notation is applied.',
11481149
'If *full value*, full values are displayed.',
11491150
].join(' ')

test/image/mocks/zz-minorloglabels.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
{
22
"data": [{
3+
"name": "small digits",
34
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
45
"y": [0, 1, 2, 3, 4, 5, 6]
56
}, {
7+
"name": "exponential",
68
"xaxis": "x2",
79
"yaxis": "y2",
810
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
911
"y": [0, 1, 2, 3, 4, 5, 6]
1012
}, {
13+
"name": "scientific",
1114
"xaxis": "x3",
1215
"yaxis": "y3",
1316
"x": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
1417
"y": [0, 1, 2, 3, 4, 5, 6]
18+
}, {
19+
"name": "full value",
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]
1524
}],
1625
"layout": {
1726
"grid": {
18-
"rows": 3,
27+
"rows": 4,
1928
"columns": 1,
2029
"xgap": 0.25,
2130
"ygap": 0.25,
@@ -30,10 +39,17 @@
3039
"minorloglabels": "exponential"
3140
},
3241
"xaxis3": {
42+
"type": "log",
43+
"minorloglabels": "scientific"
44+
},
45+
"xaxis4": {
3346
"type": "log",
3447
"minorloglabels": "full value"
3548
},
49+
"title": {
50+
"text": "options of minorloglabels"
51+
},
3652
"width": 1200,
37-
"height": 600
53+
"height": 800
3854
}
3955
}

test/plot-schema.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,12 +5196,13 @@
51965196
"valType": "number"
51975197
},
51985198
"minorloglabels": {
5199-
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
5199+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, exponential notation is applied. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
52005200
"dflt": "small digits",
52015201
"editType": "plot",
52025202
"valType": "enumerated",
52035203
"values": [
52045204
"small digits",
5205+
"scientific",
52055206
"exponential",
52065207
"full value"
52075208
]
@@ -5904,12 +5905,13 @@
59045905
"valType": "number"
59055906
},
59065907
"minorloglabels": {
5907-
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
5908+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, exponential notation is applied. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
59085909
"dflt": "small digits",
59095910
"editType": "plot",
59105911
"valType": "enumerated",
59115912
"values": [
59125913
"small digits",
5914+
"scientific",
59135915
"exponential",
59145916
"full value"
59155917
]
@@ -13928,12 +13930,13 @@
1392813930
}
1392913931
},
1393013932
"minorloglabels": {
13931-
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
13933+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, exponential notation is applied. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
1393213934
"dflt": "small digits",
1393313935
"editType": "calc",
1393413936
"valType": "enumerated",
1393513937
"values": [
1393613938
"small digits",
13939+
"scientific",
1393713940
"exponential",
1393813941
"full value"
1393913942
]
@@ -15500,12 +15503,13 @@
1550015503
}
1550115504
},
1550215505
"minorloglabels": {
15503-
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
15506+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed. If *exponential*, exponential notation is applied. If *exponential*, scientific notation is applied. If *full value*, full values are displayed.",
1550415507
"dflt": "small digits",
1550515508
"editType": "calc",
1550615509
"valType": "enumerated",
1550715510
"values": [
1550815511
"small digits",
15512+
"scientific",
1550915513
"exponential",
1551015514
"full value"
1551115515
]

0 commit comments

Comments
 (0)