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 2a745de

Browse filesBrowse files
committed
adapt polar to new per trace/item _extremes
- N.B. polar is the only subplot apart from cartesian that used Axes.expand and friends.
1 parent 8cd06ae commit 2a745de
Copy full SHA for 2a745de

File tree

Expand file treeCollapse file tree

4 files changed

+7
-18
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-18
lines changed

‎src/plots/polar/layout_defaults.js

Copy file name to clipboardExpand all lines: src/plots/polar/layout_defaults.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ function handleDefaults(contIn, contOut, coerce, opts) {
8080
// Furthermore, angular axes don't have a set range.
8181
//
8282
// Mocked domains and ranges are set by the polar subplot instances,
83-
// but Axes.expand uses the sign of _m to determine which padding value
83+
// but Axes.findExtremes uses the sign of _m to determine which padding value
8484
// to use.
8585
//
86-
// By setting, _m to 1 here, we make Axes.expand think that range[1] > range[0],
87-
// and vice-versa for `autorange: 'reversed'` below.
86+
// By setting, _m to 1 here, we make Axes.findExtremes think that
87+
// range[1] > range[0], and vice-versa for `autorange: 'reversed'` below.
8888
axOut._m = 1;
8989

9090
switch(axName) {

‎src/plots/polar/polar.js

Copy file name to clipboardExpand all lines: src/plots/polar/polar.js
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,10 @@ proto.updateLayout = function(fullLayout, polarLayout) {
300300
proto.doAutoRange = function(fullLayout, polarLayout) {
301301
var radialLayout = polarLayout.radialaxis;
302302
var ax = this.radialAxis;
303+
ax._subplot = this.id;
303304

304305
setScale(ax, radialLayout, fullLayout);
305-
doAutoRange(ax);
306+
doAutoRange(this.gd, ax);
306307

307308
radialLayout.range = ax.range.slice();
308309
radialLayout._input.range = ax.range.slice();
@@ -1207,12 +1208,6 @@ proto.fillViewInitialKey = function(key, val) {
12071208

12081209
function setScale(ax, axLayout, fullLayout) {
12091210
Axes.setConvert(ax, fullLayout);
1210-
1211-
// _min and _max are filled in during Axes.expand
1212-
// and cleared during Axes.setConvert
1213-
ax._min = axLayout._min;
1214-
ax._max = axLayout._max;
1215-
12161211
ax.setScale();
12171212
}
12181213

‎src/traces/scatterpolar/calc.js

Copy file name to clipboardExpand all lines: src/traces/scatterpolar/calc.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = function calc(gd, trace) {
4848
}
4949

5050
var ppad = calcMarkerSize(trace, len);
51-
Axes.expand(radialAxis, rArray, {ppad: ppad});
51+
trace._extremes.radialaxis = Axes.findExtremes(radialAxis, rArray, {ppad: ppad});
5252

5353
calcColorscale(trace);
5454
arraysToCalcdata(cd, trace);

‎src/traces/scatterpolargl/index.js

Copy file name to clipboardExpand all lines: src/traces/scatterpolargl/index.js
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ function calc(container, trace) {
3636
stash.r = rArray;
3737
stash.theta = thetaArray;
3838

39-
Axes.expand(radialAxis, rArray, {tozero: true});
40-
41-
if(angularAxis.type !== 'linear') {
42-
angularAxis.autorange = true;
43-
Axes.expand(angularAxis, thetaArray);
44-
delete angularAxis.autorange;
45-
}
39+
trace._extremes.radialaxis = Axes.findExtremes(radialAxis, rArray, {tozero: true});
4640

4741
return [{x: false, y: false, t: stash, trace: trace}];
4842
}

0 commit comments

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