I'm dynamically drawing an SVG path based on a data array (think linechart).
Would love to animate the chart transition when the data changes but this only makes sense for the Y values in my case.
The path is built
data.forEach(d => { path += `L ${pctCoordX(d.time)} ${pctCoordY(d.value)} `})
This works great for the fixed values and is called whenever data
changes to update the path.
Instead I'd like to have a reactive path that consist of something like
L ${pctCoordX(data[0].time)} ${tweenedY[0]} L ${pctCoordX(data[1].time)} ${tweenedY[1]}
but haven't found a away to make this work since it needs to be created dynamically and the amount of datapoints is not fixed.
Is there an elegant Svelte solution for this?