Skip to content

Commit

Permalink
Linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xwatkins committed May 24, 2021
1 parent 23e43fa commit 7b936a7
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import ProtvistaTrack from "protvista-track";
import * as d3 from "d3";
import { scaleLinear, select, line, area, max, min, interpolateRainbow } from "d3";
import {
scaleLinear,
select,
line,
area,
max,
min,
interpolateRainbow,
} from "d3";

class NightingaleLinegraphTrack extends ProtvistaTrack {
connectedCallback() {
Expand Down Expand Up @@ -57,7 +65,8 @@ class NightingaleLinegraphTrack extends ProtvistaTrack {
.attr("id", (d) => d.name)
.attr("d", (d) => {
d.colour = d.colour || interpolateRainbow(Math.random()); // eslint-disable-line no-param-reassign
d.fill = d.fill || "none"
// eslint-disable-next-line no-param-reassign
d.fill = d.fill || "none";
return this.drawLine(d)(d.values);
})
.attr("fill", (d) => d.fill)
Expand Down Expand Up @@ -141,6 +150,7 @@ class NightingaleLinegraphTrack extends ProtvistaTrack {
Finding the nearest point in the path to the mouse pointer using iterative dichotomy.
Example can be found here - https://bl.ocks.org/larsenmtl/e3b8b7c2ca4787f77d78f58d41c3da91
*/
// eslint-disable-next-line no-constant-condition
while (true) {
target = Math.floor((beginning + end) / 2);
pos = lines.nodes()[i].getPointAtLength(target);
Expand Down Expand Up @@ -194,13 +204,12 @@ class NightingaleLinegraphTrack extends ProtvistaTrack {
const curve = d.lineCurve || "curveLinear";

let graph;
if (d.fill != "none") {
if (d.fill !== "none") {
graph = area()
.y1((d) => this._yScale(d.value))
.y0(() => this._yScale(0))
.y0(() => this._yScale(0));
} else {
graph = line()
.y((d) => this._yScale(d.value))
graph = line().y((d) => this._yScale(d.value));
}

return graph
Expand Down

0 comments on commit 7b936a7

Please sign in to comment.