Skip to content

Commit

Permalink
fix: more self vs this shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Oct 30, 2023
1 parent e6dbf50 commit 1ba3963
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/HorizontalRidgePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions src/VerticalRidgePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1ba3963

Please sign in to comment.