diff --git a/src/plot_api/plot_schema.js b/src/plot_api/plot_schema.js index 2be7c505d0b..2075674108a 100644 --- a/src/plot_api/plot_schema.js +++ b/src/plot_api/plot_schema.js @@ -69,7 +69,7 @@ exports.get = function() { transforms: transforms, - frames: formatAttributes(frameAttributes), + frames: getFramesAttributes(), animation: formatAttributes(animationAttributes) }; }; @@ -309,6 +309,16 @@ function getTransformAttributes(type) { }; } +function getFramesAttributes() { + var attrs = { + frames: Lib.extendDeep({}, frameAttributes) + }; + + formatAttributes(attrs); + + return attrs.frames; +} + function formatAttributes(attrs) { mergeValTypeAndRole(attrs); formatArrayContainers(attrs); diff --git a/src/plots/frame_attributes.js b/src/plots/frame_attributes.js index 494851379e6..cfb57e1b689 100644 --- a/src/plots/frame_attributes.js +++ b/src/plots/frame_attributes.js @@ -9,6 +9,8 @@ 'use strict'; module.exports = { + _isLinkedToArray: 'frames_entry', + group: { valType: 'string', role: 'info', @@ -23,7 +25,8 @@ module.exports = { description: 'A label by which to identify the frame' }, traces: { - valType: 'data_array', + valType: 'any', + role: 'info', description: [ 'A list of trace indices that identify the respective traces in the', 'data attribute' @@ -39,7 +42,8 @@ module.exports = { ].join(' ') }, data: { - valType: 'data_array', + valType: 'any', + role: 'object', description: [ 'A list of traces this frame modifies. The format is identical to the', 'normal trace definition.' @@ -47,6 +51,7 @@ module.exports = { }, layout: { valType: 'any', + role: 'object', description: [ 'Layout properties which this frame modifies. The format is identical', 'to the normal layout definition.' diff --git a/test/jasmine/tests/plotschema_test.js b/test/jasmine/tests/plotschema_test.js index 30523b88f33..b7b227bc8a0 100644 --- a/test/jasmine/tests/plotschema_test.js +++ b/test/jasmine/tests/plotschema_test.js @@ -206,4 +206,11 @@ describe('plot schema', function() { expect(plotSchema.defs.metaKeys) .toEqual(['_isSubplotObj', '_isLinkedToArray', '_deprecated', 'description', 'role']); }); + + it('should list the correct frame attributes', function() { + expect(plotSchema.frames).toBeDefined(); + expect(plotSchema.frames.role).toEqual('object'); + expect(plotSchema.frames.items.frames_entry).toBeDefined(); + expect(plotSchema.frames.items.frames_entry.role).toEqual('object'); + }); });