https://codesandbox.io/s/dark-shadow-sxz3q
const { strokeDasharray, strokeDashoffset } = getPerfectDashProps(
200,
10,
'dotted'
)
const { strokeDasharray, strokeDashoffset } = getPerfectDashProps(
200,
10,
'dashed'
)
// Produce dashes in multiple of two.
const { strokeDasharray, strokeDashoffset } = getPerfectDashProps(
200,
10,
'dashed',
2
)
// Produce dashes in multiple of four.
const { strokeDasharray, strokeDashoffset } = getPerfectDashProps(
200,
10,
'dashed',
2
)
A useful helper when using this with circles or ellipses: