Skip to content

Commit 0aa87c9

Browse files
committed
fix hover for traces w/ colorbar w/ set ticktext tickvals
- don't include point values of 1d array attributes when pointNumber is 2d in appendArrayPointValue. - note that 1d array attributes (e.g. `x` and `y`) can still be set in the `module.hoverPoints`.
1 parent fd17e6f commit 0aa87c9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/fx/helpers.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,14 @@ exports.appendArrayPointValue = function(pointData, trace, pointNumber) {
108108

109109
if(pointData[key] === undefined) {
110110
var val = Lib.nestedProperty(trace, astr).get();
111-
pointData[key] = Array.isArray(pointNumber) ?
112-
val[pointNumber[0]][pointNumber[1]] :
113-
val[pointNumber];
111+
112+
if(Array.isArray(pointNumber)) {
113+
if(Array.isArray(val) && Array.isArray(val[0])) {
114+
pointData[key] = val[pointNumber[0]][pointNumber[1]];
115+
}
116+
} else {
117+
pointData[key] = val[pointNumber];
118+
}
114119
}
115120
}
116121
};

0 commit comments

Comments
 (0)