This commit is contained in:
Colin Megill
2017-12-12 21:37:19 -08:00
parent f89973aaa9
commit 68d99b71dc
3 changed files with 13 additions and 27 deletions
+7 -6
View File
@@ -20,20 +20,21 @@ const drawLinesCanvas = (
) => {
return (d) => {
ctx.globalAlpha = .1;
if (colorAccessor && colorScale) {
if (colorAccessor && colorScale && d["__selected__"]) {
ctx.strokeStyle = d3.interpolateViridis(colorScale(d[colorAccessor]));
} else {
ctx.strokeStyle = "rgba(0,0,0,1)";
ctx.strokeStyle = "rgba(0,0,0,.1)";
}
if (d["__selected__"]) {
ctx.strokeStyle = "rgb(255,0,0)";
}
// if () {
// ctx.strokeStyle = "rgb(0,0,0)";
// }
ctx.beginPath();
var coords = project(d, dimensions, xscale);
coords.forEach((p,i) => {
coords.forEach((p, i) => {
// this tricky bit avoids rendering null values as 0
if (p === null) {
// this bit renders horizontal lines on the previous/next