@@ -64,16 +64,16 @@ describe('dc.lineChart', () => {
64
64
it ( 'should change the radius on mousemove' , ( ) => {
65
65
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
66
66
const dot = d3 . select ( this ) ;
67
- dot . on ( 'mousemove' ) . call ( this ) ;
67
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
68
68
expect ( dot . attr ( 'r' ) ) . toBe ( '5' ) ;
69
69
} ) ;
70
70
} ) ;
71
71
72
72
it ( 'should revert to original radius on mouseout' , ( ) => {
73
73
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
74
74
const dot = d3 . select ( this ) ;
75
- dot . on ( 'mousemove' ) . call ( this ) ;
76
- dot . on ( 'mouseout' ) . call ( this ) ;
75
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
76
+ dc . d3compat . callHandler ( dot . on ( 'mouseout' ) , this , { } ) ;
77
77
expect ( dot . attr ( 'r' ) ) . toBe ( '2' ) ;
78
78
} ) ;
79
79
} ) ;
@@ -93,7 +93,7 @@ describe('dc.lineChart', () => {
93
93
it ( 'should not change showing the data point on mousemove' , ( ) => {
94
94
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
95
95
const dot = d3 . select ( this ) ;
96
- dot . on ( 'mousemove' ) . call ( this ) ;
96
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
97
97
expect ( dot . style ( 'fill-opacity' ) ) . toBeWithinDelta ( 0.8 ) ;
98
98
expect ( dot . style ( 'stroke-opacity' ) ) . toBeWithinDelta ( 0.8 ) ;
99
99
} ) ;
@@ -102,8 +102,8 @@ describe('dc.lineChart', () => {
102
102
it ( 'should not change returning to extremely low opacity on hover out' , ( ) => {
103
103
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
104
104
const dot = d3 . select ( this ) ;
105
- dot . on ( 'mousemove' ) . call ( this ) ;
106
- dot . on ( 'mouseout' ) . call ( this ) ;
105
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
106
+ dc . d3compat . callHandler ( dot . on ( 'mouseout' ) , this , { } ) ;
107
107
expect ( dot . style ( 'fill-opacity' ) ) . toBeWithinDelta ( 1e-6 ) ;
108
108
expect ( dot . style ( 'stroke-opacity' ) ) . toBeWithinDelta ( 1e-6 ) ;
109
109
} ) ;
@@ -214,7 +214,7 @@ describe('dc.lineChart', () => {
214
214
it ( 'should become visible when hovered over' , ( ) => {
215
215
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
216
216
const dot = d3 . select ( this ) ;
217
- dot . on ( 'mousemove' ) . call ( this ) ;
217
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
218
218
expect ( dot . style ( 'fill-opacity' ) ) . toBeWithinDelta ( 0.8 ) ;
219
219
expect ( dot . style ( 'stroke-opacity' ) ) . toBeWithinDelta ( 0.8 ) ;
220
220
} ) ;
@@ -223,8 +223,8 @@ describe('dc.lineChart', () => {
223
223
it ( 'should return to extremely low opacity on hover out' , ( ) => {
224
224
chart . selectAll ( 'circle.dot' ) . each ( function ( ) {
225
225
const dot = d3 . select ( this ) ;
226
- dot . on ( 'mousemove' ) . call ( this ) ;
227
- dot . on ( 'mouseout' ) . call ( this ) ;
226
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , this , { } ) ;
227
+ dc . d3compat . callHandler ( dot . on ( 'mouseout' ) , this , { } ) ;
228
228
expect ( dot . style ( 'fill-opacity' ) ) . toBeWithinDelta ( 1e-6 ) ;
229
229
expect ( dot . style ( 'stroke-opacity' ) ) . toBeWithinDelta ( 1e-6 ) ;
230
230
} ) ;
@@ -252,7 +252,7 @@ describe('dc.lineChart', () => {
252
252
let x ;
253
253
beforeEach ( ( ) => {
254
254
const dot = chart . select ( 'circle.dot' ) ;
255
- dot . on ( 'mousemove' ) . call ( dot . nodes ( ) [ 0 ] ) ;
255
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , dot . nodes ( ) [ 0 ] , { } ) ;
256
256
x = dot . attr ( 'cx' ) ;
257
257
} ) ;
258
258
@@ -268,7 +268,7 @@ describe('dc.lineChart', () => {
268
268
let x ;
269
269
beforeEach ( ( ) => {
270
270
const dot = chart . select ( 'circle.dot' ) ;
271
- dot . on ( 'mousemove' ) . call ( dot . nodes ( ) [ 0 ] ) ;
271
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , dot . nodes ( ) [ 0 ] , { } ) ;
272
272
x = dot . attr ( 'cx' ) ;
273
273
} ) ;
274
274
@@ -284,7 +284,7 @@ describe('dc.lineChart', () => {
284
284
beforeEach ( ( ) => {
285
285
chart . useRightYAxis ( true ) . render ( ) ;
286
286
const dot = chart . select ( 'circle.dot' ) ;
287
- dot . on ( 'mousemove' ) . call ( dot . nodes ( ) [ 0 ] ) ;
287
+ dc . d3compat . callHandler ( dot . on ( 'mousemove' ) , dot . nodes ( ) [ 0 ] , { } ) ;
288
288
x = dot . attr ( 'cx' ) ;
289
289
} ) ;
290
290
@@ -617,7 +617,7 @@ describe('dc.lineChart', () => {
617
617
. render ( ) ;
618
618
619
619
firstItem = chart . select ( 'g.dc-legend g.dc-legend-item' ) ;
620
- firstItem . on ( 'mouseover' ) ( firstItem . datum ( ) ) ;
620
+ dc . d3compat . callHandler ( firstItem . on ( 'mouseover' ) , { } , null , firstItem . datum ( ) ) ;
621
621
} ) ;
622
622
623
623
describe ( 'when a legend item is hovered over' , ( ) => {
@@ -634,13 +634,13 @@ describe('dc.lineChart', () => {
634
634
635
635
describe ( 'when a legend item is hovered out' , ( ) => {
636
636
it ( 'should remove highlighting from corresponding lines and areas' , ( ) => {
637
- firstItem . on ( 'mouseout' ) ( firstItem . datum ( ) ) ;
637
+ dc . d3compat . callHandler ( firstItem . on ( 'mouseout' ) , null , { } , firstItem . datum ( ) ) ;
638
638
expect ( nthLine ( 0 ) . classed ( 'highlight' ) ) . toBeFalsy ( ) ;
639
639
expect ( nthArea ( 0 ) . classed ( 'highlight' ) ) . toBeFalsy ( ) ;
640
640
} ) ;
641
641
642
642
it ( 'should fade in non-corresponding lines and areas' , ( ) => {
643
- firstItem . on ( 'mouseout' ) ( firstItem . datum ( ) ) ;
643
+ dc . d3compat . callHandler ( firstItem . on ( 'mouseout' ) , null , { } , firstItem . datum ( ) ) ;
644
644
expect ( nthLine ( 1 ) . classed ( 'fadeout' ) ) . toBeFalsy ( ) ;
645
645
expect ( nthArea ( 1 ) . classed ( 'fadeout' ) ) . toBeFalsy ( ) ;
646
646
} ) ;
0 commit comments