Skip to content

Commit 6ebf221

Browse files
authored
Merge pull request #1292 from plotly/schema-plotly.py-2.0
Frames plotschema for plotly.py v2
2 parents 74dbbc4 + 124da94 commit 6ebf221

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/plot_api/plot_schema.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ exports.get = function() {
6969

7070
transforms: transforms,
7171

72-
frames: formatAttributes(frameAttributes),
72+
frames: getFramesAttributes(),
7373
animation: formatAttributes(animationAttributes)
7474
};
7575
};
@@ -309,6 +309,16 @@ function getTransformAttributes(type) {
309309
};
310310
}
311311

312+
function getFramesAttributes() {
313+
var attrs = {
314+
frames: Lib.extendDeep({}, frameAttributes)
315+
};
316+
317+
formatAttributes(attrs);
318+
319+
return attrs.frames;
320+
}
321+
312322
function formatAttributes(attrs) {
313323
mergeValTypeAndRole(attrs);
314324
formatArrayContainers(attrs);

src/plots/frame_attributes.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
'use strict';
1010

1111
module.exports = {
12+
_isLinkedToArray: 'frames_entry',
13+
1214
group: {
1315
valType: 'string',
1416
role: 'info',
@@ -23,7 +25,8 @@ module.exports = {
2325
description: 'A label by which to identify the frame'
2426
},
2527
traces: {
26-
valType: 'data_array',
28+
valType: 'any',
29+
role: 'info',
2730
description: [
2831
'A list of trace indices that identify the respective traces in the',
2932
'data attribute'
@@ -39,14 +42,16 @@ module.exports = {
3942
].join(' ')
4043
},
4144
data: {
42-
valType: 'data_array',
45+
valType: 'any',
46+
role: 'object',
4347
description: [
4448
'A list of traces this frame modifies. The format is identical to the',
4549
'normal trace definition.'
4650
].join(' ')
4751
},
4852
layout: {
4953
valType: 'any',
54+
role: 'object',
5055
description: [
5156
'Layout properties which this frame modifies. The format is identical',
5257
'to the normal layout definition.'

test/jasmine/tests/plotschema_test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,11 @@ describe('plot schema', function() {
206206
expect(plotSchema.defs.metaKeys)
207207
.toEqual(['_isSubplotObj', '_isLinkedToArray', '_deprecated', 'description', 'role']);
208208
});
209+
210+
it('should list the correct frame attributes', function() {
211+
expect(plotSchema.frames).toBeDefined();
212+
expect(plotSchema.frames.role).toEqual('object');
213+
expect(plotSchema.frames.items.frames_entry).toBeDefined();
214+
expect(plotSchema.frames.items.frames_entry.role).toEqual('object');
215+
});
209216
});

0 commit comments

Comments
 (0)