Skip to content

Commit e98eebb

Browse files
committed
Move display attribute of reference lines out of style specs
1 parent 9627830 commit e98eebb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

js/reference_lines.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const referenceLines = class {
6060
.attr("x2", plotObj.width - plotObj.margins.right)
6161
.attr("y1", d => plotObj.yscale(d.y))
6262
.attr("y2", d => plotObj.yscale(d.y))
63-
.style("display", d => inPlotY(d.y) ? null : "none");
63+
.attr("display", d => inPlotY(d.y) ? null : "none");
6464
this.horizontalLineGroup.selectAll("line.draggable-reference-line")
6565
.data(dataObj.referenceLines.horizontalLines)
6666
.join("line")
@@ -72,7 +72,7 @@ const referenceLines = class {
7272
.attr("y1", d => plotObj.yscale(d.y))
7373
.attr("y2", d => plotObj.yscale(d.y))
7474
.attr("index", (_, i) => "h" + i)
75-
.style("display", d => inPlotY(d.y) ? null : "none")
75+
.attr("display", d => inPlotY(d.y) ? null : "none")
7676
.on("mousedown", function() {self.selectedLine = d3.select(this)});
7777
this.horizontalLineGroup.selectAll("text")
7878
.data(dataObj.referenceLines.horizontalLines)
@@ -82,7 +82,7 @@ const referenceLines = class {
8282
.attr("y", d => plotObj.yscale(d.y) + 4)
8383
.attr("font-size", "8px")
8484
.attr("fill", d => d.color)
85-
.style("display", d => inPlotY(d.y) ? null : "none")
85+
.attr("display", d => inPlotY(d.y) ? null : "none")
8686
.text(d => d.y);
8787

8888
this.verticalLineGroup.selectAll("line.visible-reference-line")
@@ -96,7 +96,7 @@ const referenceLines = class {
9696
.attr("x2", d => plotObj.xscale(d.x))
9797
.attr("y1", plotObj.margins.top)
9898
.attr("y2", plotObj.height - plotObj.margins.bottom)
99-
.style("display", d => inPlotX(d.x) ? null : "none");
99+
.attr("display", d => inPlotX(d.x) ? null : "none");
100100
this.verticalLineGroup.selectAll("line.draggable-reference-line")
101101
.data(dataObj.referenceLines.verticalLines)
102102
.join("line")
@@ -108,7 +108,7 @@ const referenceLines = class {
108108
.attr("y1", plotObj.margins.top)
109109
.attr("y2", plotObj.height - plotObj.margins.bottom)
110110
.attr("index", (_, i) => "v" + i)
111-
.style("display", d => inPlotX(d.x) ? null : "none")
111+
.attr("display", d => inPlotX(d.x) ? null : "none")
112112
.on("mousedown", function() {self.selectedLine = d3.select(this)});
113113
this.verticalLineGroup.selectAll("text")
114114
.data(dataObj.referenceLines.verticalLines)
@@ -119,7 +119,7 @@ const referenceLines = class {
119119
.attr("y", plotObj.height - plotObj.margins.bottom + 10)
120120
.attr("font-size", "8px")
121121
.attr("fill", d => d.color)
122-
.style("display", d => inPlotX(d.x) ? null : "none")
122+
.attr("display", d => inPlotX(d.x) ? null : "none")
123123
.text(d => d.x)
124124
}
125125
};

0 commit comments

Comments
 (0)