File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ module.exports = function calc(gd, trace) {
149
149
else if ( xVals [ n ] !== xi ) uniqueValsPerX = false ;
150
150
}
151
151
if ( uniqueValsPerY ) {
152
- if ( yVals [ n ] === undefined ) yVals [ n ] = yi ;
153
- else if ( yVals [ n ] !== yi ) uniqueValsPerY = false ;
152
+ if ( yVals [ m ] === undefined ) yVals [ m ] = yi ;
153
+ else if ( yVals [ m ] !== yi ) uniqueValsPerY = false ;
154
154
}
155
155
156
156
xGapLow = Math . min ( xGapLow , xi - xEdges [ n ] ) ;
Original file line number Diff line number Diff line change @@ -1225,6 +1225,26 @@ describe('hover info', function() {
1225
1225
. then ( done ) ;
1226
1226
} ) ;
1227
1227
1228
+ it ( 'shows the data range when bins have multiple values (case 2)' , function ( done ) {
1229
+ var gd = createGraphDiv ( ) ;
1230
+
1231
+ Plotly . plot ( gd , [ {
1232
+ type : 'histogram2d' ,
1233
+ x : [ 'a' , 'b' , 'c' , 'a' ] ,
1234
+ y : [ 7 , 2 , 3 , 7 ] ,
1235
+ nbinsy : 3
1236
+ } ] , {
1237
+ width : 600 ,
1238
+ height : 600
1239
+ } )
1240
+ . then ( function ( ) {
1241
+ _hover ( gd , 250 , 200 ) ;
1242
+ assertHoverLabelContent ( { nums : [ 'x: b' , 'y: 4 - 5' , 'z: 0' ] . join ( '\n' ) } ) ;
1243
+ } )
1244
+ . catch ( failTest )
1245
+ . then ( done ) ;
1246
+ } ) ;
1247
+
1228
1248
it ( 'shows the exact data when bins have single values' , function ( done ) {
1229
1249
var gd = createGraphDiv ( ) ;
1230
1250
You can’t perform that action at this time.
0 commit comments