File tree Expand file tree Collapse file tree 2 files changed +21
-79
lines changed Expand file tree Collapse file tree 2 files changed +21
-79
lines changed Original file line number Diff line number Diff line change @@ -383,77 +383,37 @@ module.exports = {
383
383
valType : 'number' ,
384
384
min : 0 ,
385
385
max : 1 ,
386
- arrayOk : true ,
387
386
role : 'style' ,
388
387
editType : 'style' ,
389
388
description : 'Sets the marker opacity of selected points.'
390
389
} ,
391
- size : {
392
- valType : 'number' ,
393
- min : 0 ,
394
- dflt : 6 ,
395
- arrayOk : true ,
390
+ color : {
391
+ valType : 'color' ,
396
392
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
+ } )
417
397
} ,
418
398
unselected : {
419
399
marker : extendFlat ( {
420
400
opacity : {
421
401
valType : 'number' ,
422
402
min : 0 ,
423
403
max : 1 ,
424
- dflt : 0.5 ,
425
- arrayOk : true ,
426
404
role : 'style' ,
427
405
editType : 'style' ,
428
406
description : 'Sets the marker opacity of unselected points, applied only when a selection exists.'
429
407
} ,
430
- size : {
431
- valType : 'number' ,
432
- min : 0 ,
433
- dflt : 6 ,
434
- arrayOk : true ,
408
+ color : {
409
+ valType : 'color' ,
435
410
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
+ } )
456
415
} ,
416
+
457
417
selectedpoints : {
458
418
valType : 'any' ,
459
419
role : 'info' ,
@@ -466,18 +426,7 @@ module.exports = {
466
426
editType : 'calc' ,
467
427
description : 'Array containing `ids` of selected points.' ,
468
428
} ,
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
+
481
430
textposition : {
482
431
valType : 'enumerated' ,
483
432
values : [
Original file line number Diff line number Diff line change @@ -13,44 +13,37 @@ var Lib = require('../../lib');
13
13
var isNumeric = require ( 'fast-isnumeric' ) ;
14
14
15
15
module . exports = function supplyInteractionDefaults ( traceIn , traceOut , coerce ) {
16
-
17
16
function coerceInteractionDefault ( attr , containsNumbers ) {
18
17
var i , arr ;
19
18
20
- if ( ! Array . isArray ( traceIn [ attr ] ) ) {
21
- return ;
22
- }
23
- coerce ( attr ) ;
19
+ if ( ! Array . isArray ( traceIn [ attr ] ) ) return ;
24
20
21
+ coerce ( attr ) ;
25
22
arr = traceOut [ attr ] ;
26
23
27
- console . log ( 'arr:' , arr ) ;
28
-
29
24
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 ] ) ) {
32
27
arr . splice ( i , 1 ) ;
33
28
} else {
34
29
arr [ i ] = + arr [ i ] ;
35
30
}
36
31
}
37
32
} 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 ] ) {
40
35
arr . splice ( i , 1 ) ;
41
36
} else {
42
37
arr [ i ] = String ( arr [ i ] ) ;
43
38
}
44
39
}
45
40
}
46
41
47
- if ( arr . length === 0 ) {
42
+ if ( arr . length === 0 ) {
48
43
delete traceOut [ attr ] ;
49
44
}
50
45
}
51
46
52
47
coerceInteractionDefault ( 'selectedpoints' , true ) ;
53
48
coerceInteractionDefault ( 'selectedids' ) ;
54
- coerceInteractionDefault ( 'hoverpoints' , true ) ;
55
- coerceInteractionDefault ( 'hoverids' ) ;
56
49
} ;
You can’t perform that action at this time.
0 commit comments