@@ -24,6 +24,10 @@ import {
2424 DEFAULT_LASSO_MIN_DELAY ,
2525 DEFAULT_LASSO_MIN_DIST ,
2626 DEFAULT_LASSO_CLEAR_EVENT ,
27+ DEFAULT_POINT_CONNECTION_OPACITY ,
28+ DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE ,
29+ DEFAULT_POINT_CONNECTION_SIZE ,
30+ DEFAULT_POINT_CONNECTION_SIZE_ACTIVE ,
2731 KEY_ACTION_LASSO ,
2832 KEY_ACTION_ROTATE ,
2933 SINGLE_CLICK_DELAY ,
@@ -630,7 +634,7 @@ test('set({ pointColor, pointColorActive, pointColorHover }) multiple colors', (
630634 scatterplot . destroy ( ) ;
631635} ) ;
632636
633- test ( 'set({ opacity })' , async ( t ) => {
637+ test ( 'set({ opacity, pointConnectionOpacity, pointConnectionOpacityActive })' , async ( t ) => {
634638 const scatterplot = createScatterplot ( { canvas : createCanvas ( ) } ) ;
635639
636640 let opacity = 0.5 ;
@@ -643,24 +647,68 @@ test('set({ opacity })', async (t) => {
643647 `opacity should be set to ${ opacity } `
644648 ) ;
645649
646- scatterplot . set ( { opacity : 0 } ) ;
650+ t . equal (
651+ scatterplot . get ( 'pointConnectionOpacity' ) ,
652+ DEFAULT_POINT_CONNECTION_OPACITY ,
653+ `pointConnectionOpacity should be set the default value (${ DEFAULT_POINT_CONNECTION_OPACITY } )`
654+ ) ;
655+
656+ t . equal (
657+ scatterplot . get ( 'pointConnectionOpacityActive' ) ,
658+ DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE ,
659+ `pointConnectionOpacityActive should be set the default value (${ DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE } )`
660+ ) ;
661+
662+ scatterplot . set ( {
663+ opacity : 0 ,
664+ pointConnectionOpacity : opacity ,
665+ pointConnectionOpacityActive : opacity ,
666+ } ) ;
647667
648668 t . equal (
649669 scatterplot . get ( 'opacity' ) ,
650670 opacity ,
651671 'opacity should not be nullifyable'
652672 ) ;
653673
674+ t . equal (
675+ scatterplot . get ( 'pointConnectionOpacity' ) ,
676+ opacity ,
677+ `pointConnectionOpacity should be set to ${ opacity } `
678+ ) ;
679+
680+ t . equal (
681+ scatterplot . get ( 'pointConnectionOpacityActive' ) ,
682+ opacity ,
683+ `pointConnectionOpacityActive should be set to ${ opacity } `
684+ ) ;
685+
654686 opacity = [ 0.5 , 0.75 , 1 ] ;
655687
656- scatterplot . set ( { opacity } ) ;
688+ scatterplot . set ( {
689+ opacity,
690+ pointConnectionOpacity : opacity ,
691+ pointConnectionOpacityActive : opacity ,
692+ } ) ;
657693
658694 t . equal (
659695 scatterplot . get ( 'opacity' ) ,
660696 opacity ,
661697 'should accept multiple opacities'
662698 ) ;
663699
700+ t . equal (
701+ scatterplot . get ( 'pointConnectionOpacity' ) ,
702+ opacity ,
703+ `pointConnectionOpacity should be set to ${ opacity } `
704+ ) ;
705+
706+ t . equal (
707+ scatterplot . get ( 'pointConnectionOpacityActive' ) ,
708+ 0.5 ,
709+ 'pointConnectionOpacityActive should **STILL BE** 0.5'
710+ ) ;
711+
664712 scatterplot . destroy ( ) ;
665713} ) ;
666714
@@ -772,7 +820,7 @@ test('set({ pointOutlineWidth })', async (t) => {
772820 scatterplot . destroy ( ) ;
773821} ) ;
774822
775- test ( 'set({ pointSize })' , async ( t ) => {
823+ test ( 'set({ pointSize, pointConnectionSize, pointConnectionSizeActive })' , async ( t ) => {
776824 const scatterplot = createScatterplot ( { canvas : createCanvas ( ) } ) ;
777825
778826 const pointSize = 42 ;
@@ -785,22 +833,66 @@ test('set({ pointSize })', async (t) => {
785833 `pointSize should be set to ${ pointSize } `
786834 ) ;
787835
788- scatterplot . set ( { pointSize : 0 } ) ;
836+ t . equal (
837+ scatterplot . get ( 'pointConnectionSize' ) ,
838+ DEFAULT_POINT_CONNECTION_SIZE ,
839+ `pointConnectionSize should be set the default value (${ DEFAULT_POINT_CONNECTION_SIZE } )`
840+ ) ;
841+
842+ t . equal (
843+ scatterplot . get ( 'pointConnectionSizeActive' ) ,
844+ DEFAULT_POINT_CONNECTION_SIZE_ACTIVE ,
845+ `pointConnectionSizeActive should be set the default value (${ DEFAULT_POINT_CONNECTION_SIZE_ACTIVE } )`
846+ ) ;
847+
848+ scatterplot . set ( {
849+ pointSize : 0 ,
850+ pointConnectionSize : pointSize ,
851+ pointConnectionSizeActive : pointSize ,
852+ } ) ;
789853
790854 t . equal (
791855 scatterplot . get ( 'pointSize' ) ,
792856 pointSize ,
793857 'pointSize should not be nullifyable'
794858 ) ;
795859
796- scatterplot . set ( { pointSize : [ 2 , 4 , 6 ] } ) ;
860+ t . equal (
861+ scatterplot . get ( 'pointConnectionSize' ) ,
862+ pointSize ,
863+ `pointConnectionSize should be set to ${ pointSize } `
864+ ) ;
865+
866+ t . equal (
867+ scatterplot . get ( 'pointConnectionSizeActive' ) ,
868+ pointSize ,
869+ `pointConnectionSizeActive should be set to ${ pointSize } `
870+ ) ;
871+
872+ scatterplot . set ( {
873+ pointSize : [ 2 , 4 , 6 ] ,
874+ pointConnectionSize : [ 2 , 4 , 6 ] ,
875+ pointConnectionSizeActive : [ 2 , 4 , 6 ] ,
876+ } ) ;
797877
798878 t . equal (
799879 scatterplot . get ( 'pointSize' ) ,
800880 [ 2 , 4 , 6 ] ,
801881 'pointSize should accept multiple sizes'
802882 ) ;
803883
884+ t . equal (
885+ scatterplot . get ( 'pointConnectionSize' ) ,
886+ [ 2 , 4 , 6 ] ,
887+ 'pointConnectionSize should accept multiple sizes'
888+ ) ;
889+
890+ t . equal (
891+ scatterplot . get ( 'pointConnectionSizeActive' ) ,
892+ pointSize ,
893+ `pointConnectionSize should **STILL BE** ${ pointSize } `
894+ ) ;
895+
804896 scatterplot . destroy ( ) ;
805897} ) ;
806898
0 commit comments