Skip to content

Commit edc166f

Browse files
authored
Merge pull request #2739 from plotly/polar-polygon-grids
Polar polygon grids
2 parents 6ac47ec + 1ca6508 commit edc166f

File tree

8 files changed

+1018
-182
lines changed

8 files changed

+1018
-182
lines changed

Diff for: src/plots/polar/layout_attributes.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ var radialAxisAttrs = {
122122
// span: {},
123123
// hole: 1
124124

125-
// maybe should add a boolean to enable square grid lines
126-
// and square axis lines
127-
// (most common in radar-like charts)
128-
// e.g. squareline/squaregrid or showline/showgrid: 'square' (on-top of true)
129-
130125
editType: 'calc'
131126
};
132127

@@ -272,6 +267,22 @@ module.exports = {
272267
radialaxis: radialAxisAttrs,
273268
angularaxis: angularAxisAttrs,
274269

270+
gridshape: {
271+
valType: 'enumerated',
272+
values: ['circular', 'linear'],
273+
dflt: 'circular',
274+
role: 'style',
275+
editType: 'plot',
276+
description: [
277+
'Determines if the radial axis grid lines and angular axis line are drawn',
278+
'as *circular* sectors or as *linear* (polygon) sectors.',
279+
'Has an effect only when the angular axis has `type` *category*.',
280+
'Note that `radialaxis.angle` is snapped to the angle of the closest',
281+
'vertex when `gridshape` is *circular*',
282+
'(so that radial axis scale is the same as the data scale).'
283+
].join(' ')
284+
},
285+
275286
// TODO maybe?
276287
// annotations:
277288

Diff for: src/plots/polar/layout_defaults.js

+4
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ function handleDefaults(contIn, contOut, coerce, opts) {
177177

178178
axOut._input = axIn;
179179
}
180+
181+
if(contOut.angularaxis.type === 'category') {
182+
coerce('gridshape');
183+
}
180184
}
181185

182186
function handleAxisTypeDefaults(axIn, axOut, coerce, subplotData, dataAttr) {

0 commit comments

Comments
 (0)