Skip to content

Commit 4efc5ae

Browse files
committed
adjustments to bring object role only
1 parent 655508a commit 4efc5ae

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

src/components/colorbar/attributes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = overrideAll({
1818
// TODO: only right is supported currently
1919
// orient: {
2020
// valType: 'enumerated',
21-
// role: 'info',
2221
// values: ['left', 'right', 'top', 'bottom'],
2322
// dflt: 'right',
2423
// description: [

src/plot_api/plot_schema.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,8 @@ function mergeValTypeAndRole(attrs) {
621621

622622
function callback(attr, attrName, attrs) {
623623
if(exports.isValObject(attr)) {
624-
if(attr.valType === 'data_array') {
625-
// all 'data_array' attrs have role 'data'
626-
attr.role = 'data';
627-
// all 'data_array' attrs have a corresponding 'src' attr
628-
attrs[attrName + 'src'] = makeSrcAttr(attrName);
629-
} else if(attr.arrayOk === true) {
630-
// all 'arrayOk' attrs have a corresponding 'src' attr
624+
if(attr.arrayOk === true || attr.valType === 'data_array') {
625+
// all 'arrayOk' and 'data_array' attrs have a corresponding 'src' attr
631626
attrs[attrName + 'src'] = makeSrcAttr(attrName);
632627
}
633628
} else if(isPlainObject(attr)) {

src/traces/barpolar/attributes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ module.exports = {
2424

2525
// orientation: {
2626
// valType: 'enumerated',
27-
// role: 'info',
2827
// values: ['radial', 'angular'],
2928
// editType: 'calc+clearAxisTypes',
3029
// description: 'Sets the orientation of the bars.'

src/traces/streamtube/attributes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ var attrs = {
9595
// valType: 'enumerated',
9696
// values: ['scaled', 'absolute', 'fixed'],
9797
// dflt: 'scaled',
98-
// role: 'info',
9998
// editType: 'calc',
10099
// description: [
101100
// 'Sets the mode by which the streamtubes are sized.'

tasks/compress_attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ module.exports = function() {
4848
.replace(makeJoinedArrayRegex('description'), '')
4949
.replace(makeArrayRegex('requiredOpts'), '')
5050
.replace(makeArrayRegex('otherOpts'), '')
51+
.replace(makeStringRegex('role'), '')
5152
.replace(makeStringRegex('hrName'), '')
5253
);
5354
done();

test/jasmine/bundle_tests/plotschema_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('plot schema', function() {
2525
var isPlainObject = Lib.isPlainObject;
2626

2727
var VALTYPES = Object.keys(valObjects);
28-
var ROLES = ['info', 'style', 'data'];
28+
var deprecatedRoles = ['info', 'style', 'data'];
2929
var editType = plotSchema.defs.editType;
3030

3131
function assertTraceSchema(callback) {
@@ -73,11 +73,11 @@ describe('plot schema', function() {
7373
);
7474
});
7575

76-
it('all attributes should only have valid `role`', function() {
76+
it('all attributes should not have valid a deprecated `role`', function() {
7777
assertPlotSchema(
7878
function(attr) {
7979
if(isValObject(attr)) {
80-
expect(ROLES.indexOf(attr.role) !== -1).toBe(true, attr);
80+
expect(deprecatedRoles.indexOf(attr.role) === -1).toBe(true, attr);
8181
}
8282
}
8383
);
@@ -223,7 +223,7 @@ describe('plot schema', function() {
223223
);
224224
});
225225

226-
it('deprecated attributes should have a `valType` and `role`', function() {
226+
it('deprecated attributes should have a `valType` and not any deprecated roles', function() {
227227
var DEPRECATED = '_deprecated';
228228

229229
assertPlotSchema(
@@ -234,7 +234,7 @@ describe('plot schema', function() {
234234

235235
expect(VALTYPES.indexOf(dAttr.valType) !== -1)
236236
.toBe(true, attrString + ': ' + dAttrName);
237-
expect(ROLES.indexOf(dAttr.role) !== -1)
237+
expect(deprecatedRoles.indexOf(dAttr.role) === -1)
238238
.toBe(true, attrString + ': ' + dAttrName);
239239
});
240240
}

test/jasmine/tests/plot_api_test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,8 +2877,7 @@ describe('plot_api edit_types', function() {
28772877

28782878
editTypes.update(flags, {
28792879
valType: 'boolean',
2880-
dflt: true,
2881-
role: 'style'
2880+
dflt: true
28822881
});
28832882

28842883
expect(flags).toEqual({calc: false, style: true});
@@ -2898,8 +2897,7 @@ describe('plot_api edit_types', function() {
28982897
editTypes.update(flags, {
28992898
editType: 'calc+style',
29002899
valType: 'number',
2901-
dflt: 1,
2902-
role: 'style'
2900+
dflt: 1
29032901
});
29042902

29052903
expect(flags).toEqual({calc: true, legend: true, style: true});

0 commit comments

Comments
 (0)