From 1ba396342aa6ab6591b7b09c45f1a6f957f817ca Mon Sep 17 00:00:00 2001 From: Jayaram Kancherla Date: Mon, 30 Oct 2023 10:43:34 -0700 Subject: [PATCH] fix: more self vs this shenanigans --- package.json | 2 +- src/HorizontalRidgePlot.js | 8 ++++---- src/VerticalRidgePlot.js | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 8034825..2148cde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ridges.js", - "version": "0.0.4", + "version": "0.0.5", "description": "Create and visualize ridge plots", "repository": "https://github.com/jkanche/ridges.js", "homepage": "https://github.com/jkanche/ridges.js#readme", diff --git a/src/HorizontalRidgePlot.js b/src/HorizontalRidgePlot.js index a2bbedb..23e480b 100644 --- a/src/HorizontalRidgePlot.js +++ b/src/HorizontalRidgePlot.js @@ -110,13 +110,13 @@ export class HorizontalRidgePlot extends RidgePlot { .style("color", "#133355") .style("cursor", "pointer") .style("font-size", (d, i) => { - if (this._hoverKey === this._dkeys.indexOf(d)) { + if (self._hoverKey === self._dkeys.indexOf(d)) { return "14px"; } return "12px"; }) .style("font-weight", (d, i) => { - if (this._hoverKey === this._dkeys.indexOf(d)) { + if (self._hoverKey === self._dkeys.indexOf(d)) { return "bold"; } return "normal"; @@ -149,8 +149,8 @@ export class HorizontalRidgePlot extends RidgePlot { tip.style("opacity", 0); }) .on("click", function (e, d) { - const idx = this._dkeys.indexOf(d); - const mets = this._dentries[idx]; + const idx = self._dkeys.indexOf(d); + const mets = self._dentries[idx]; if (mets === null && "onClick" in self.state) { self.state.onClick(mets); } diff --git a/src/VerticalRidgePlot.js b/src/VerticalRidgePlot.js index 4690a64..5b51159 100644 --- a/src/VerticalRidgePlot.js +++ b/src/VerticalRidgePlot.js @@ -98,13 +98,13 @@ export class VerticalRidgePlot extends RidgePlot { .style("color", "#133355") .style("cursor", "pointer") .style("font-size", (d, i) => { - if (this._hoverKey === this._dkeys.indexOf(d)) { + if (self._hoverKey === self._dkeys.indexOf(d)) { return "14px"; } return "12px"; }) .style("font-weight", (d, i) => { - if (this._hoverKey === this._dkeys.indexOf(d)) { + if (self._hoverKey === self._dkeys.indexOf(d)) { return "bold"; } return "normal"; @@ -137,8 +137,8 @@ export class VerticalRidgePlot extends RidgePlot { tip.style("opacity", 0); }) .on("click", function (e, d) { - const idx = this._dkeys.indexOf(d); - const mets = this._dentries[idx]; + const idx = self._dkeys.indexOf(d); + const mets = self._dentries[idx]; if (mets === null && "onClick" in self.state) { self.state.onClick(mets); }