Skip to content

Commit

Permalink
more role removal
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Jan 20, 2021
1 parent 6b43933 commit 65da615
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/components/colorbar/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = overrideAll({
// TODO: only right is supported currently
// orient: {
// valType: 'enumerated',
// role: 'info',
// values: ['left', 'right', 'top', 'bottom'],
// dflt: 'right',
// description: [
Expand Down
12 changes: 3 additions & 9 deletions src/plot_api/plot_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ exports.get = function() {
return {
defs: {
valObjects: valObjectMeta,
metaKeys: UNDERSCORE_ATTRS.concat(['description', 'role', 'editType', 'impliedEdits']),
metaKeys: UNDERSCORE_ATTRS.concat(['description', 'editType', 'impliedEdits']),
editType: {
traces: editTypes.traces,
layout: editTypes.layout
Expand Down Expand Up @@ -600,14 +600,14 @@ function getFramesAttributes() {
}

function formatAttributes(attrs) {
mergeValTypeAndRole(attrs);
mergeValType(attrs);
formatArrayContainers(attrs);
stringify(attrs);

return attrs;
}

function mergeValTypeAndRole(attrs) {
function mergeValType(attrs) {
function makeSrcAttr(attrName) {
return {
valType: 'string',
Expand All @@ -622,17 +622,12 @@ function mergeValTypeAndRole(attrs) {
function callback(attr, attrName, attrs) {
if(exports.isValObject(attr)) {
if(attr.valType === 'data_array') {
// all 'data_array' attrs have role 'data'
attr.role = 'data';
// all 'data_array' attrs have a corresponding 'src' attr
attrs[attrName + 'src'] = makeSrcAttr(attrName);
} else if(attr.arrayOk === true) {
// all 'arrayOk' attrs have a corresponding 'src' attr
attrs[attrName + 'src'] = makeSrcAttr(attrName);
}
} else if(isPlainObject(attr)) {
// all attrs container objects get role 'object'
attr.role = 'object';
}
}

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

attrs[attrName] = { items: {} };
attrs[attrName].items[itemName] = attr;
attrs[attrName].role = 'object';
}

exports.crawl(attrs, callback);
Expand Down
1 change: 0 additions & 1 deletion src/traces/barpolar/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {

// orientation: {
// valType: 'enumerated',
// role: 'info',
// values: ['radial', 'angular'],
// editType: 'calc+clearAxisTypes',
// description: 'Sets the orientation of the bars.'
Expand Down
1 change: 0 additions & 1 deletion src/traces/streamtube/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ var attrs = {
// valType: 'enumerated',
// values: ['scaled', 'absolute', 'fixed'],
// dflt: 'scaled',
// role: 'info',
// editType: 'calc',
// description: [
// 'Sets the mode by which the streamtubes are sized.'
Expand Down

0 comments on commit 65da615

Please sign in to comment.