Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e81039

Browse files
committedJan 4, 2018
large commit of attribute name & dflt changes
- radialaxis.position -> radialaxis.angle - angularaxis.position -> angularaxis.rotation - radialaxis.side ('left','right') -> ('counterclockwise', 'clockwise') - scatterpolar mode dflt -> same as scatter - scatterpolar cliponaxis dflt -> false (unlike other scatter-like traces)
1 parent 25b4e7b commit 1e81039

File tree

14 files changed

+96
-188
lines changed

14 files changed

+96
-188
lines changed
 

‎src/plots/polar/helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212

1313
exports.setConvertAngular = function setConvertAngular(ax) {
1414
var dir = {clockwise: -1, counterclockwise: 1}[ax.direction];
15-
var pos = Lib.deg2rad(ax.position);
15+
var rot = Lib.deg2rad(ax.rotation);
1616
var _c2rad;
1717
var _rad2c;
1818

@@ -45,11 +45,11 @@ exports.setConvertAngular = function setConvertAngular(ax) {
4545
};
4646
}
4747

48-
function transformRad(v) { return dir * v + pos; }
49-
function unTransformRad(v) { return (v - pos) / dir; }
48+
function transformRad(v) { return dir * v + rot; }
49+
function unTransformRad(v) { return (v - rot) / dir; }
5050

5151
// use the shift 'sector' to get right tick labels for non-default
52-
// angularaxis 'position' and/or 'direction'
52+
// angularaxis 'rotation' and/or 'direction'
5353
ax.unTransformRad = unTransformRad;
5454

5555
// this version is used on hover

‎src/plots/polar/layout_attributes.js

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,19 @@ var axisLineGridAttr = overrideAll({
2323
gridcolor: axesAttrs.gridcolor,
2424
gridwidth: axesAttrs.gridwidth
2525

26+
// TODO add spike* attributes down the road
27+
2628
// should we add zeroline* attributes?
27-
// might be useful on radial axes where range is negative and positive
2829

29-
// we could add spike* attributes down the road
3030
}, 'plot', 'from-root');
3131

32-
var axisTickAttr = overrideAll({
32+
var axisTickAttrs = overrideAll({
3333
tickmode: axesAttrs.tickmode,
3434
nticks: axesAttrs.nticks,
3535
tick0: axesAttrs.tick0,
3636
dtick: axesAttrs.dtick,
3737
tickvals: axesAttrs.tickvals,
3838
ticktext: axesAttrs.ticktext,
39-
// TODO does not need 'inside' / 'outside' for radialaxis
40-
// or maybe cut 'side' and have
41-
// radialaxis.ticks: 'counterclockwise', 'clockwise', 'center', ''
4239
ticks: axesAttrs.ticks,
4340
ticklen: axesAttrs.ticklen,
4441
tickwidth: axesAttrs.tickwidth,
@@ -62,11 +59,6 @@ var radialAxisAttrs = {
6259
visible: extendFlat({}, axesAttrs.visible, {dflt: true}),
6360
type: axesAttrs.type,
6461

65-
// You thought maybe that range should only be a 'max' instead
66-
// as it always starts at 0? But, looks like off-zero cutout polar chart are
67-
// a thing:
68-
// -> mpl allow radial ranges to start off 0
69-
// -> same for matlab: https://www.mathworks.com/help/matlab/ref/rlim.html
7062
autorange: axesAttrs.autorange,
7163
rangemode: {
7264
valType: 'enumerated',
@@ -88,13 +80,7 @@ var radialAxisAttrs = {
8880
categoryorder: axesAttrs.categoryorder,
8981
categoryarray: axesAttrs.categoryarray,
9082

91-
// position (name analogous to xaxis.position),
92-
// or maybe something more specific e.g. angle angleoffset?
93-
//
94-
// (should this support any data coordinate system?)
95-
// I think it is more intuitive to set this as just an angle!
96-
// Thoughts?
97-
position: {
83+
angle: {
9884
valType: 'angle',
9985
editType: 'plot',
10086
role: 'info',
@@ -108,9 +94,9 @@ var radialAxisAttrs = {
10894

10995
side: {
11096
valType: 'enumerated',
111-
// maybe 'clockwise' and 'counterclockwise' would be best here
112-
values: ['left', 'right'],
113-
dflt: 'right',
97+
// TODO add 'center' for `showline: false` radial axes
98+
values: ['clockwise', 'counterclockwise'],
99+
dflt: 'clockwise',
114100
editType: 'plot',
115101
role: 'info',
116102
description: [
@@ -119,6 +105,7 @@ var radialAxisAttrs = {
119105
].join(' ')
120106
},
121107

108+
122109
title: extendFlat({}, axesAttrs.title, {editType: 'plot', dflt: ''}),
123110
titlefont: overrideAll(axesAttrs.titlefont, 'plot', 'from-root'),
124111
// might need a 'titleside' and even 'titledirection' down the road
@@ -146,10 +133,10 @@ var radialAxisAttrs = {
146133
extendFlat(
147134
radialAxisAttrs,
148135

149-
// N.B. the radialaxis grid lines are circular,
136+
// N.B. radialaxis grid lines are circular,
150137
// but radialaxis lines are straight from circle center to outer bound
151138
axisLineGridAttr,
152-
axisTickAttr
139+
axisTickAttrs
153140
);
154141

155142
var angularAxisAttrs = {
@@ -168,8 +155,8 @@ var angularAxisAttrs = {
168155
description: [
169156
'Sets the angular axis type.',
170157
'If *linear*, set `thetaunit` to determine the unit in which axis value are shown.',
171-
'If *date*, set `period` to determine the wrap around period.',
172-
'If *category, set `period` to determine the number of integer coordinates around polar axis.'
158+
'If *date*, use `period` to set the unit of time that determines a complete rotation',
159+
'If *category, use `period` to set the number of integer coordinates around polar axis.'
173160
].join(' ')
174161
},
175162

@@ -213,7 +200,7 @@ var angularAxisAttrs = {
213200
direction: {
214201
valType: 'enumerated',
215202
values: ['counterclockwise', 'clockwise'],
216-
// we could make the default 'clockwise' for date axes ...
203+
// we could make the default 'clockwise' for category and date angular axes
217204
dflt: 'counterclockwise',
218205
role: 'info',
219206
editType: 'calc',
@@ -222,14 +209,9 @@ var angularAxisAttrs = {
222209
].join(' ')
223210
},
224211

225-
// matlab uses thetaZeroLocation: 'North', 'West', 'East', 'South'
226-
// mpl uses set_theta_zero_location('W', offset=10)
227-
//
228-
// position is analogous to yaxis.position, but as an angle (going
229-
// counterclockwise about cartesian y=0.
230-
position: {
212+
rotation: {
231213
valType: 'angle',
232-
// we could maybe make `position: 90` by default for category and date angular axes.
214+
// we could maybe make `rotation: 90` by default for category and date angular axes
Code has comments. Press enter to view.
233215
dflt: 0,
234216
editType: 'calc',
235217
role: 'info',
@@ -238,7 +220,7 @@ var angularAxisAttrs = {
238220
'Note that by default, polar subplots are orientation such that the theta=0',
239221
'corresponds to a line pointing right (like what mathematicians prefer).',
240222
'For example to make the angular axis start from the North (like on a compass),',
241-
'set `angularaxis.position` to *90*.'
223+
'set `angularaxis.rotation` to *90*.'
242224
].join(' ')
243225
},
244226

@@ -250,39 +232,25 @@ var angularAxisAttrs = {
250232
extendFlat(
251233
angularAxisAttrs,
252234

253-
// N.B. the angular grid lines are straight lines from circle center to outer bound
235+
// N.B. angular grid lines are straight lines from circle center to outer bound
254236
// the angular line is circular bounding the polar plot area.
255237
axisLineGridAttr,
256-
// Note that ticksuffix defaults to '°' for angular axes with `thetaunit: 'degrees'`
257-
axisTickAttr
238+
239+
// N.B. ticksuffix defaults to '°' for angular axes with `thetaunit: 'degrees'`
240+
axisTickAttrs
258241
);
259242

260243
module.exports = {
261-
// AJ and I first thought about a x/y/zoom system for paper-based zooming
262-
// but I came to think that sector span + radial axis range
263-
// zooming will be better
264-
//
265-
// TODO confirm with team.
244+
// TODO for x/y/zoom system for paper-based zooming:
266245
// x: {},
267246
// y: {},
268247
// zoom: {},
269248

270249
domain: domainAttrs({name: 'polar', editType: 'plot'}),
271250

272-
// Maybe this should angularaxis.range correspond to
273-
// angular span of the drawing area?
274-
//
275-
// matlab's angular equivalent to 'range' bounds the drawing area
276-
// (partial circles as they call it)
277-
// https://www.mathworks.com/help/matlab/ref/thetalim.html
278-
//
279-
// as this attribute would be best set in (absolute) angles,
280-
// I think this should be set outside of angularaxis e.g
281-
// as polar.sector: [0, 180]
282251
sector: {
283252
valType: 'info_array',
284253
items: [
285-
// or be more strict -> `valType: 'angle' with `dflt: [0, 360]`
286254
{valType: 'number', editType: 'plot'},
287255
{valType: 'number', editType: 'plot'}
288256
],

‎src/plots/polar/layout_defaults.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function handleDefaults(contIn, contOut, coerce, opts) {
3232
var bgColor = coerce('bgcolor');
3333
opts.bgColor = Color.combine(bgColor, opts.paper_bgcolor);
3434

35-
// TODO sanitize sector similar to 'range'
3635
var sector = coerce('sector');
3736

3837
// could optimize, subplotData is not always needed!
@@ -102,7 +101,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
102101

103102
if(visible) {
104103
coerceAxis('side');
105-
coerceAxis('position', sector[0]);
104+
coerceAxis('angle', sector[0]);
106105

107106
coerceAxis('title');
108107
Lib.coerceFont(coerceAxis, 'titlefont', {
@@ -120,11 +119,10 @@ function handleDefaults(contIn, contOut, coerce, opts) {
120119
coerceAxis('period');
121120
}
122121

123-
// TODO maybe non-linear axis
124-
// should get direction: 'clockwise' + position: 90
125-
// by default??
122+
// TODO maybe by default: non-linear axis
123+
// should get direction: 'clockwise' + rotation: 90
126124
coerceAxis('direction');
127-
coerceAxis('position');
125+
coerceAxis('rotation');
128126

129127
setConvertAngular(axOut);
130128
break;

‎src/plots/polar/polar.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
267267
_id: 'x',
268268
_pos: 0,
269269

270-
// radialaxis uses 'top'/'bottom' -> convert to 'x' axis equivalent
271-
side: {left: 'top', right: 'bottom'}[radialLayout.side],
270+
// convert to 'x' axis equivalent
271+
side: {counterclockwise: 'top', clockwise: 'bottom'}[radialLayout.side],
272272

273273
// spans length 1 radius
274274
domain: [0, radius / gs.w],
@@ -313,7 +313,7 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
313313
Axes.doTicks(gd, ax, true);
314314

315315
updateElement(layers['radial-axis'], radialLayout.showticklabels || radialLayout.ticks, {
316-
transform: strTranslate(cx, cy) + strRotate(-radialLayout.position)
316+
transform: strTranslate(cx, cy) + strRotate(-radialLayout.angle)
317317
});
318318

319319
// move all grid paths to about circle center,
@@ -328,7 +328,7 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
328328
y1: 0,
329329
x2: radius,
330330
y2: 0,
331-
transform: strTranslate(cx, cy) + strRotate(-radialLayout.position)
331+
transform: strTranslate(cx, cy) + strRotate(-radialLayout.angle)
332332
})
333333
.attr('stroke-width', radialLayout.linewidth)
334334
.call(Color.stroke, radialLayout.linecolor);
@@ -343,7 +343,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) {
343343
var radialLayout = polarLayout.radialaxis;
344344
var titleClass = _this.id + 'title';
345345

346-
var angle = _angle !== undefined ? _angle : radialLayout.position;
346+
var angle = _angle !== undefined ? _angle : radialLayout.angle;
347347
var angleRad = deg2rad(angle);
348348
var cosa = Math.cos(angleRad);
349349
var sina = Math.sin(angleRad);
@@ -352,7 +352,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) {
352352
if(radialLayout.title) {
353353
var h = Drawing.bBox(_this.layers['radial-axis'].node()).height;
354354
var ts = radialLayout.titlefont.size;
355-
pad = radialLayout.side === 'left' ?
355+
pad = radialLayout.side === 'counterclockwise' ?
356356
-h - ts * 0.4 :
357357
h + ts * 0.8;
358358
}
@@ -381,8 +381,8 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
381381
var sector = polarLayout.sector;
382382
var sectorInRad = sector.map(deg2rad);
383383

384-
if(!('angularaxis.position' in _this.viewInitial)) {
385-
_this.viewInitial['angularaxis.position'] = angularLayout.position;
384+
if(!('angularaxis.rotation' in _this.viewInitial)) {
385+
_this.viewInitial['angularaxis.rotation'] = angularLayout.rotation;
386386
}
387387

388388
var ax = _this.angularAxis = Lib.extendFlat({}, angularLayout, {
@@ -406,7 +406,7 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
406406
});
407407

408408
// Set the angular range in degrees to make auto-tick computation cleaner,
409-
// changing position/direction should not affect the angular tick labels.
409+
// changing rotation/direction should not affect the angular tick labels.
410410
if(ax.type === 'linear') {
411411
ax.autorange = false;
412412

@@ -572,8 +572,8 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
572572
var path0, dimmed, lum;
573573
// zoombox, corners elements
574574
var zb, corners;
575-
// angular axis angle offset at drag start (0), move (1)
576-
var angle0, angle1;
575+
// angular axis angle rotation at drag start (0), move (1)
576+
var rot0, rot1;
577577
// copy of polar sector value at drag start
578578
var sector0;
579579
// angle about circle center at drag start
@@ -692,28 +692,27 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
692692

693693
function panPrep() {
694694
sector0 = fullLayout[_this.id].sector.slice();
695-
angle0 = fullLayout[_this.id].angularaxis.position;
695+
rot0 = fullLayout[_this.id].angularaxis.rotation;
696696
a0 = xy2a(x0, y0);
697697
}
698698

699699
function panMove(dx, dy) {
700700
var x1 = x0 + dx;
701701
var y1 = y0 + dy;
702702
var a1 = xy2a(x1, y1);
703-
var dangle = rad2deg(a1 - a0);
704-
705-
angle1 = angle0 + dangle;
703+
var da = rad2deg(a1 - a0);
704+
rot1 = rot0 + da;
706705

707706
layers.frontplot.attr('transform',
708-
strTranslate(xOffset2, yOffset2) + strRotate([-dangle, cxx, cyy])
707+
strTranslate(xOffset2, yOffset2) + strRotate([-da, cxx, cyy])
709708
);
710709

711710
_this.clipPaths.circle.select('circle').attr('transform',
712-
strTranslate(cxx, cyy) + strRotate(dangle)
711+
strTranslate(cxx, cyy) + strRotate(da)
713712
);
714713

715714
var angularAxis = _this.angularAxis;
716-
angularAxis.position = wrap180(angle1);
715+
angularAxis.rotation = wrap180(rot1);
717716

718717
if(angularAxis.type === 'linear' && !isFullCircle(sector)) {
719718
angularAxis.range = sector0
@@ -727,7 +726,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
727726

728727
if(_this._hasClipOnAxisFalse && !isFullCircle(sector)) {
729728
// mutate sector to trick isPtWithinSector
730-
_this.sector = [sector0[0] - dangle, sector0[1] - dangle];
729+
_this.sector = [sector0[0] - da, sector0[1] - da];
731730

732731
layers.frontplot
733732
.select('.scatterlayer').selectAll('.trace')
@@ -749,7 +748,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
749748
function panDone(dragged, numClicks) {
750749
if(dragged) {
751750
var updateObj = {};
752-
updateObj[_this.id + '.angularaxis.position'] = angle1;
751+
updateObj[_this.id + '.angularaxis.rotation'] = rot1;
753752
Plotly.relayout(gd, updateObj);
754753
} else if(numClicks === 2) {
755754
doubleClick();
@@ -828,7 +827,7 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
828827
var cy = _this.cy;
829828
var radialAxis = _this.radialAxis;
830829
var radialLayout = polarLayout.radialaxis;
831-
var angle0 = deg2rad(radialLayout.position);
830+
var angle0 = deg2rad(radialLayout.angle);
832831
var range0 = radialAxis.range.slice();
833832
var drange = range0[1] - range0[0];
834833

@@ -866,7 +865,7 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
866865

867866
function doneFn() {
868867
if(angle1 !== null) {
869-
Plotly.relayout(gd, _this.id + '.radialaxis.position', angle1);
868+
Plotly.relayout(gd, _this.id + '.radialaxis.angle', angle1);
870869
} else if(rng1 !== null) {
871870
Plotly.relayout(gd, _this.id + '.radialaxis.range[1]', rng1);
872871
}
@@ -988,7 +987,9 @@ function setScale(ax, axLayout, fullLayout) {
988987
}
989988

990989
function strTickLayout(axLayout) {
991-
return axLayout.ticks + String(axLayout.ticklen) + String(axLayout.showticklabels);
990+
var out = axLayout.ticks + String(axLayout.ticklen) + String(axLayout.showticklabels);
991+
if('side' in axLayout) out += axLayout.side;
992+
return out;
992993
}
993994

994995
// Finds the bounding box of a given circle sector,

‎src/traces/scatterpolar/attributes.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ var plotAttrs = require('../../plots/attributes');
1414
var lineAttrs = scatterAttrs.line;
1515

1616
module.exports = {
17-
// TODO is this correct?
18-
// `dflt: 'markers' matches the scattergeo, scattermapbox types,
19-
// scatter, scattergl, scatterternary, scattercarpet use a special 'line' vs 'markers+lines' logic
20-
// while scatter3d has a hard 'markers+lines' default
21-
mode: extendFlat({}, scatterAttrs.mode, {
22-
dflt: 'markers'
23-
}),
17+
mode: scatterAttrs.mode,
2418

2519
r: {
2620
valType: 'data_array',
@@ -40,12 +34,12 @@ module.exports = {
4034
dflt: 'degrees',
4135
role: 'info',
4236
editType: 'calc+clearAxisTypes',
43-
description: 'Sets the unit of input *theta* values.'
37+
description: [
38+
'Sets the unit of input *theta* values.',
39+
'Has an effect only when on *linear* angular axes.'
40+
].join(' ')
4441
},
4542

46-
// TODO not sure r0, dr, theta0, dtheta
47-
// would make sense here?
48-
4943
text: scatterAttrs.text,
5044
hovertext: scatterAttrs.hovertext,
5145

@@ -62,8 +56,7 @@ module.exports = {
6256
connectgaps: scatterAttrs.connectgaps,
6357

6458
marker: scatterAttrs.marker,
65-
// TODO maybe we should make the dflt *false* ??
66-
cliponaxis: scatterAttrs.cliponaxis,
59+
cliponaxis: extendFlat({}, scatterAttrs.cliponaxis, {dflt: false}),
6760

6861
textposition: scatterAttrs.textposition,
6962
textfont: scatterAttrs.textfont,

‎src/traces/scatterpolar/defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var handleLineDefaults = require('../scatter/line_defaults');
1616
var handleLineShapeDefaults = require('../scatter/line_shape_defaults');
1717
var handleTextDefaults = require('../scatter/text_defaults');
1818
var handleFillColorDefaults = require('../scatter/fillcolor_defaults');
19+
var PTS_LINESONLY = require('../scatter/constants').PTS_LINESONLY;
1920

2021
var attributes = require('./attributes');
2122

@@ -37,7 +38,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3738
if(len < theta.length) traceOut.theta = theta.slice(0, len);
3839

3940
coerce('thetaunit');
40-
coerce('mode');
41+
coerce('mode', len < PTS_LINESONLY ? 'lines+markers' : 'lines');
4142
coerce('text');
4243
coerce('hovertext');
4344

‎test/image/mocks/polar_blank.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"radialaxis": {
3232
"title": "blank",
33-
"position": 180
33+
"angle": 180
3434
}
3535
},
3636
"polar2": {
@@ -58,7 +58,7 @@
5858
},
5959
"radialaxis": {
6060
"title": "blank",
61-
"side": "left"
61+
"side": "counterclockwise"
6262
},
6363
"angularaxis": {"visible": false}
6464
},

‎test/image/mocks/polar_categories.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
"data": [
33
{
44
"type": "scatterpolar",
5-
"mode": "lines+markers",
65
"name": "angular categories",
76
"r": [5, 4, 2, 4, 5],
87
"theta": ["a", "b", "c", "d", "a"],
98
"fill": "toself"
109
},
1110
{
1211
"type": "scatterpolar",
13-
"mode": "lines+markers",
1412
"name": "radial categories",
1513
"r": ["a", "b", "c", "d", "b", "f", "a"],
1614
"theta": [1, 4, 2, 1.5, 1.5, 6, 5],
@@ -20,7 +18,6 @@
2018
},
2119
{
2220
"type": "scatterpolar",
23-
"mode": "lines+markers",
2421
"name": "angular categories (w/ categoryarray)",
2522
"r": [5, 4, 2, 4, 5],
2623
"theta": ["a", "b", "c", "d", "a"],
@@ -29,7 +26,6 @@
2926
},
3027
{
3128
"type": "scatterpolar",
32-
"mode": "lines+markers",
3329
"name": "radial categories (w/ category descending)",
3430
"r": ["a", "b", "c", "d", "b", "f", "a", "a"],
3531
"theta": [45, 90, 180, 200, 300, 15, 20, 45],
@@ -38,7 +34,6 @@
3834
},
3935
{
4036
"type": "scatterpolar",
41-
"mode": "lines+markers",
4237
"name": "angular categories (w/ extra category)",
4338
"r": [5, 4, 2, 4, 5, 5],
4439
"theta": ["b", "c", "d", "e", "a", "b"],
@@ -52,7 +47,7 @@
5247
"y": [0.56, 1]
5348
},
5449
"radialaxis": {
55-
"position": 45
50+
"angle": 45
5651
}
5752
},
5853
"polar2": {
@@ -61,7 +56,7 @@
6156
"y": [0, 0.44]
6257
},
6358
"radialaxis": {
64-
"position": 180,
59+
"angle": 180,
6560
"tickangle": -180
6661
}
6762
},
@@ -72,7 +67,7 @@
7267
},
7368
"sector": [150, 400],
7469
"radialaxis": {
75-
"position": -45
70+
"angle": -45
7671
},
7772
"angularaxis": {
7873
"categoryarray": ["d", "a", "c", "b"]

‎test/image/mocks/polar_direction.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"size": 8
2626
},
2727
"subplot": "polar",
28-
"text": "sector: 0->360<br>position: -90<br>direction: clockwise"
28+
"text": "sector: 0->360<br>rotation: -90<br>direction: clockwise"
2929
},
3030
{
3131
"type": "scatterpolar",
@@ -52,7 +52,7 @@
5252
"size": 8
5353
},
5454
"subplot": "polar2",
55-
"text": "sector: 0->360<br>position: 90<br>direction: clockwise"
55+
"text": "sector: 0->360<br>rotation: 90<br>direction: clockwise"
5656
},
5757
{
5858
"type": "scatterpolar",
@@ -79,7 +79,7 @@
7979
"size": 8
8080
},
8181
"subplot": "polar3",
82-
"text": "sector: 45->135<br>position: 90<br>direction: clockwise"
82+
"text": "sector: 45->135<br>rotation: 90<br>direction: clockwise"
8383
},
8484
{
8585
"type": "scatterpolar",
@@ -106,7 +106,7 @@
106106
"size": 8
107107
},
108108
"subplot": "polar4",
109-
"text": "sector: 135->225<br>position: 90<br>direction: clockwise"
109+
"text": "sector: 135->225<br>rotation: 90<br>direction: clockwise"
110110
},
111111
{
112112
"type": "scatterpolar",
@@ -133,7 +133,7 @@
133133
"size": 8
134134
},
135135
"subplot": "polar5",
136-
"text": "sector: 135->225<br>position: 90<br>direction: counterclockwise"
136+
"text": "sector: 135->225<br>rotation: 90<br>direction: counterclockwise"
137137
},
138138
{
139139
"type": "scatterpolar",
@@ -160,7 +160,7 @@
160160
"size": 8
161161
},
162162
"subplot": "polar6",
163-
"text": "sector: 45->135<br>position: 90<br>direction: counterclockwise"
163+
"text": "sector: 45->135<br>rotation: 90<br>direction: counterclockwise"
164164
},
165165
{
166166
"type": "scatterpolar",
@@ -187,7 +187,7 @@
187187
"size": 8
188188
},
189189
"subplot": "polar7",
190-
"text": "sector: 0->360<br>position: 90<br>direction: counterclockwise"
190+
"text": "sector: 0->360<br>rotation: 90<br>direction: counterclockwise"
191191
},
192192
{
193193
"type": "scatterpolar",
@@ -214,7 +214,7 @@
214214
"size": 8
215215
},
216216
"subplot": "polar8",
217-
"text": "sector: 0->360<br>position: 0<br>direction: clockwise"
217+
"text": "sector: 0->360<br>rotation: 0<br>direction: clockwise"
218218
},
219219
{
220220
"type": "scatterpolar",
@@ -241,7 +241,7 @@
241241
"size": 8
242242
},
243243
"subplot": "polar9",
244-
"text": "sector: 0->360<br>position: 0<br>direction: counterclockwise"
244+
"text": "sector: 0->360<br>rotation: 0<br>direction: counterclockwise"
245245
}
246246
],
247247
"layout": {
@@ -278,7 +278,7 @@
278278
"tickfont": {
279279
"size": 8
280280
},
281-
"position": -90,
281+
"rotation": -90,
282282
"direction": "clockwise"
283283
}
284284
},
@@ -306,7 +306,7 @@
306306
"tickfont": {
307307
"size": 8
308308
},
309-
"position": 90,
309+
"rotation": 90,
310310
"direction": "clockwise"
311311
}
312312
},
@@ -334,7 +334,7 @@
334334
"tickfont": {
335335
"size": 8
336336
},
337-
"position": 90,
337+
"rotation": 90,
338338
"direction": "clockwise"
339339
}
340340
},
@@ -362,7 +362,7 @@
362362
"tickfont": {
363363
"size": 8
364364
},
365-
"position": 90,
365+
"rotation": 90,
366366
"direction": "clockwise"
367367
}
368368
},
@@ -390,7 +390,7 @@
390390
"tickfont": {
391391
"size": 8
392392
},
393-
"position": 90,
393+
"rotation": 90,
394394
"direction": "counterclockwise"
395395
}
396396
},
@@ -418,7 +418,7 @@
418418
"tickfont": {
419419
"size": 8
420420
},
421-
"position": 90,
421+
"rotation": 90,
422422
"direction": "counterclockwise"
423423
}
424424
},
@@ -446,7 +446,7 @@
446446
"tickfont": {
447447
"size": 8
448448
},
449-
"position": 90,
449+
"rotation": 90,
450450
"direction": "counterclockwise"
451451
}
452452
},
@@ -474,7 +474,7 @@
474474
"tickfont": {
475475
"size": 8
476476
},
477-
"position": 0,
477+
"rotation": 0,
478478
"direction": "clockwise"
479479
}
480480
},
@@ -502,7 +502,7 @@
502502
"tickfont": {
503503
"size": 8
504504
},
505-
"position": 0,
505+
"rotation": 0,
506506
"direction": "counterclockwise"
507507
}
508508
}

‎test/image/mocks/polar_line.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,6 @@
690690
"bgcolor": "rgb(255, 255, 255)",
691691
"radialaxis": {
692692
"range": [0, 1.1],
693-
"side": "right",
694693
"tickangle": 45,
695694
"tick0": 0,
696695
"dtick": 0.1

‎test/image/mocks/polar_scatter.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@
135135
"color": "white"
136136
},
137137
"opacity": 0.7
138-
},
139-
"cliponaxis": false
138+
}
140139
},
141140
{
142141
"type": "scatterpolar",
@@ -273,8 +272,7 @@
273272
"color": "white"
274273
},
275274
"opacity": 0.7
276-
},
277-
"cliponaxis": false
275+
}
278276
},
279277
{
280278
"type": "scatterpolar",
@@ -411,8 +409,7 @@
411409
"color": "white"
412410
},
413411
"opacity": 0.7
414-
},
415-
"cliponaxis": false
412+
}
416413
},
417414
{
418415
"type": "scatterpolar",
@@ -549,8 +546,7 @@
549546
"color": "white"
550547
},
551548
"opacity": 0.7
552-
},
553-
"cliponaxis": false
549+
}
554550
},
555551
{
556552
"type": "scatterpolar",
@@ -687,8 +683,7 @@
687683
"color": "white"
688684
},
689685
"opacity": 0.7
690-
},
691-
"cliponaxis": false
686+
}
692687
},
693688
{
694689
"type": "scatterpolar",
@@ -825,8 +820,7 @@
825820
"color": "white"
826821
},
827822
"opacity": 0.7
828-
},
829-
"cliponaxis": false
823+
}
830824
}
831825
],
832826
"layout": {
@@ -843,7 +837,7 @@
843837
"layer": "below traces"
844838
},
845839
"radialaxis": {
846-
"side": "left",
840+
"side": "counterclockwise",
847841
"showline": true,
848842
"linewidth": 2,
849843
"tickwidth": 2,

‎test/image/mocks/polar_sector.json

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"data": [
33
{
44
"type": "scatterpolar",
5-
"mode": "lines+markers",
65
"r": [
76
1,
87
2,
@@ -26,12 +25,10 @@
2625
"color": "#b15928",
2726
"size": 10
2827
},
29-
"cliponaxis": false,
3028
"subplot": "polar"
3129
},
3230
{
3331
"type": "scatterpolar",
34-
"mode": "lines+markers",
3532
"r": [
3633
1,
3734
2,
@@ -55,12 +52,10 @@
5552
"color": "#b15928",
5653
"size": 10
5754
},
58-
"cliponaxis": false,
5955
"subplot": "polar2"
6056
},
6157
{
6258
"type": "scatterpolar",
63-
"mode": "lines+markers",
6459
"r": [
6560
1,
6661
2,
@@ -84,12 +79,10 @@
8479
"color": "#b15928",
8580
"size": 10
8681
},
87-
"cliponaxis": false,
8882
"subplot": "polar3"
8983
},
9084
{
9185
"type": "scatterpolar",
92-
"mode": "lines+markers",
9386
"r": [
9487
1,
9588
2,
@@ -113,12 +106,10 @@
113106
"color": "#b15928",
114107
"size": 10
115108
},
116-
"cliponaxis": false,
117109
"subplot": "polar4"
118110
},
119111
{
120112
"type": "scatterpolar",
121-
"mode": "lines+markers",
122113
"r": [
123114
1,
124115
2,
@@ -142,12 +133,10 @@
142133
"color": "#b15928",
143134
"size": 10
144135
},
145-
"cliponaxis": false,
146136
"subplot": "polar5"
147137
},
148138
{
149139
"type": "scatterpolar",
150-
"mode": "lines+markers",
151140
"r": [
152141
1,
153142
2,
@@ -171,12 +160,10 @@
171160
"color": "#b15928",
172161
"size": 10
173162
},
174-
"cliponaxis": false,
175163
"subplot": "polar6"
176164
},
177165
{
178166
"type": "scatterpolar",
179-
"mode": "lines+markers",
180167
"r": [
181168
1,
182169
2,
@@ -200,12 +187,10 @@
200187
"color": "#b15928",
201188
"size": 10
202189
},
203-
"cliponaxis": false,
204190
"subplot": "polar7"
205191
},
206192
{
207193
"type": "scatterpolar",
208-
"mode": "lines+markers",
209194
"r": [
210195
1,
211196
2,
@@ -229,12 +214,10 @@
229214
"color": "#b15928",
230215
"size": 10
231216
},
232-
"cliponaxis": false,
233217
"subplot": "polar8"
234218
},
235219
{
236220
"type": "scatterpolar",
237-
"mode": "lines+markers",
238221
"r": [
239222
1,
240223
2,
@@ -258,12 +241,10 @@
258241
"color": "#b15928",
259242
"size": 10
260243
},
261-
"cliponaxis": false,
262244
"subplot": "polar9"
263245
},
264246
{
265247
"type": "scatterpolar",
266-
"mode": "lines+markers",
267248
"r": [
268249
1,
269250
2,
@@ -287,12 +268,10 @@
287268
"color": "#b15928",
288269
"size": 10
289270
},
290-
"cliponaxis": false,
291271
"subplot": "polar10"
292272
},
293273
{
294274
"type": "scatterpolar",
295-
"mode": "lines+markers",
296275
"r": [
297276
1,
298277
2,
@@ -316,12 +295,10 @@
316295
"color": "#b15928",
317296
"size": 10
318297
},
319-
"cliponaxis": false,
320298
"subplot": "polar11"
321299
},
322300
{
323301
"type": "scatterpolar",
324-
"mode": "lines+markers",
325302
"r": [
326303
1,
327304
2,
@@ -345,12 +322,10 @@
345322
"color": "#b15928",
346323
"size": 10
347324
},
348-
"cliponaxis": false,
349325
"subplot": "polar12"
350326
},
351327
{
352328
"type": "scatterpolar",
353-
"mode": "lines+markers",
354329
"r": [
355330
1,
356331
2,
@@ -374,12 +349,10 @@
374349
"color": "#b15928",
375350
"size": 10
376351
},
377-
"cliponaxis": false,
378352
"subplot": "polar13"
379353
},
380354
{
381355
"type": "scatterpolar",
382-
"mode": "lines+markers",
383356
"r": [
384357
1,
385358
2,
@@ -403,12 +376,10 @@
403376
"color": "#b15928",
404377
"size": 10
405378
},
406-
"cliponaxis": false,
407379
"subplot": "polar14"
408380
},
409381
{
410382
"type": "scatterpolar",
411-
"mode": "lines+markers",
412383
"r": [
413384
1,
414385
2,
@@ -432,12 +403,10 @@
432403
"color": "#b15928",
433404
"size": 10
434405
},
435-
"cliponaxis": false,
436406
"subplot": "polar15"
437407
},
438408
{
439409
"type": "scatterpolar",
440-
"mode": "lines+markers",
441410
"r": [
442411
1,
443412
2,
@@ -461,12 +430,10 @@
461430
"color": "#b15928",
462431
"size": 10
463432
},
464-
"cliponaxis": false,
465433
"subplot": "polar16"
466434
},
467435
{
468436
"type": "scatterpolar",
469-
"mode": "lines+markers",
470437
"r": [
471438
1,
472439
2,
@@ -490,12 +457,10 @@
490457
"color": "#b15928",
491458
"size": 10
492459
},
493-
"cliponaxis": false,
494460
"subplot": "polar17"
495461
},
496462
{
497463
"type": "scatterpolar",
498-
"mode": "lines+markers",
499464
"r": [
500465
1,
501466
2,
@@ -519,12 +484,10 @@
519484
"color": "#b15928",
520485
"size": 10
521486
},
522-
"cliponaxis": false,
523487
"subplot": "polar18"
524488
},
525489
{
526490
"type": "scatterpolar",
527-
"mode": "lines+markers",
528491
"r": [
529492
1,
530493
2,
@@ -548,12 +511,10 @@
548511
"color": "#b15928",
549512
"size": 10
550513
},
551-
"cliponaxis": false,
552514
"subplot": "polar19"
553515
},
554516
{
555517
"type": "scatterpolar",
556-
"mode": "lines+markers",
557518
"r": [
558519
1,
559520
2,
@@ -577,7 +538,6 @@
577538
"color": "#b15928",
578539
"size": 10
579540
},
580-
"cliponaxis": false,
581541
"subplot": "polar20"
582542
}
583543
],

‎test/image/mocks/polar_subplots.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"size": [20, 15, 10]
2626
},
2727
"textposition": "top left",
28-
"cliponaxis": false,
2928
"subplot": "polar2"
3029
}],
3130

@@ -42,7 +41,7 @@
4241
"size": 20,
4342
"color": "blue"
4443
},
45-
"position": -45
44+
"angle": -45
4645
}
4746
},
4847
"polar2": {
@@ -57,7 +56,7 @@
5756
"size": 10,
5857
"color": "orange"
5958
},
60-
"position": 45
59+
"angle": 45
6160
}
6261
}
6362
}

‎test/jasmine/tests/polar_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ describe('Test polar plots defaults:', function() {
7171
Polar.supplyLayoutDefaults(layoutIn, layoutOut, fullData);
7272
}
7373

74-
it('should default *radialaxis.position* to first sector angle', function() {
74+
it('should default *radialaxis.angle* to first sector angle', function() {
7575
_supply({
7676
polar: {
7777
sector: [45, 135]
7878
}
7979
});
80-
expect(layoutOut.polar.radialaxis.position).toBe(45);
80+
expect(layoutOut.polar.radialaxis.angle).toBe(45);
8181
});
8282

8383
it('should coerce *angularaxis.thetaunit* only for linear angular axes', function() {
@@ -215,7 +215,7 @@ describe('Test relayout on polar subplots:', function() {
215215
var tx = d3.select(this);
216216
pos0.push([tx.attr('x'), tx.attr('y')]);
217217
});
218-
return Plotly.relayout(gd, 'polar.angularaxis.position', 90);
218+
return Plotly.relayout(gd, 'polar.angularaxis.rotation', 90);
219219
})
220220
.then(function() {
221221
d3.selectAll('.angulartick> text').each(function() {

0 commit comments

Comments
 (0)
Please sign in to comment.