Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0b254e7

Browse filesBrowse files
committed
remove one unnecessary check - improve tests
1 parent 15b002a commit 0b254e7
Copy full SHA for 0b254e7

File tree

Expand file treeCollapse file tree

5 files changed

+98
-12
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+98
-12
lines changed

‎src/plots/cartesian/autorange.js

Copy file name to clipboardExpand all lines: src/plots/cartesian/autorange.js
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,12 @@ function makePadFn(fullLayout, ax, max) {
226226
var A = 0;
227227
var B = 0;
228228
if(!isLinked(fullLayout, ax._id)) {
229+
A = padInsideLabelsOnAnchorAxis(ax, max);
229230
if(
230-
ax.rangemode !== 'tozero' &&
231-
ax.rangemode !== 'nonnegative'
231+
anchorAxis.rangemode !== 'tozero' &&
232+
anchorAxis.rangemode !== 'nonnegative'
232233
) {
233-
A = padInsideLabelsOnAnchorAxis(ax, max);
234-
if(
235-
anchorAxis.rangemode !== 'tozero' &&
236-
anchorAxis.rangemode !== 'nonnegative'
237-
) {
238-
B = padInsideLabelsOnThisAxis(ax, max);
239-
}
234+
B = padInsideLabelsOnThisAxis(ax, max);
240235
}
241236
}
242237

-57.9 KB
Loading
74.7 KB
Loading

‎test/image/mocks/ticklabelposition-5.json

Copy file name to clipboardExpand all lines: test/image/mocks/ticklabelposition-5.json
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"gridcolor": "white"
163163
},
164164
"yaxis4": {
165+
"autorange": "reversed",
165166
"rangemode": "nonnegative",
166167
"anchor": "x4",
167168
"domain": [0.525, 1],
@@ -170,12 +171,12 @@
170171
"gridcolor": "white"
171172
},
172173
"font": {
173-
"size": 24
174+
"size": 16
174175
},
175176
"plot_bgcolor": "lightblue",
176177
"showlegend": false,
177-
"width": 1000,
178-
"height": 1000,
178+
"width": 800,
179+
"height": 800,
179180
"margin": {
180181
"t": 40,
181182
"b": 40,
+90Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"data": [{
3+
"xaxis": "x",
4+
"yaxis": "y",
5+
"orientation": "h",
6+
"x": [0.4, 0.5, 0.6, 0.7, 0.8],
7+
"y": ["Oo", "Pp", "Qq", "Rr", "Ss"]
8+
}, {
9+
"xaxis": "x2",
10+
"yaxis": "y2",
11+
"orientation": "h",
12+
"x": [0.4, 0.5, 0.6, 0.7, 0.8],
13+
"y": ["Oo", "Pp", "Qq", "Rr", "Ss"]
14+
}, {
15+
"xaxis": "x3",
16+
"yaxis": "y3",
17+
"orientation": "v",
18+
"y": [0.4, 0.5, 0.6, 0.7, 0.8],
19+
"x": ["Oo", "Pp", "Qq", "Rr", "Ss"]
20+
}, {
21+
"xaxis": "x4",
22+
"yaxis": "y4",
23+
"orientation": "v",
24+
"y": [0.4, 0.5, 0.6, 0.7, 0.8],
25+
"x": ["Oo", "Pp", "Qq", "Rr", "Ss"]
26+
}],
27+
"layout": {
28+
"xaxis": {
29+
"rangemode": "nonnegative",
30+
"anchor": "y",
31+
"domain": [0, 0.475],
32+
"gridcolor": "white"
33+
},
34+
"yaxis": {
35+
"anchor": "x",
36+
"domain": [0, 0.475],
37+
"ticklabelposition": "inside",
38+
"gridcolor": "white"
39+
},
40+
"xaxis2": {
41+
"rangemode": "tozero",
42+
"anchor": "y2",
43+
"domain": [0.525, 1],
44+
"gridcolor": "white"
45+
},
46+
"yaxis2": {
47+
"anchor": "x2",
48+
"domain": [0, 0.475],
49+
"ticklabelposition": "inside",
50+
"gridcolor": "white"
51+
},
52+
"xaxis3": {
53+
"anchor": "y3",
54+
"domain": [0.525, 1],
55+
"ticklabelposition": "inside",
56+
"gridcolor": "white"
57+
},
58+
"yaxis3": {
59+
"rangemode": "nonnegative",
60+
"anchor": "x3",
61+
"domain": [0.525, 1],
62+
"gridcolor": "white"
63+
},
64+
"xaxis4": {
65+
"anchor": "y4",
66+
"domain": [0, 0.475],
67+
"ticklabelposition": "inside",
68+
"gridcolor": "white"
69+
},
70+
"yaxis4": {
71+
"rangemode": "tozero",
72+
"anchor": "x4",
73+
"domain": [0.525, 1],
74+
"gridcolor": "white"
75+
},
76+
"font": {
77+
"size": 20
78+
},
79+
"plot_bgcolor": "lightblue",
80+
"showlegend": false,
81+
"width": 800,
82+
"height": 800,
83+
"margin": {
84+
"t": 40,
85+
"b": 40,
86+
"l": 40,
87+
"r": 40
88+
}
89+
}
90+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.