Skip to content

Commit 1030542

Browse files
committed
dimension.multiselect boolean attr
1 parent 367e294 commit 1030542

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

src/traces/parcoords/attributes.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module.exports = {
4343
editType: 'calc',
4444
description: 'The shown name of the dimension.'
4545
},
46+
// TODO: better way to determine ordinal vs continuous axes,
47+
// so users can use tickvals/ticktext with a continuous axis.
4648
tickvals: extendFlat({}, axesAttrs.tickvals, {editType: 'calc'}),
4749
ticktext: extendFlat({}, axesAttrs.ticktext, {editType: 'calc'}),
4850
tickformat: {
@@ -103,6 +105,13 @@ module.exports = {
103105
'of `[fromValue, toValue]` with finite numbers as elements.'
104106
].join(' ')
105107
},
108+
multiselect: {
109+
valType: 'boolean',
110+
dflt: true,
111+
role: 'info',
112+
editType: 'calc',
113+
description: 'Do we allow multiple selection ranges or just a single range?'
114+
},
106115
values: {
107116
valType: 'data_array',
108117
role: 'info',

src/traces/parcoords/axisbrush.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ function attachDragBehavior(selection) {
271271
s.grabPoint = d.unitScaleInOrder(unitLocation) - pixelRange[0] - c.verticalPadding;
272272
s.barLength = pixelRange[1] - pixelRange[0];
273273
s.grabbingBar = active && intData.m && unitRange;
274-
s.stayingIntervals = barInteraction
274+
s.stayingIntervals = !d.multiselect ? [] :
275+
barInteraction
275276
? b.filter.get().filter(differentInterval(unitRange))
276277
: b.filter.get(); // keep all preexisting bars if interaction wasn't a barInteraction
277278
var grabbingBarNorth = intData.n;

src/traces/parcoords/defaults.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ function dimensionsDefaults(traceIn, traceOut) {
6060
coerce('ticktext');
6161
coerce('tickformat');
6262
coerce('range');
63+
64+
coerce('multiselect');
6365
coerce('constraintrange');
6466

6567
commonLength = Math.min(commonLength, dimensionOut.values.length);

src/traces/parcoords/parcoords.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ function viewModel(state, callbacks, model) {
224224
tickvals: dimension.tickvals,
225225
ticktext: dimension.ticktext,
226226
ordinal: !!dimension.tickvals,
227+
multiselect: dimension.multiselect,
227228
xIndex: i,
228229
crossfilterDimensionIndex: i,
229230
visibleIndex: dimension._index,

0 commit comments

Comments
 (0)