I have seen the using of:
${startX} ${startY}
in javascript. That is totally new for me. I like the idea to use it, but don't know it is proove.
let cumulativePercent = 0;
function getCoordinatesForPercent(percent) {
const x = Math.cos(2 * Math.PI * percent);
const y = Math.sin(2 * Math.PI * percent);
return [x, y];
}
const [startX, startY] = getCoordinatesForPercent(cumulativePercent);
const pathData = [
`M ${startX} ${startY}`, // Move
`A 1 1 0 ${largeArcFlag} 1 ${endX} ${endY}`, // Arc
`L 0 0`, // Line
].join(' ');
I would write it like this:
const pathData = [
`M` + startX + ` ` + startY,
...
Does it works in jQuery also? Thx for any description-link in advance.