Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Last active January 20, 2017 14:49
Show Gist options
  • Save antonkartashov/fe454df2fd668e8dd89d04caffc4ceed to your computer and use it in GitHub Desktop.
Save antonkartashov/fe454df2fd668e8dd89d04caffc4ceed 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