From 3cd5359c36502b226df3e41f868e5ff67f4154d5 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Fri, 17 Jun 2022 16:05:15 -0600 Subject: [PATCH] remove d3.event --- src/disagg/DisaggGraphView.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/disagg/DisaggGraphView.js b/src/disagg/DisaggGraphView.js index 43427b4..aaf82ce 100644 --- a/src/disagg/DisaggGraphView.js +++ b/src/disagg/DisaggGraphView.js @@ -576,8 +576,8 @@ var DisaggGraphView = function (options) { εbins: εbins, }); d3.select(view.el) - .on('mouseover', () => _onPointOver(view, bin)) - .on('mouseout', _onPointOut); + .on('mouseover', (event) => _onPointOver(event, view, bin)) + .on('mouseout', (event) => _onPointOut(event)); _this.bins.push(view); }); } @@ -598,8 +598,8 @@ var DisaggGraphView = function (options) { oldBins = null; }; - _onPointOver = function (disaggBinView, bin) { - var εbin = parseFloat(d3.event.target.parentNode.getAttribute('data-bin-index')); + _onPointOver = function (event, disaggBinView, bin) { + var εbin = parseFloat(event.target.parentNode.getAttribute('data-bin-index')); var value = bin.εdata.find((data) => data.εbin === εbin).value; var view = disaggBinView @@ -608,7 +608,7 @@ var DisaggGraphView = function (options) { var coords = view.items[0].coords[0]; coords = _this.d33d.project(coords); - var path = d3.event.target; + var path = event.target; ClassList.polyfill(path); path.classList.add('mouseover'); @@ -648,8 +648,8 @@ var DisaggGraphView = function (options) { ]); }; - _onPointOut = function () { - var path = d3.event.target; + _onPointOut = function (event) { + var path = event.target; ClassList.polyfill(path); path.classList.remove('mouseover'); _this.d33d.showTooltip(null, null); -- GitLab