Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a7531a

Browse files
committed
remove some stuff we (probably) won't implement in this PR
1 parent b209a55 commit 2a7531a

File tree

2 files changed

+21
-79
lines changed

2 files changed

+21
-79
lines changed

src/traces/scatter/attributes.js

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -383,77 +383,37 @@ module.exports = {
383383
valType: 'number',
384384
min: 0,
385385
max: 1,
386-
arrayOk: true,
387386
role: 'style',
388387
editType: 'style',
389388
description: 'Sets the marker opacity of selected points.'
390389
},
391-
size: {
392-
valType: 'number',
393-
min: 0,
394-
dflt: 6,
395-
arrayOk: true,
390+
color: {
391+
valType: 'color',
396392
role: 'style',
397-
editType: 'calcIfAutorange',
398-
description: 'Sets the marker size (in px) of selected points.'
399-
},
400-
line: extendFlat({
401-
width: {
402-
valType: 'number',
403-
min: 0,
404-
arrayOk: true,
405-
role: 'style',
406-
editType: 'style',
407-
description: 'Sets the width (in px) of the lines bounding selected marker points.'
408-
},
409-
editType: 'calc'
410-
},
411-
colorAttributes('marker.line')
412-
),
413-
editType: 'calc'
414-
},
415-
colorAttributes('marker')
416-
)
393+
editType: 'style',
394+
description: 'Sets the marker color of selected points.'
395+
}
396+
})
417397
},
418398
unselected: {
419399
marker: extendFlat({
420400
opacity: {
421401
valType: 'number',
422402
min: 0,
423403
max: 1,
424-
dflt: 0.5,
425-
arrayOk: true,
426404
role: 'style',
427405
editType: 'style',
428406
description: 'Sets the marker opacity of unselected points, applied only when a selection exists.'
429407
},
430-
size: {
431-
valType: 'number',
432-
min: 0,
433-
dflt: 6,
434-
arrayOk: true,
408+
color: {
409+
valType: 'color',
435410
role: 'style',
436-
editType: 'calcIfAutorange',
437-
description: 'Sets the marker size (in px) of unselected points.'
438-
},
439-
line: extendFlat({
440-
width: {
441-
valType: 'number',
442-
min: 0,
443-
arrayOk: true,
444-
role: 'style',
445-
editType: 'style',
446-
description: 'Sets the width (in px) of the lines bounding unselected marker points.'
447-
},
448-
editType: 'calc'
449-
},
450-
colorAttributes('marker.line')
451-
),
452-
editType: 'calc'
453-
},
454-
colorAttributes('marker')
455-
)
411+
editType: 'style',
412+
description: 'Sets the marker color of unselected points, applied only when a selection exists.'
413+
}
414+
})
456415
},
416+
457417
selectedpoints: {
458418
valType: 'any',
459419
role: 'info',
@@ -466,18 +426,7 @@ module.exports = {
466426
editType: 'calc',
467427
description: 'Array containing `ids` of selected points.',
468428
},
469-
hoverpoints: {
470-
valType: 'any',
471-
role: 'info',
472-
editType: 'calc',
473-
description: 'Array containing integer indices of hovered points.',
474-
},
475-
hoverids: {
476-
valType: 'any',
477-
role: 'info',
478-
editType: 'calc',
479-
description: 'Array containing `ids` of hovered points.',
480-
},
429+
481430
textposition: {
482431
valType: 'enumerated',
483432
values: [

src/traces/scatter/interaction_defaults.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,37 @@ var Lib = require('../../lib');
1313
var isNumeric = require('fast-isnumeric');
1414

1515
module.exports = function supplyInteractionDefaults (traceIn, traceOut, coerce) {
16-
1716
function coerceInteractionDefault(attr, containsNumbers) {
1817
var i, arr;
1918

20-
if (!Array.isArray(traceIn[attr])) {
21-
return;
22-
}
23-
coerce(attr);
19+
if(!Array.isArray(traceIn[attr])) return;
2420

21+
coerce(attr);
2522
arr = traceOut[attr];
2623

27-
console.log('arr:', arr);
28-
2924
if (containsNumbers) {
30-
for (i = arr.length - 1; i >= 0; i--) {
31-
if (!isNumeric(arr[i])) {
25+
for(i = arr.length - 1; i >= 0; i--) {
26+
if(!isNumeric(arr[i])) {
3227
arr.splice(i, 1);
3328
} else {
3429
arr[i] = +arr[i];
3530
}
3631
}
3732
} else { // only other implemented is integer:
38-
for (i = arr.length - 1; i >= 0; i--) {
39-
if (!arr[i]) {
33+
for(i = arr.length - 1; i >= 0; i--) {
34+
if(!arr[i]) {
4035
arr.splice(i, 1);
4136
} else {
4237
arr[i] = String(arr[i]);
4338
}
4439
}
4540
}
4641

47-
if (arr.length === 0) {
42+
if(arr.length === 0) {
4843
delete traceOut[attr];
4944
}
5045
}
5146

5247
coerceInteractionDefault('selectedpoints', true);
5348
coerceInteractionDefault('selectedids');
54-
coerceInteractionDefault('hoverpoints', true);
55-
coerceInteractionDefault('hoverids');
5649
};

0 commit comments

Comments
 (0)