Skip to content

Commit

Permalink
Merge pull request #2977 from plotly/polar-hole
Browse files Browse the repository at this point in the history
Add `polar.hole`
  • Loading branch information
etpinard authored Sep 10, 2018
2 parents 1b6c9a3 + 092006a commit 2a667d0
Show file tree
Hide file tree
Showing 33 changed files with 298 additions and 87 deletions.
6 changes: 3 additions & 3 deletions src/plots/polar/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ module.exports = {
'angular-grid',
'radial-grid',
'frontplot',
'angular-axis',
'radial-axis',
'angular-line',
'radial-line'
'radial-line',
'angular-axis',
'radial-axis'
],

radialDragBoxSize: 50,
Expand Down
21 changes: 11 additions & 10 deletions src/plots/polar/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ var radialAxisAttrs = {

hoverformat: axesAttrs.hoverformat,

// More attributes:

// We'll need some attribute that determines the span
// to draw donut-like charts
// e.g. https://github.com/matplotlib/matplotlib/issues/4217
//
// maybe something like 'span' or 'hole' (like pie, but pie set it in data coords?)
// span: {},
// hole: 1

editType: 'calc'
};

Expand Down Expand Up @@ -256,6 +246,17 @@ module.exports = {
'with *0* corresponding to rightmost limit of the polar subplot.'
].join(' ')
},
hole: {
valType: 'number',
min: 0,
max: 1,
dflt: 0,
editType: 'plot',
role: 'info',
description: [
'Sets the fraction of the radius to cut out of the polar subplot.'
].join(' ')
},

bgcolor: {
valType: 'color',
Expand Down
1 change: 1 addition & 0 deletions src/plots/polar/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
opts.bgColor = Color.combine(bgColor, opts.paper_bgcolor);

var sector = coerce('sector');
coerce('hole');

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

0 comments on commit 2a667d0

Please sign in to comment.