Skip to content

Commit 295c8ed

Browse files
committed
Revert "more role removal"
This reverts commit 65da615.
1 parent d3d8db7 commit 295c8ed

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

src/components/colorbar/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = overrideAll({
1818
// TODO: only right is supported currently
1919
// orient: {
2020
// valType: 'enumerated',
21+
// role: 'info',
2122
// values: ['left', 'right', 'top', 'bottom'],
2223
// dflt: 'right',
2324
// description: [

src/plot_api/plot_schema.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ exports.get = function() {
6363
return {
6464
defs: {
6565
valObjects: valObjectMeta,
66-
metaKeys: UNDERSCORE_ATTRS.concat(['description', 'editType', 'impliedEdits']),
66+
metaKeys: UNDERSCORE_ATTRS.concat(['description', 'role', 'editType', 'impliedEdits']),
6767
editType: {
6868
traces: editTypes.traces,
6969
layout: editTypes.layout
@@ -600,14 +600,14 @@ function getFramesAttributes() {
600600
}
601601

602602
function formatAttributes(attrs) {
603-
mergeValType(attrs);
603+
mergeValTypeAndRole(attrs);
604604
formatArrayContainers(attrs);
605605
stringify(attrs);
606606

607607
return attrs;
608608
}
609609

610-
function mergeValType(attrs) {
610+
function mergeValTypeAndRole(attrs) {
611611
function makeSrcAttr(attrName) {
612612
return {
613613
valType: 'string',
@@ -622,12 +622,17 @@ function mergeValType(attrs) {
622622
function callback(attr, attrName, attrs) {
623623
if(exports.isValObject(attr)) {
624624
if(attr.valType === 'data_array') {
625+
// all 'data_array' attrs have role 'data'
626+
attr.role = 'data';
625627
// all 'data_array' attrs have a corresponding 'src' attr
626628
attrs[attrName + 'src'] = makeSrcAttr(attrName);
627629
} else if(attr.arrayOk === true) {
628630
// all 'arrayOk' attrs have a corresponding 'src' attr
629631
attrs[attrName + 'src'] = makeSrcAttr(attrName);
630632
}
633+
} else if(isPlainObject(attr)) {
634+
// all attrs container objects get role 'object'
635+
attr.role = 'object';
631636
}
632637
}
633638

@@ -646,6 +651,7 @@ function formatArrayContainers(attrs) {
646651

647652
attrs[attrName] = { items: {} };
648653
attrs[attrName].items[itemName] = attr;
654+
attrs[attrName].role = 'object';
649655
}
650656

651657
exports.crawl(attrs, callback);

src/traces/barpolar/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424

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

src/traces/streamtube/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ var attrs = {
9595
// valType: 'enumerated',
9696
// values: ['scaled', 'absolute', 'fixed'],
9797
// dflt: 'scaled',
98+
// role: 'info',
9899
// editType: 'calc',
99100
// description: [
100101
// 'Sets the mode by which the streamtubes are sized.'

0 commit comments

Comments
 (0)