Skip to content

Commit 392ca46

Browse files
committed
introduce new attribute for log axes
1 parent 5e2163b commit 392ca46

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

src/plots/cartesian/layout_attributes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,17 @@ module.exports = {
768768
'and values (if desired) can include html-like tags or MathJax.'
769769
].join(' ')
770770
},
771+
loglabels: {
772+
valType: 'enumerated',
773+
values: ['small digits', 'full value'],
774+
dflt: 'small digits',
775+
editType: 'calc',
776+
description: [
777+
'Determines how minor log labels are displayed.',
778+
'If *small digits*, small digits are displayed for minor ticks.',
779+
'If *full value*, full values are displayed for minor ticks.',
780+
].join(' ')
781+
},
771782
automargin: {
772783
valType: 'flaglist',
773784
flags: ['height', 'width', 'left', 'right', 'top', 'bottom'],

src/plots/cartesian/tick_label_defaults.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
7070
coerce('separatethousands');
7171
}
7272
}
73+
74+
if(!options.noLoglabels && axType === 'log') {
75+
coerce('loglabels');
76+
}
7377
}
7478
};
7579

src/plots/gl3d/layout/axis_defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
4242
data: options.data,
4343
showGrid: true,
4444
noAutotickangles: true,
45+
noLoglabels: true,
4546
noTicklabelindex: true,
4647
noTickson: true,
4748
noTicklabelmode: true,

src/plots/polar/layout_attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var axisTickAttrs = overrideAll({
3636
ticklabelstep: axesAttrs.ticklabelstep,
3737
showticklabels: axesAttrs.showticklabels,
3838
labelalias: axesAttrs.labelalias,
39+
loglabels: axesAttrs.loglabels,
3940
showtickprefix: axesAttrs.showtickprefix,
4041
tickprefix: axesAttrs.tickprefix,
4142
showticksuffix: axesAttrs.showticksuffix,

test/plot-schema.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5188,6 +5188,16 @@
51885188
"min": 0,
51895189
"valType": "number"
51905190
},
5191+
"loglabels": {
5192+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed for minor ticks. If *full value*, full values are displayed for minor ticks.",
5193+
"dflt": "small digits",
5194+
"editType": "plot",
5195+
"valType": "enumerated",
5196+
"values": [
5197+
"small digits",
5198+
"full value"
5199+
]
5200+
},
51915201
"minexponent": {
51925202
"description": "Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is *SI* or *B*.",
51935203
"dflt": 3,
@@ -5869,6 +5879,16 @@
58695879
"min": 0,
58705880
"valType": "number"
58715881
},
5882+
"loglabels": {
5883+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed for minor ticks. If *full value*, full values are displayed for minor ticks.",
5884+
"dflt": "small digits",
5885+
"editType": "plot",
5886+
"valType": "enumerated",
5887+
"values": [
5888+
"small digits",
5889+
"full value"
5890+
]
5891+
},
58725892
"maxallowed": {
58735893
"description": "Determines the maximum range of this axis.",
58745894
"editType": "plot",
@@ -13766,6 +13786,16 @@
1376613786
"min": 0,
1376713787
"valType": "number"
1376813788
},
13789+
"loglabels": {
13790+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed for minor ticks. If *full value*, full values are displayed for minor ticks.",
13791+
"dflt": "small digits",
13792+
"editType": "calc",
13793+
"valType": "enumerated",
13794+
"values": [
13795+
"small digits",
13796+
"full value"
13797+
]
13798+
},
1376913799
"matches": {
1377013800
"description": "If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`.",
1377113801
"editType": "calc",
@@ -15327,6 +15357,16 @@
1532715357
"min": 0,
1532815358
"valType": "number"
1532915359
},
15360+
"loglabels": {
15361+
"description": "Determines how minor log labels are displayed. If *small digits*, small digits are displayed for minor ticks. If *full value*, full values are displayed for minor ticks.",
15362+
"dflt": "small digits",
15363+
"editType": "calc",
15364+
"valType": "enumerated",
15365+
"values": [
15366+
"small digits",
15367+
"full value"
15368+
]
15369+
},
1533015370
"matches": {
1533115371
"description": "If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`.",
1533215372
"editType": "calc",

0 commit comments

Comments
 (0)