Skip to content
12 changes: 12 additions & 0 deletions src/components/fx/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,17 @@ module.exports = {
].join(' ')
},
editType: 'none'
},
selectdirection: {
valType: 'enumerated',
role: 'info',
values: ['h', 'v', 'd', 'any'],
dflt: 'any',
description: [
'When "dragmode" is set to "select", this limits the selection of the drag to',
'horizontal, vertical or diagonal. "h" only allows horizontal selection,',
'"v" only vertical, "d" only diagonal and "any" sets no limit.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like 'd', I guess what it allows that 'any' doesn't is selecting regions that are very narrow in height or width, which would otherwise devolve to pure horizontal or vertical selections. Cool.

].join(' '),
editType: 'none'
}
};
1 change: 1 addition & 0 deletions src/components/fx/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
}

coerce('dragmode');
coerce('selectdirection', 'any');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the attribute has dflt: 'any' already, you do not need to include it here.


var hovermodeDflt;
if(layoutOut._has('cartesian')) {
Expand Down