Skip to content

Commit 2a667d0

Browse files
authored
Merge pull request #2977 from plotly/polar-hole
Add `polar.hole`
2 parents 1b6c9a3 + 092006a commit 2a667d0

33 files changed

+298
-87
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ module.exports = {
2222
'angular-grid',
2323
'radial-grid',
2424
'frontplot',
25-
'angular-axis',
26-
'radial-axis',
2725
'angular-line',
28-
'radial-line'
26+
'radial-line',
27+
'angular-axis',
28+
'radial-axis'
2929
],
3030

3131
radialDragBoxSize: 50,

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

+11-10
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ var radialAxisAttrs = {
112112

113113
hoverformat: axesAttrs.hoverformat,
114114

115-
// More attributes:
116-
117-
// We'll need some attribute that determines the span
118-
// to draw donut-like charts
119-
// e.g. https://github.com/matplotlib/matplotlib/issues/4217
120-
//
121-
// maybe something like 'span' or 'hole' (like pie, but pie set it in data coords?)
122-
// span: {},
123-
// hole: 1
124-
125115
editType: 'calc'
126116
};
127117

@@ -256,6 +246,17 @@ module.exports = {
256246
'with *0* corresponding to rightmost limit of the polar subplot.'
257247
].join(' ')
258248
},
249+
hole: {
250+
valType: 'number',
251+
min: 0,
252+
max: 1,
253+
dflt: 0,
254+
editType: 'plot',
255+
role: 'info',
256+
description: [
257+
'Sets the fraction of the radius to cut out of the polar subplot.'
258+
].join(' ')
259+
},
259260

260261
bgcolor: {
261262
valType: 'color',

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

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
3030
opts.bgColor = Color.combine(bgColor, opts.paper_bgcolor);
3131

3232
var sector = coerce('sector');
33+
coerce('hole');
3334

3435
// could optimize, subplotData is not always needed!
3536
var subplotData = getSubplotData(opts.fullData, constants.name, opts.id);

0 commit comments

Comments
 (0)