Skip to content

Commit

Permalink
Footer issues (#5)
Browse files Browse the repository at this point in the history
more self vs this issues!
  • Loading branch information
jkanche committed Nov 2, 2023
1 parent b8577aa commit 80a853f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 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.6",
"version": "0.0.7",
"description": "Create and visualize ridge plots",
"repository": "https://github.com/jkanche/ridges.js",
"homepage": "https://github.com/jkanche/ridges.js#readme",
Expand Down
4 changes: 4 additions & 0 deletions src/HorizontalRidgePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export class HorizontalRidgePlot extends RidgePlot {

let self = this;

self._width = width;
self._height = height;
self._margin = margin;

if (this.elem.querySelector("svg")) {
this.elem.querySelector("svg").innerHTML = "";
}
Expand Down
4 changes: 2 additions & 2 deletions src/RidgePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export class RidgePlot {
svg
.append("text")
.attr("text-anchor", "end")
.attr("x", width)
.attr("y", height + margin.bottom)
.attr("x", this._width)
.attr("y", this._height + this._margin.bottom)
.style("font-size", "10px")
.style("font-style", "italic")
.text(this.state.footer);
Expand Down
4 changes: 4 additions & 0 deletions src/VerticalRidgePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export class VerticalRidgePlot extends RidgePlot {
height = height - margin.top - margin.bottom;
let self = this;

self._width = width;
self._height = height;
self._margin = margin;

if (this.elem.querySelector("svg")) {
this.elem.querySelector("svg").innerHTML = "";
}
Expand Down

0 comments on commit 80a853f

Please sign in to comment.