Skip to content

Commit a26b56f

Browse files
committedJun 19, 2018
replace 'usepolygons' -> gridshape: 'linear'
1 parent a0a62af commit a26b56f

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed
 

‎src/plots/polar/layout_attributes.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,15 @@ module.exports = {
267267
radialaxis: radialAxisAttrs,
268268
angularaxis: angularAxisAttrs,
269269

270-
usepolygons: {
271-
valType: 'boolean',
270+
gridshape: {
271+
valType: 'enumerated',
272+
values: ['circular', 'linear'],
273+
dflt: 'circular',
272274
role: 'style',
273275
editType: 'plot',
274-
dflt: false,
275276
description: [
276-
'...',
277+
'Determines if the radial axis grid lines and angular axis line are drawn',
278+
'as *circular* sectors or as *linear* (polygon) sectors.',
277279
'Has an effect only when the angular axis has `type` *category*.',
278280
'Note that `radialaxis.angle` is snapped to the angle of the closest',
279281
'vertex (so that radial axis scale is the same as the data scale).'

‎src/plots/polar/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
179179
}
180180

181181
if(contOut.angularaxis.type === 'category') {
182-
coerce('usepolygons');
182+
coerce('gridshape');
183183
}
184184
}
185185

‎src/plots/polar/polar.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
534534

535535
// angle of polygon vertices in radians (null means circles)
536536
// TODO what to do when ax.period > ax._categories ??
537-
_this.vangles = polarLayout.usepolygons ? ax._vals.map(c2rad) : null;
537+
_this.vangles = polarLayout.gridshape === 'linear' ?
538+
ax._vals.map(c2rad) :
539+
null;
538540

539541
updateElement(layers['angular-line'].select('path'), angularLayout.showline, {
540542
d: pathSectorClosed(radius, sector, _this.vangles),
@@ -1303,8 +1305,8 @@ function pathSector(r, sector, vangles) {
13031305
return d;
13041306
}
13051307

1306-
function pathSectorClosed(r, sector, nside) {
1307-
return pathSector(r, sector, nside) +
1308+
function pathSectorClosed(r, sector, vangles) {
1309+
return pathSector(r, sector, vangles) +
13081310
(isFullCircle(sector) ? '' : 'L0,0Z');
13091311
}
13101312

‎test/image/mocks/polar_polygon-grids.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
],
4343
"layout": {
4444
"polar": {
45-
"usepolygons": true,
45+
"gridshape": "linear",
4646
"domain": {
4747
"x": [0, 0.46],
4848
"y": [0.56, 1]
@@ -57,7 +57,7 @@
5757
}
5858
},
5959
"polar2": {
60-
"usepolygons": true,
60+
"gridshape": "linear",
6161
"domain": {
6262
"x": [0, 0.46],
6363
"y": [0, 0.44]
@@ -67,7 +67,7 @@
6767
}
6868
},
6969
"polar3": {
70-
"usepolygons": true,
70+
"gridshape": "linear",
7171
"domain": {
7272
"x": [0.54, 1],
7373
"y": [0.56, 1]
@@ -83,7 +83,7 @@
8383
}
8484
},
8585
"polar4": {
86-
"usepolygons": true,
86+
"gridshape": "linear",
8787
"bgcolor": "#d3d3d3",
8888
"domain": {
8989
"x": [0.54, 1],

0 commit comments

Comments
 (0)
Please sign in to comment.