Skip to content

Commit c3f5b1b

Browse files
committed
first cut polar.usepolygons
- this adds polygons grid (and angular ax line) support to categorical angular axes - had to add 'polygon mode' to pathSector() and isPtWithinSector() - polygon vertices match the angular ticks - snaps radialaxis.angle to vertex angles - needed special care for sector and on angular drag
1 parent 33b05eb commit c3f5b1b

File tree

3 files changed

+217
-30
lines changed

3 files changed

+217
-30
lines changed

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

+13-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,19 @@ module.exports = {
272267
radialaxis: radialAxisAttrs,
273268
angularaxis: angularAxisAttrs,
274269

270+
usepolygons: {
271+
valType: 'boolean',
272+
role: 'style',
273+
editType: 'plot',
274+
dflt: false,
275+
description: [
276+
'...',
277+
'Has an effect only when the angular axis has `type` *category*.',
278+
'Note that `radialaxis.angle` is snapped to the angle of the closest',
279+
'vertex (so that radial axis scale is the same as the data scale).'
280+
].join(' ')
281+
},
282+
275283
// TODO maybe?
276284
// annotations:
277285

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('usepolygons');
183+
}
180184
}
181185

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

0 commit comments

Comments
 (0)