Skip to content

Commit 9c3dcef

Browse files
committed
draw polar axis ticks above axis lines
- this is on-par with how cartesian draw things. - update baselines - update layer order jasmine tests now that axis lines are below ticks
1 parent 776e292 commit 9c3dcef

27 files changed

+13
-16
lines changed

src/plots/polar/constants.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ module.exports = {
2222
'angular-grid',
2323
'radial-grid',
2424
'frontplot',
25-
'angular-axis',
26-
'radial-axis',
27-
// TODO hmm, putting angular-line above radial-axis
28-
// can sometimes hide radial ticks and label
29-
// this happens especially for the 'inner' angular axis
3025
'angular-line',
31-
'radial-line'
26+
'radial-line',
27+
'angular-axis',
28+
'radial-axis'
3229
],
3330

3431
radialDragBoxSize: 50,

src/plots/polar/polar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ proto.updateLayers = function(fullLayout, polarLayout) {
104104
var isAngularAxisBelowTraces = angularLayout.layer === 'below traces';
105105
var isRadialAxisBelowTraces = radialLayout.layer === 'below traces';
106106

107-
if(isAngularAxisBelowTraces) layerData.push('angular-axis');
108-
if(isRadialAxisBelowTraces) layerData.push('radial-axis');
109107
if(isAngularAxisBelowTraces) layerData.push('angular-line');
110108
if(isRadialAxisBelowTraces) layerData.push('radial-line');
109+
if(isAngularAxisBelowTraces) layerData.push('angular-axis');
110+
if(isRadialAxisBelowTraces) layerData.push('radial-axis');
111111

112112
layerData.push('frontplot');
113113

114-
if(!isAngularAxisBelowTraces) layerData.push('angular-axis');
115-
if(!isRadialAxisBelowTraces) layerData.push('radial-axis');
116114
if(!isAngularAxisBelowTraces) layerData.push('angular-line');
117115
if(!isRadialAxisBelowTraces) layerData.push('radial-line');
116+
if(!isAngularAxisBelowTraces) layerData.push('angular-axis');
117+
if(!isRadialAxisBelowTraces) layerData.push('radial-axis');
118118

119119
var join = _this.framework.selectAll('.polarsublayer')
120120
.data(layerData, String);
-16 Bytes
Loading
31 Bytes
Loading
213 Bytes
Loading
28 Bytes
Loading
11 Bytes
Loading
Loading

test/image/baselines/polar_blank.png

-8 Bytes
Loading
-119 Bytes
Loading

test/image/baselines/polar_dates.png

-4 Bytes
Loading
-158 Bytes
Loading

test/image/baselines/polar_fills.png

-30 Bytes
Loading
-20 Bytes
Loading

test/image/baselines/polar_hole.png

19 Bytes
Loading

test/image/baselines/polar_line.png

-47 Bytes
Loading
14 Bytes
Loading
15 Bytes
Loading
10 Bytes
Loading
3 Bytes
Loading
-78 Bytes
Loading

test/image/baselines/polar_sector.png

-10 Bytes
Loading
208 Bytes
Loading

test/image/baselines/polar_ticks.png

-187 Bytes
Loading
4 Bytes
Loading
39 Bytes
Loading

test/jasmine/tests/polar_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,29 +236,29 @@ describe('Test relayout on polar subplots:', function() {
236236
.then(function() {
237237
_assert([
238238
'draglayer', 'plotbg', 'backplot', 'angular-grid', 'radial-grid',
239-
'radial-axis', 'radial-line',
239+
'radial-line', 'radial-axis',
240240
'frontplot',
241-
'angular-axis', 'angular-line'
241+
'angular-line', 'angular-axis'
242242
]);
243243
return Plotly.relayout(gd, 'polar.angularaxis.layer', 'below traces');
244244
})
245245
.then(function() {
246246
_assert([
247247
'draglayer', 'plotbg', 'backplot', 'angular-grid', 'radial-grid',
248-
'angular-axis',
249-
'radial-axis',
250248
'angular-line',
251249
'radial-line',
250+
'angular-axis',
251+
'radial-axis',
252252
'frontplot'
253253
]);
254254
return Plotly.relayout(gd, 'polar.radialaxis.layer', 'above traces');
255255
})
256256
.then(function() {
257257
_assert([
258258
'draglayer', 'plotbg', 'backplot', 'angular-grid', 'radial-grid',
259-
'angular-axis', 'angular-line',
259+
'angular-line', 'angular-axis',
260260
'frontplot',
261-
'radial-axis', 'radial-line'
261+
'radial-line', 'radial-axis'
262262
]);
263263
return Plotly.relayout(gd, 'polar.angularaxis.layer', null);
264264
})

0 commit comments

Comments
 (0)