Skip to content

Commit ff60f21

Browse files
committed
replace d3.mouse in parcats hover to work around firefox bug (plotly#5607)
1 parent c80ce55 commit ff60f21

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/traces/parcats/parcats.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ function mouseoverPath(d) {
399399
// hoverinfo is a combination of 'count' and 'probability'
400400

401401
// Mouse
402-
var hoverX = d3.mouse(this)[0];
402+
var hoverX = Lib.getPositionFromD3Event()[0];
403403

404404
// Label
405405
var gd = d.parcatsViewModel.graphDiv;
@@ -446,7 +446,7 @@ function mouseoverPath(d) {
446446
}
447447

448448
var hovertext = hovertextParts.join('<br>');
449-
var mouseX = d3.mouse(gd)[0];
449+
var mouseX = Lib.getPositionFromD3Event()[0];
450450

451451
Fx.loneHover({
452452
trace: trace,
@@ -978,7 +978,7 @@ function mouseoverCategoryBand(bandViewModel) {
978978
// hoverinfo is not skip, so we at least style the bands and emit interaction events
979979

980980
// Mouse
981-
var mouseY = d3.mouse(this)[1];
981+
var mouseY = Lib.getPositionFromD3Event()[1];
982982
if(mouseY < -1) {
983983
// Hover is above above the category rectangle (probably the dimension title text)
984984
return;
@@ -1085,8 +1085,8 @@ function dragDimensionStart(d) {
10851085
.each(
10861086
/** @param {CategoryViewModel} catViewModel */
10871087
function(catViewModel) {
1088-
var catMouseX = d3.mouse(this)[0];
1089-
var catMouseY = d3.mouse(this)[1];
1088+
var catMouseX = Lib.getPositionFromD3Event()[0];
1089+
var catMouseY = Lib.getPositionFromD3Event()[1];
10901090

10911091

10921092
if(-2 <= catMouseX && catMouseX <= catViewModel.width + 2 &&

0 commit comments

Comments
 (0)