style2 = (x1, y1, x2, y2, lineWidth, value) => {
const theta = angleOfInclination(x1, y1, x2, y2);
const length = distance(x1, y1, x2, y2);
const baseLineWidth = lineWidth * 0.666;
const dotRadius = 0.5;
const [x2a, y2a] = rotatePoint(x2, y2, -theta, x1, y1);
let pts = partitionLine(x1, y1, x2a, y2a, length * 2).map((l) => l[0]);
pts = pts.filter(() => random.value() > 0.125);
const dotShift = baseLineWidth / 2 - dotRadius;
pts = pts.map(([x, y]) => {
let dy = (random.value() * 2 - 1) * dotRadius;
dy = dy < 0 ? dy - dotShift : dy + dotShift;
return [x, y + dy];
});
pts = pts.map(([x, y]) => rotatePoint(x, y, theta, x1, y1));
ctx.beginPath();
ctx.strokeStyle = palette.fg;
ctx.lineCap = "round";
ctx.lineWidth = baseLineWidth;
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
ctx.beginPath();
ctx.fillStyle = palette.fg;
pts.forEach(([cx, cy]) => {
ctx.moveTo(cx, cy);
ctx.arc(cx, cy, dotRadius, 0, Math.PI * 2);
});
ctx.fill();
}