Skip to content

Commit

Permalink
replace d3.mouse in parcats hover to work around firefox bug (plotly#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaVazz committed May 5, 2021
1 parent c80ce55 commit ff60f21
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/traces/parcats/parcats.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function mouseoverPath(d) {
// hoverinfo is a combination of 'count' and 'probability'

// Mouse
var hoverX = d3.mouse(this)[0];
var hoverX = Lib.getPositionFromD3Event()[0];

// Label
var gd = d.parcatsViewModel.graphDiv;
Expand Down Expand Up @@ -446,7 +446,7 @@ function mouseoverPath(d) {
}

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

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

// Mouse
var mouseY = d3.mouse(this)[1];
var mouseY = Lib.getPositionFromD3Event()[1];
if(mouseY < -1) {
// Hover is above above the category rectangle (probably the dimension title text)
return;
Expand Down Expand Up @@ -1085,8 +1085,8 @@ function dragDimensionStart(d) {
.each(
/** @param {CategoryViewModel} catViewModel */
function(catViewModel) {
var catMouseX = d3.mouse(this)[0];
var catMouseY = d3.mouse(this)[1];
var catMouseX = Lib.getPositionFromD3Event()[0];
var catMouseY = Lib.getPositionFromD3Event()[1];


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

0 comments on commit ff60f21

Please sign in to comment.