8000 Merge pull request #2977 from plotly/polar-hole · plotly/plotly.js@2a667d0 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

src/plots/polar/constants.js

Lines changed: 3 additions & 3 deletions
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,

src/plots/polar/layout_attributes.js

Lines changed: 11 additions & 10 deletions
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',

src/plots/polar/layout_defaults.js

Lines changed: 1 addition & 0 deletions
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)
0