@@ -210,14 +210,14 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
210
210
. attr ( 'cursor' ,
211
211
/** @param {CategoryBandViewModel } bandModel*/
212
212
function ( bandModel ) {
213
- if ( bandModel . parcatsViewModel . arrangement === 'fixed' ) {
214
- return 'default'
215
- } else if ( bandModel . parcatsViewModel . arrangement === 'perpendicular' ) {
216
- return 'ns-resize'
213
+ if ( bandModel . parcatsViewModel . arrangement === 'fixed' ) {
214
+ return 'default' ;
215
+ } else if ( bandModel . parcatsViewModel . arrangement === 'perpendicular' ) {
216
+ return 'ns-resize' ;
217
217
} else {
218
- return 'move'
219
- }
220
- } ) ;
218
+ return 'move' ;
219
+ }
220
+ } ) ;
221
221
222
222
styleBandsNoHover ( bandsSelectionEnter ) ;
223
223
@@ -267,7 +267,7 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
267
267
} )
268
268
. each (
269
269
/** @param {CategoryViewModel } catModel*/
270
- function ( catModel ) {
270
+ function ( catModel ) {
271
271
Drawing . font ( d3 . select ( this ) , catModel . parcatsViewModel . categorylabelfont ) ;
272
272
} ) ;
273
273
@@ -283,10 +283,10 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
283
283
. attr ( 'cursor' ,
284
284
/** @param {CategoryViewModel } catModel*/
285
285
function ( catModel ) {
286
- if ( catModel . parcatsViewModel . arrangement === 'fixed' ) {
286
+ if ( catModel . parcatsViewModel . arrangement === 'fixed' ) {
287
287
return 'default' ;
288
288
} else {
289
- return 'ew-resize'
289
+ return 'ew-resize' ;
290
290
}
291
291
} )
292
292
. attr ( 'x' , function ( d ) {
@@ -303,7 +303,7 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
303
303
} )
304
304
. each (
305
305
/** @param {CategoryViewModel } catModel*/
306
- function ( catModel ) {
306
+ function ( catModel ) {
307
307
Drawing . font ( d3 . select ( this ) , catModel . parcatsViewModel . labelfont ) ;
308
308
} ) ;
309
309
@@ -436,10 +436,10 @@ function mouseoverPath(d) {
436
436
437
437
// Build hover text
438
438
var hovertextParts = [ ] ;
439
- if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
439
+ if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
440
440
hovertextParts . push ( [ 'Count:' , d . model . count ] . join ( ' ' ) ) ;
441
441
}
442
- if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
442
+ if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
443
443
hovertextParts . push ( [ 'P:' , ( d . model . count / d . parcatsViewModel . model . count ) . toFixed ( 3 ) ] . join ( ' ' ) ) ;
444
444
}
445
445
@@ -513,7 +513,7 @@ function buildPointsArrayForPath(d) {
513
513
* @param {PathViewModel } d
514
514
*/
515
515
function clickPath ( d ) {
516
- if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'skip' ) === - 1 ) {
516
+ if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'skip' ) === - 1 ) {
517
517
// hoverinfo it's skip, so interaction events aren't disabled
518
518
var points = buildPointsArrayForPath ( d ) ;
519
519
d . parcatsViewModel . graphDiv . emit ( 'plotly_click' , { points : points , event : d3 . event } ) ;
@@ -729,13 +729,13 @@ function createHoverLabelForCategoryHovermode(rootBBox, bandElement) {
729
729
730
730
// Hover label text
731
731
var hoverinfoParts = [ ] ;
732
- if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
733
- hoverinfoParts . push ( [ 'Count:' , catViewModel . model . count ] . join ( ' ' ) )
732
+ if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
733
+ hoverinfoParts . push ( [ 'Count:' , catViewModel . model . count ] . join ( ' ' ) ) ;
734
734
}
735
- if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
735
+ if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
736
736
hoverinfoParts . push ( [
737
737
'P(' + catViewModel . model . categoryLabel + '):' ,
738
- ( catViewModel . model . count / catViewModel . parcatsViewModel . model . count ) . toFixed ( 3 ) ] . join ( ' ' ) )
738
+ ( catViewModel . model . count / catViewModel . parcatsViewModel . model . count ) . toFixed ( 3 ) ] . join ( ' ' ) ) ;
739
739
}
740
740
741
741
var hovertext = hoverinfoParts . join ( '<br>' ) ;
@@ -773,7 +773,7 @@ function createHoverLabelForDimensionHovermode(rootBBox, bandElement) {
773
773
allHoverlabels . push ( createHoverLabelForCategoryHovermode ( rootBBox , bandNode ) ) ;
774
774
} ) ;
775
775
776
- return allHoverlabels
776
+ return allHoverlabels ;
777
777
}
778
778
779
779
/**
@@ -837,10 +837,10 @@ function createHoverLabelForColorHovermode(rootBBox, bandElement) {
837
837
838
838
// Hover label text
839
839
var hoverinfoParts = [ ] ;
840
- if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
841
- hoverinfoParts . push ( [ 'Count:' , bandColorCount ] . join ( ' ' ) )
840
+ if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'count' ) !== - 1 ) {
841
+ hoverinfoParts . push ( [ 'Count:' , bandColorCount ] . join ( ' ' ) ) ;
842
842
}
843
- if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
843
+ if ( catViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'probability' ) !== - 1 ) {
844
844
var pColorAndCatLable = 'P(color ∩ ' + catLabel + '): ' ;
845
845
var pColorAndCatValue = ( bandColorCount / totalCount ) . toFixed ( 3 ) ;
846
846
var pColorAndCatRow = pColorAndCatLable + pColorAndCatValue ;
@@ -889,7 +889,7 @@ function mouseoverCategoryBand(bandViewModel) {
889
889
890
890
// Mouse
891
891
var mouseY = d3 . mouse ( this ) [ 1 ] ;
892
- if ( mouseY < - 1 ) {
892
+ if ( mouseY < - 1 ) {
893
893
// Hover is above above the category rectangle (probably the dimension title text)
894
894
return ;
895
895
}
@@ -903,7 +903,7 @@ function mouseoverCategoryBand(bandViewModel) {
903
903
var bandElement = this ;
904
904
905
905
// Handle style and events
906
- if ( hovermode === 'color' ) {
906
+ if ( hovermode === 'color' ) {
907
907
styleForColorHovermode ( bandElement ) ;
908
908
emitPointsEventColorHovermode ( bandElement , 'plotly_hover' , d3 . event ) ;
909
909
} else {
@@ -914,15 +914,15 @@ function mouseoverCategoryBand(bandViewModel) {
914
914
// Handle hover label
915
915
if ( bandViewModel . parcatsViewModel . hoverinfoItems . indexOf ( 'none' ) === - 1 ) {
916
916
var hoverItems ;
917
- if ( hovermode === 'category' ) {
917
+ if ( hovermode === 'category' ) {
918
918
hoverItems = createHoverLabelForCategoryHovermode ( rootBBox , bandElement ) ;
919
- } else if ( hovermode === 'color' ) {
919
+ } else if ( hovermode === 'color' ) {
920
920
hoverItems = createHoverLabelForColorHovermode ( rootBBox , bandElement ) ;
921
- } else if ( hovermode === 'dimension' ) {
921
+ } else if ( hovermode === 'dimension' ) {
922
922
hoverItems = createHoverLabelForDimensionHovermode ( rootBBox , bandElement ) ;
923
923
}
924
924
925
- if ( hoverItems ) {
925
+ if ( hoverItems ) {
926
926
Fx . multiHovers ( hoverItems , {
927
927
container : fullLayout . _hoverlayer . node ( ) ,
928
928
outerContainer : fullLayout . _paper . node ( ) ,
@@ -964,10 +964,9 @@ function mouseoutCategory(bandViewModel) {
964
964
var bandElement = this ;
965
965
966
966
// Handle style and events
967
- if ( hovermode === 'color' ) {
967
+ if ( hovermode === 'color' ) {
968
968
emitPointsEventColorHovermode ( bandElement , 'plotly_unhover' , d3 . event ) ;
969
969
} else {
970
- console . log ( 'mouseoutCategory: ' + hovermode ) ;
971
970
emitPointsEventCategoryHovermode ( bandElement , 'plotly_unhover' , d3 . event ) ;
972
971
}
973
972
}
@@ -982,8 +981,8 @@ function mouseoutCategory(bandViewModel) {
982
981
function dragDimensionStart ( d ) {
983
982
984
983
// Check if dragging is supported
985
- if ( d . parcatsViewModel . arrangement === 'fixed' ) {
986
- return
984
+ if ( d . parcatsViewModel . arrangement === 'fixed' ) {
985
+ return ;
987
986
}
988
987
989
988
// Save off initial drag indexes for dimension
@@ -1044,8 +1043,8 @@ function dragDimensionStart(d) {
1044
1043
function dragDimension ( d ) {
1045
1044
1046
1045
// Check if dragging is supported
1047
- if ( d . parcatsViewModel . arrangement === 'fixed' ) {
1048
- return
1046
+ if ( d . parcatsViewModel . arrangement === 'fixed' ) {
1047
+ return ;
1049
1048
}
1050
1049
1051
1050
d . dragHasMoved = true ;
@@ -1103,24 +1102,24 @@ function dragDimension(d) {
1103
1102
}
1104
1103
1105
1104
// Update dimension position
1106
- if ( d . dragCategoryDisplayInd === null || d . parcatsViewModel . arrangement === 'freeform' ) {
1105
+ if ( d . dragCategoryDisplayInd === null || d . parcatsViewModel . arrangement === 'freeform' ) {
1107
1106
dragDimension . model . dragX = d3 . event . x ;
1108
1107
1109
1108
// Check for dimension swaps
1110
1109
var prevDimension = d . parcatsViewModel . dimensions [ prevDimInd ] ;
1111
1110
var nextDimension = d . parcatsViewModel . dimensions [ nextDimInd ] ;
1112
1111
1113
- if ( prevDimension !== undefined ) {
1114
- if ( dragDimension . model . dragX < ( prevDimension . x + prevDimension . width ) ) {
1112
+ if ( prevDimension !== undefined ) {
1113
+ if ( dragDimension . model . dragX < ( prevDimension . x + prevDimension . width ) ) {
1115
1114
1116
1115
// Swap display inds
1117
1116
dragDimension . model . displayInd = prevDimension . model . displayInd ;
1118
1117
prevDimension . model . displayInd = dragDimInd ;
1119
1118
}
1120
1119
}
1121
1120
1122
- if ( nextDimension !== undefined ) {
1123
- if ( ( dragDimension . model . dragX + dragDimension . width ) > nextDimension . x ) {
1121
+ if ( nextDimension !== undefined ) {
1122
+ if ( ( dragDimension . model . dragX + dragDimension . width ) > nextDimension . x ) {
1124
1123
1125
1124
// Swap display inds
1126
1125
dragDimension . model . displayInd = nextDimension . model . displayInd ;
@@ -1149,8 +1148,8 @@ function dragDimension(d) {
1149
1148
function dragDimensionEnd ( d ) {
1150
1149
1151
1150
// Check if dragging is supported
1152
- if ( d . parcatsViewModel . arrangement === 'fixed' ) {
1153
- return
1151
+ if ( d . parcatsViewModel . arrangement === 'fixed' ) {
1152
+ return ;
1154
1153
}
1155
1154
1156
1155
if ( d . dragDimensionDisplayInd === null ) {
@@ -1192,11 +1191,11 @@ function dragDimensionEnd(d) {
1192
1191
1193
1192
// Sort a shallow copy of the category models by display index
1194
1193
var sortedCategoryModels = d . model . categories . slice ( ) . sort (
1195
- function ( a , b ) { return a . displayInd - b . displayInd } ) ;
1194
+ function ( a , b ) { return a . displayInd - b . displayInd ; } ) ;
1196
1195
1197
1196
// Get new categoryarray and categorylabels values
1198
- var newCategoryArray = sortedCategoryModels . map ( function ( v ) { return v . categoryValue } ) ;
1199
- var newCategoryLabels = sortedCategoryModels . map ( function ( v ) { return v . categoryLabel } ) ;
1197
+ var newCategoryArray = sortedCategoryModels . map ( function ( v ) { return v . categoryValue ; } ) ;
1198
+ var newCategoryLabels = sortedCategoryModels . map ( function ( v ) { return v . categoryLabel ; } ) ;
1200
1199
1201
1200
restyleData [ 'dimensions[' + d . model . containerInd + '].categoryarray' ] = [ newCategoryArray ] ;
1202
1201
restyleData [ 'dimensions[' + d . model . containerInd + '].categorylabels' ] = [ newCategoryLabels ] ;
@@ -1207,8 +1206,8 @@ function dragDimensionEnd(d) {
1207
1206
// Handle potential click event
1208
1207
// ----------------------------
1209
1208
if ( d . parcatsViewModel . hoverinfoItems . indexOf ( 'skip' ) === - 1 ) {
1210
- if ( ! d . dragHasMoved && d . potentialClickBand ) {
1211
- if ( d . parcatsViewModel . hovermode === 'color' ) {
1209
+ if ( ! d . dragHasMoved && d . potentialClickBand ) {
1210
+ if ( d . parcatsViewModel . hovermode === 'color' ) {
1212
1211
emitPointsEventColorHovermode ( d . potentialClickBand , 'plotly_click' , d3 . event . sourceEvent ) ;
1213
1212
} else {
1214
1213
emitPointsEventCategoryHovermode ( d . potentialClickBand , 'plotly_click' , d3 . event . sourceEvent ) ;
@@ -1455,7 +1454,7 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {
1455
1454
// Handle hover info
1456
1455
// -----------------
1457
1456
var hoverinfoItems ;
1458
- if ( trace . hoverinfo === 'all' ) {
1457
+ if ( trace . hoverinfo === 'all' ) {
1459
1458
hoverinfoItems = [ 'count' , 'probability' ] ;
1460
1459
} else {
1461
1460
hoverinfoItems = trace . hoverinfo . split ( '+' ) ;
0 commit comments