@@ -311,9 +311,7 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
311
311
// categorySelection.select('rect.catrect')
312
312
categorySelection . selectAll ( 'rect.bandrect' )
313
313
. on ( 'mouseover' , mouseoverCategoryBand )
314
- . on ( 'mouseout' , function ( d ) {
315
- mouseoutCategory ( d . parcatsViewModel ) ;
316
- } ) ;
314
+ . on ( 'mouseout' , mouseoutCategory ) ;
317
315
318
316
// Remove unused categories
319
317
categorySelection . exit ( ) . remove ( ) ;
@@ -481,6 +479,12 @@ function mouseoutPath(d) {
481
479
482
480
// Restore path order
483
481
d . parcatsViewModel . pathSelection . sort ( compareRawColor ) ;
482
+
483
+ // Emit unhover event
484
+ if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'skip' ) === - 1 ) {
485
+ var points = buildPointsArrayForPath ( d ) ;
486
+ d . parcatsViewModel . graphDiv . emit ( 'plotly_unhover' , { points : points , event : d3 . event } ) ;
487
+ }
484
488
}
485
489
}
486
490
@@ -930,11 +934,14 @@ function mouseoverCategoryBand(bandViewModel) {
930
934
}
931
935
}
932
936
937
+
933
938
/**
934
- * Handle dimension mouseout
935
- * @param {ParcatsViewModel } parcatsViewModel
939
+ * Handle dimension mouseover
940
+ * @param {CategoryBandViewModel } bandViewModel
936
941
*/
937
- function mouseoutCategory ( parcatsViewModel ) {
942
+ function mouseoutCategory ( bandViewModel ) {
943
+
944
+ var parcatsViewModel = bandViewModel . parcatsViewModel ;
938
945
939
946
if ( ! parcatsViewModel . dragDimension ) {
940
947
// We're not dragging anything
@@ -949,6 +956,21 @@ function mouseoutCategory(parcatsViewModel) {
949
956
950
957
// Restore path order
951
958
parcatsViewModel . pathSelection . sort ( compareRawColor ) ;
959
+
960
+ // Emit unhover event
961
+ if ( parcatsViewModel . hoverinfoItems . indexOf ( 'skip' ) === - 1 ) {
962
+
963
+ var hovermode = bandViewModel . parcatsViewModel . hovermode ;
964
+ var bandElement = this ;
965
+
966
+ // Handle style and events
967
+ if ( hovermode === 'color' ) {
968
+ emitPointsEventColorHovermode ( bandElement , 'plotly_unhover' , d3 . event ) ;
969
+ } else {
970
+ console . log ( 'mouseoutCategory: ' + hovermode ) ;
971
+ emitPointsEventCategoryHovermode ( bandElement , 'plotly_unhover' , d3 . event ) ;
972
+ }
973
+ }
952
974
}
953
975
}
954
976
0 commit comments