Skip to content

Commit 1e8cd59

Browse files
committed
merge master
2 parents c02d508 + 7194259 commit 1e8cd59

File tree

13 files changed

+24
-88
lines changed

13 files changed

+24
-88
lines changed

draftlogs/7214_remove.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for deprecated `bardir` attribute (use `orientation` instead) [[#7214](https://github.com/plotly/plotly.js/pull/7214)]

draftlogs/7215_remove.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for deprecated `annotation.ref` attribute (use `annotation.xref` and `annotation.yref` instead) [[#7215](https://github.com/plotly/plotly.js/pull/7215)]

src/components/annotations/attributes.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,4 @@ module.exports = templatedArray('annotation', {
487487
].join(' ')
488488
},
489489
editType: 'calc',
490-
491-
_deprecated: {
492-
ref: {
493-
valType: 'string',
494-
editType: 'calc',
495-
description: [
496-
'Obsolete. Set `xref` and `yref` separately instead.'
497-
].join(' ')
498-
}
499-
}
500490
});

src/plot_api/helpers.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,6 @@ exports.cleanLayout = function(layout) {
144144

145145
if(!Lib.isPlainObject(ann)) continue;
146146

147-
if(ann.ref) {
148-
if(ann.ref === 'paper') {
149-
ann.xref = 'paper';
150-
ann.yref = 'paper';
151-
} else if(ann.ref === 'data') {
152-
ann.xref = 'x';
153-
ann.yref = 'y';
154-
}
155-
delete ann.ref;
156-
}
157-
158147
cleanAxRef(ann, 'xref');
159148
cleanAxRef(ann, 'yref');
160149
}
@@ -283,17 +272,6 @@ exports.cleanData = function(data) {
283272
delete trace.xbins;
284273
}
285274

286-
// convert bardir to orientation, and put the data into
287-
// the axes it's eventually going to be used with
288-
if('bardir' in trace) {
289-
if(trace.bardir === 'h' && (traceIs(trace, 'bar') ||
290-
trace.type.substr(0, 9) === 'histogram')) {
291-
trace.orientation = 'h';
292-
exports.swapXYData(trace);
293-
}
294-
delete trace.bardir;
295-
}
296-
297275
// now we have only one 1D histogram type, and whether
298276
// it uses x or y data depends on trace.orientation
299277
if(trace.type === 'histogramy') exports.swapXYData(trace);

src/traces/bar/attributes.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,4 @@ module.exports = {
227227
editType: 'style'
228228
},
229229
zorder: scatterAttrs.zorder,
230-
231-
_deprecated: {
232-
bardir: {
233-
valType: 'enumerated',
234-
editType: 'calc',
235-
values: ['v', 'h'],
236-
description: 'Renamed to `orientation`.'
237-
}
238-
}
239230
};

src/traces/histogram/attributes.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,5 @@ module.exports = {
246246
selected: barAttrs.selected,
247247
unselected: barAttrs.unselected,
248248

249-
_deprecated: {
250-
bardir: barAttrs._deprecated.bardir
251-
},
252-
253249
zorder: barAttrs.zorder
254250
};

test/image/mocks/11.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@
214214
"xatype": "category",
215215
"yatype": "linear",
216216
"tag": "",
217-
"ref": "paper"
217+
"xref": "paper",
218+
"yref": "paper"
218219
}
219220
],
220221
"margin": {

test/image/mocks/14.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
"xatype": "log",
168168
"yatype": "log",
169169
"tag": "",
170-
"ref": "plot"
170+
"xref": "plot",
171+
"yref": "plot"
171172
},
172173
{
173174
"x": 0.15585471975544452,
@@ -198,7 +199,8 @@
198199
"xatype": "log",
199200
"yatype": "log",
200201
"tag": "",
201-
"ref": "plot"
202+
"xref": "plot",
203+
"yref": "plot"
202204
},
203205
{
204206
"x": 1.8420351138192386,
@@ -229,7 +231,8 @@
229231
"xatype": "log",
230232
"yatype": "log",
231233
"tag": "",
232-
"ref": "plot"
234+
"xref": "plot",
235+
"yref": "plot"
233236
},
234237
{
235238
"x": -0.5537301200821234,
@@ -260,7 +263,8 @@
260263
"xatype": "log",
261264
"yatype": "log",
262265
"tag": "",
263-
"ref": "plot"
266+
"xref": "plot",
267+
"yref": "plot"
264268
},
265269
{
266270
"x": -2.701204903100102,
@@ -291,7 +295,8 @@
291295
"xatype": "log",
292296
"yatype": "log",
293297
"tag": "",
294-
"ref": "plot"
298+
"xref": "plot",
299+
"yref": "plot"
295300
},
296301
{
297302
"x": -1.6961577824283882,
@@ -322,7 +327,8 @@
322327
"xatype": "log",
323328
"yatype": "log",
324329
"tag": "",
325-
"ref": "plot"
330+
"xref": "plot",
331+
"yref": "plot"
326332
}
327333
],
328334
"margin": {

test/image/mocks/17.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@
612612
"xatype": "linear",
613613
"yatype": "linear",
614614
"tag": "",
615-
"ref": "plot"
615+
"xref": "plot",
616+
"yref": "plot"
616617
}
617618
],
618619
"margin": {

test/image/mocks/27.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@
329329
"xatype": "linear",
330330
"yatype": "linear",
331331
"tag": "",
332-
"ref": "plot"
332+
"xref": "plot",
333+
"yref": "plot"
333334
}
334335
],
335336
"margin": {

test/image/mocks/29.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,8 @@
22562256
"xanchor": "auto",
22572257
"yanchor": "auto",
22582258
"tag": "",
2259-
"ref": "paper"
2259+
"xref": "paper",
2260+
"yref": "paper"
22602261
}
22612262
],
22622263
"margin": {

test/jasmine/tests/plot_api_test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,7 +2540,6 @@ describe('Test plot api', function() {
25402540

25412541
var layout = {
25422542
annotations: [
2543-
{ ref: 'paper' },
25442543
null,
25452544
{ xref: 'x02', yref: 'y1' }
25462545
],
@@ -2553,9 +2552,8 @@ describe('Test plot api', function() {
25532552

25542553
Plotly.newPlot(gd, data, layout);
25552554

2556-
expect(gd.layout.annotations[0]).toEqual({ xref: 'paper', yref: 'paper' });
2557-
expect(gd.layout.annotations[1]).toEqual(null);
2558-
expect(gd.layout.annotations[2]).toEqual({ xref: 'x2', yref: 'y' });
2555+
expect(gd.layout.annotations[0]).toEqual(null);
2556+
expect(gd.layout.annotations[1]).toEqual({ xref: 'x2', yref: 'y' });
25592557

25602558
expect(gd.layout.shapes[0].xref).toBeUndefined();
25612559
expect(gd.layout.shapes[0].yref).toBeUndefined();

test/plot-schema.json

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,6 @@
730730
"annotations": {
731731
"items": {
732732
"annotation": {
733-
"_deprecated": {
734-
"ref": {
735-
"description": "Obsolete. Set `xref` and `yref` separately instead.",
736-
"editType": "calc",
737-
"valType": "string"
738-
}
739-
},
740733
"align": {
741734
"description": "Sets the horizontal alignment of the `text` within the box. Has an effect only if `text` spans two or more lines (i.e. `text` contains one or more <br> HTML tags) or if an explicit width is set to override the text width.",
742735
"dflt": "center",
@@ -17291,17 +17284,6 @@
1729117284
"bar": {
1729217285
"animatable": true,
1729317286
"attributes": {
17294-
"_deprecated": {
17295-
"bardir": {
17296-
"description": "Renamed to `orientation`.",
17297-
"editType": "calc",
17298-
"valType": "enumerated",
17299-
"values": [
17300-
"v",
17301-
"h"
17302-
]
17303-
}
17304-
},
1730517287
"alignmentgroup": {
1730617288
"description": "Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.",
1730717289
"dflt": "",
@@ -43686,17 +43668,6 @@
4368643668
"histogram": {
4368743669
"animatable": false,
4368843670
"attributes": {
43689-
"_deprecated": {
43690-
"bardir": {
43691-
"description": "Renamed to `orientation`.",
43692-
"editType": "calc",
43693-
"valType": "enumerated",
43694-
"values": [
43695-
"v",
43696-
"h"
43697-
]
43698-
}
43699-
},
4370043671
"alignmentgroup": {
4370143672
"description": "Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.",
4370243673
"dflt": "",

0 commit comments

Comments
 (0)