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); }