Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polar polygon grids #2739

Merged
merged 20 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/plots/polar/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ var radialAxisAttrs = {
// span: {},
// hole: 1

// maybe should add a boolean to enable square grid lines
// and square axis lines
// (most common in radar-like charts)
// e.g. squareline/squaregrid or showline/showgrid: 'square' (on-top of true)

editType: 'calc'
};

Expand Down Expand Up @@ -272,6 +267,22 @@ module.exports = {
radialaxis: radialAxisAttrs,
angularaxis: angularAxisAttrs,

gridshape: {
valType: 'enumerated',
values: ['circular', 'linear'],
dflt: 'circular',
role: 'style',
editType: 'plot',
description: [
'Determines if the radial axis grid lines and angular axis line are drawn',
'as *circular* sectors or as *linear* (polygon) sectors.',
'Has an effect only when the angular axis has `type` *category*.',
'Note that `radialaxis.angle` is snapped to the angle of the closest',
'vertex when `gridshape` is *circular*',
'(so that radial axis scale is the same as the data scale).'
].join(' ')
},

// TODO maybe?
// annotations:

Expand Down
4 changes: 4 additions & 0 deletions src/plots/polar/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ function handleDefaults(contIn, contOut, coerce, opts) {

axOut._input = axIn;
}

if(contOut.angularaxis.type === 'category') {
coerce('gridshape');
}
}

function handleAxisTypeDefaults(axIn, axOut, coerce, subplotData, dataAttr) {
Expand Down
Loading