Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active January 26, 2017 20:43
Show Gist options
  • Save davidgilbertson/2cf7bd1f91cc8fd39aa9e553e639b9fd to your computer and use it in GitHub Desktop.
Save davidgilbertson/2cf7bd1f91cc8fd39aa9e553e639b9fd to your computer and use it in GitHub Desktop.
const percent = 0.12;
const startX = getCoordinatesForPercent(0)[0];
const startY = getCoordinatesForPercent(0)[1];
const endX = getCoordinatesForPercent(percent)[0];
const endY = getCoordinatesForPercent(percent)[1];
const largeArcFlag = percent > .5 ? 1 : 0;
const pathData = [
`M ${startX} ${startY}`,
`A 1 1 0 ${largeArcFlag} 1 ${endX} ${endY}`,
`L 0 0`,
].join(' ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment