I've been trying to generate two paths on an SVG but it appears that one of the paths slightly disappears. I was wondering what's causing this issue. I've tried using different path drawing formula with no luck. The code is very simple as seen below:
import * as d3 from "d3";
let canvas = d3.select('#canvas');
let svg = canvas.append('svg')
.attr('width',1820)
.attr('height', 790)
.style('background-color', 'black')
var pathInfo = [
{
p: 'P',
data: [[0, 40], [50, 30], [100, 50], [200, 60], [300, 90]]
},
{
p:'p2',
data: [[0, 40], [50, 30], [100, 50], [200, 60], [350, 90]]
}
]
const curve = d3.line().curve(d3.curveNatural);
svg.selectAll('path')
.data(pathInfo)
.enter()
.append('path')
.attr('d', (d)=> curve(d.data)).attr('stroke', 'white')

